]> Git Repo - linux.git/blame - fs/xfs/xfs_iomap.h
Merge tag 'tty-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
[linux.git] / fs / xfs / xfs_iomap.h
CommitLineData
0b61f8a4 1// SPDX-License-Identifier: GPL-2.0
1da177e4 2/*
7b718769
NS
3 * Copyright (c) 2003-2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
1da177e4 5 */
1da177e4
LT
6#ifndef __XFS_IOMAP_H__
7#define __XFS_IOMAP_H__
8
68a9f5e7
CH
9#include <linux/iomap.h>
10
1da177e4
LT
11struct xfs_inode;
12struct xfs_bmbt_irec;
13
0799a3e8 14int xfs_iomap_write_direct(struct xfs_inode *, xfs_off_t, size_t,
a206c817 15 struct xfs_bmbt_irec *, int);
60b4984f 16int xfs_iomap_write_allocate(struct xfs_inode *, int, xfs_off_t,
e666aa37 17 struct xfs_bmbt_irec *, unsigned int *);
ee70daab 18int xfs_iomap_write_unwritten(struct xfs_inode *, xfs_off_t, xfs_off_t, bool);
1da177e4 19
3b3dce05
CH
20void xfs_bmbt_to_iomap(struct xfs_inode *, struct iomap *,
21 struct xfs_bmbt_irec *);
f7ca3522 22xfs_extlen_t xfs_eof_alignment(struct xfs_inode *ip, xfs_extlen_t extsize);
3b3dce05 23
f13eb205
CH
24static inline xfs_filblks_t
25xfs_aligned_fsb_count(
26 xfs_fileoff_t offset_fsb,
27 xfs_filblks_t count_fsb,
28 xfs_extlen_t extsz)
29{
30 if (extsz) {
31 xfs_extlen_t align;
32
0703a8e1 33 div_u64_rem(offset_fsb, extsz, &align);
f13eb205
CH
34 if (align)
35 count_fsb += align;
0703a8e1 36 div_u64_rem(count_fsb, extsz, &align);
f13eb205
CH
37 if (align)
38 count_fsb += extsz - align;
39 }
40
41 return count_fsb;
42}
43
8ff6daa1
CH
44extern const struct iomap_ops xfs_iomap_ops;
45extern const struct iomap_ops xfs_xattr_iomap_ops;
68a9f5e7 46
1da177e4 47#endif /* __XFS_IOMAP_H__*/
This page took 0.972997 seconds and 4 git commands to generate.