1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __XFS_BMAP_UTIL_H__
19#define __XFS_BMAP_UTIL_H__
20
21
22
23struct xfs_bmbt_irec;
24struct xfs_extent_free_item;
25struct xfs_ifork;
26struct xfs_inode;
27struct xfs_mount;
28struct xfs_trans;
29struct xfs_bmalloca;
30
31#ifdef CONFIG_XFS_RT
32int xfs_bmap_rtalloc(struct xfs_bmalloca *ap);
33#else
34
35
36
37
38static inline int
39xfs_bmap_rtalloc(struct xfs_bmalloca *ap)
40{
41 return -EFSCORRUPTED;
42}
43#endif
44
45int xfs_bmap_eof(struct xfs_inode *ip, xfs_fileoff_t endoff,
46 int whichfork, int *eof);
47int xfs_bmap_punch_delalloc_range(struct xfs_inode *ip,
48 xfs_fileoff_t start_fsb, xfs_fileoff_t length);
49
50
51typedef int (*xfs_bmap_format_t)(void **, struct getbmapx *);
52int xfs_getbmap(struct xfs_inode *ip, struct getbmapx *bmv,
53 xfs_bmap_format_t formatter, void *arg);
54
55
56int xfs_bmap_extsize_align(struct xfs_mount *mp, struct xfs_bmbt_irec *gotp,
57 struct xfs_bmbt_irec *prevp, xfs_extlen_t extsz,
58 int rt, int eof, int delay, int convert,
59 xfs_fileoff_t *offp, xfs_extlen_t *lenp);
60void xfs_bmap_adjacent(struct xfs_bmalloca *ap);
61int xfs_bmap_last_extent(struct xfs_trans *tp, struct xfs_inode *ip,
62 int whichfork, struct xfs_bmbt_irec *rec,
63 int *is_empty);
64
65
66int xfs_alloc_file_space(struct xfs_inode *ip, xfs_off_t offset,
67 xfs_off_t len, int alloc_type);
68int xfs_free_file_space(struct xfs_inode *ip, xfs_off_t offset,
69 xfs_off_t len);
70int xfs_zero_file_space(struct xfs_inode *ip, xfs_off_t offset,
71 xfs_off_t len);
72int xfs_collapse_file_space(struct xfs_inode *, xfs_off_t offset,
73 xfs_off_t len);
74int xfs_insert_file_space(struct xfs_inode *, xfs_off_t offset,
75 xfs_off_t len);
76
77
78bool xfs_can_free_eofblocks(struct xfs_inode *ip, bool force);
79int xfs_free_eofblocks(struct xfs_inode *ip);
80
81int xfs_swap_extents(struct xfs_inode *ip, struct xfs_inode *tip,
82 struct xfs_swapext *sx);
83
84xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb);
85
86xfs_extnum_t xfs_bmap_count_leaves(struct xfs_ifork *ifp, xfs_filblks_t *count);
87int xfs_bmap_count_blocks(struct xfs_trans *tp, struct xfs_inode *ip,
88 int whichfork, xfs_extnum_t *nextents,
89 xfs_filblks_t *count);
90
91#endif
92