diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_rw.c | 22 | ||||
-rw-r--r-- | fs/xfs/xfs_rw.h | 22 |
2 files changed, 23 insertions, 21 deletions
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c index 6fa10897d417..4c199d18f850 100644 --- a/fs/xfs/xfs_rw.c +++ b/fs/xfs/xfs_rw.c | |||
@@ -336,3 +336,25 @@ xfs_bwrite( | |||
336 | } | 336 | } |
337 | return (error); | 337 | return (error); |
338 | } | 338 | } |
339 | |||
340 | /* | ||
341 | * helper function to extract extent size hint from inode | ||
342 | */ | ||
343 | xfs_extlen_t | ||
344 | xfs_get_extsz_hint( | ||
345 | struct xfs_inode *ip) | ||
346 | { | ||
347 | xfs_extlen_t extsz; | ||
348 | |||
349 | if (unlikely(XFS_IS_REALTIME_INODE(ip))) { | ||
350 | extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) | ||
351 | ? ip->i_d.di_extsize | ||
352 | : ip->i_mount->m_sb.sb_rextsize; | ||
353 | ASSERT(extsz); | ||
354 | } else { | ||
355 | extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) | ||
356 | ? ip->i_d.di_extsize : 0; | ||
357 | } | ||
358 | |||
359 | return extsz; | ||
360 | } | ||
diff --git a/fs/xfs/xfs_rw.h b/fs/xfs/xfs_rw.h index 726014d1c925..571f2174435c 100644 --- a/fs/xfs/xfs_rw.h +++ b/fs/xfs/xfs_rw.h | |||
@@ -37,27 +37,6 @@ xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb) | |||
37 | } | 37 | } |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * helper function to extract extent size hint from inode | ||
41 | */ | ||
42 | STATIC_INLINE xfs_extlen_t | ||
43 | xfs_get_extsz_hint( | ||
44 | xfs_inode_t *ip) | ||
45 | { | ||
46 | xfs_extlen_t extsz; | ||
47 | |||
48 | if (unlikely(XFS_IS_REALTIME_INODE(ip))) { | ||
49 | extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) | ||
50 | ? ip->i_d.di_extsize | ||
51 | : ip->i_mount->m_sb.sb_rextsize; | ||
52 | ASSERT(extsz); | ||
53 | } else { | ||
54 | extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) | ||
55 | ? ip->i_d.di_extsize : 0; | ||
56 | } | ||
57 | return extsz; | ||
58 | } | ||
59 | |||
60 | /* | ||
61 | * Prototypes for functions in xfs_rw.c. | 40 | * Prototypes for functions in xfs_rw.c. |
62 | */ | 41 | */ |
63 | extern int xfs_write_clear_setuid(struct xfs_inode *ip); | 42 | extern int xfs_write_clear_setuid(struct xfs_inode *ip); |
@@ -69,5 +48,6 @@ extern int xfs_read_buf(struct xfs_mount *mp, xfs_buftarg_t *btp, | |||
69 | struct xfs_buf **bpp); | 48 | struct xfs_buf **bpp); |
70 | extern void xfs_ioerror_alert(char *func, struct xfs_mount *mp, | 49 | extern void xfs_ioerror_alert(char *func, struct xfs_mount *mp, |
71 | xfs_buf_t *bp, xfs_daddr_t blkno); | 50 | xfs_buf_t *bp, xfs_daddr_t blkno); |
51 | extern xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip); | ||
72 | 52 | ||
73 | #endif /* __XFS_RW_H__ */ | 53 | #endif /* __XFS_RW_H__ */ |