0001
0002
0003
0004
0005
0006 #ifndef __XFS_BMAP_UTIL_H__
0007 #define __XFS_BMAP_UTIL_H__
0008
0009
0010
0011 struct xfs_bmbt_irec;
0012 struct xfs_extent_free_item;
0013 struct xfs_ifork;
0014 struct xfs_inode;
0015 struct xfs_mount;
0016 struct xfs_trans;
0017 struct xfs_bmalloca;
0018
0019 #ifdef CONFIG_XFS_RT
0020 int xfs_bmap_rtalloc(struct xfs_bmalloca *ap);
0021 #else
0022
0023
0024
0025
0026 static inline int
0027 xfs_bmap_rtalloc(struct xfs_bmalloca *ap)
0028 {
0029 return -EFSCORRUPTED;
0030 }
0031 #endif
0032
0033 int xfs_bmap_punch_delalloc_range(struct xfs_inode *ip,
0034 xfs_fileoff_t start_fsb, xfs_fileoff_t length);
0035
0036 struct kgetbmap {
0037 __s64 bmv_offset;
0038 __s64 bmv_block;
0039 __s64 bmv_length;
0040 __s32 bmv_oflags;
0041 };
0042 int xfs_getbmap(struct xfs_inode *ip, struct getbmapx *bmv,
0043 struct kgetbmap *out);
0044
0045
0046 int xfs_bmap_extsize_align(struct xfs_mount *mp, struct xfs_bmbt_irec *gotp,
0047 struct xfs_bmbt_irec *prevp, xfs_extlen_t extsz,
0048 int rt, int eof, int delay, int convert,
0049 xfs_fileoff_t *offp, xfs_extlen_t *lenp);
0050 void xfs_bmap_adjacent(struct xfs_bmalloca *ap);
0051 int xfs_bmap_last_extent(struct xfs_trans *tp, struct xfs_inode *ip,
0052 int whichfork, struct xfs_bmbt_irec *rec,
0053 int *is_empty);
0054
0055
0056 int xfs_alloc_file_space(struct xfs_inode *ip, xfs_off_t offset,
0057 xfs_off_t len);
0058 int xfs_free_file_space(struct xfs_inode *ip, xfs_off_t offset,
0059 xfs_off_t len);
0060 int xfs_collapse_file_space(struct xfs_inode *, xfs_off_t offset,
0061 xfs_off_t len);
0062 int xfs_insert_file_space(struct xfs_inode *, xfs_off_t offset,
0063 xfs_off_t len);
0064
0065
0066 bool xfs_can_free_eofblocks(struct xfs_inode *ip, bool force);
0067 int xfs_free_eofblocks(struct xfs_inode *ip);
0068
0069 int xfs_swap_extents(struct xfs_inode *ip, struct xfs_inode *tip,
0070 struct xfs_swapext *sx);
0071
0072 xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb);
0073
0074 xfs_extnum_t xfs_bmap_count_leaves(struct xfs_ifork *ifp, xfs_filblks_t *count);
0075 int xfs_bmap_count_blocks(struct xfs_trans *tp, struct xfs_inode *ip,
0076 int whichfork, xfs_extnum_t *nextents,
0077 xfs_filblks_t *count);
0078
0079 int xfs_flush_unmap_range(struct xfs_inode *ip, xfs_off_t offset,
0080 xfs_off_t len);
0081
0082 #endif