aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rw.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_rw.h')
-rw-r--r--fs/xfs/xfs_rw.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/xfs/xfs_rw.h b/fs/xfs/xfs_rw.h
index ba74000931ec..fcf28dbded7c 100644
--- a/fs/xfs/xfs_rw.h
+++ b/fs/xfs/xfs_rw.h
@@ -77,6 +77,28 @@ xfs_fsb_to_db_io(struct xfs_iocore *io, xfs_fsblock_t fsb)
77#define XFS_FREE_EOF_LOCK (1<<0) 77#define XFS_FREE_EOF_LOCK (1<<0)
78#define XFS_FREE_EOF_NOLOCK (1<<1) 78#define XFS_FREE_EOF_NOLOCK (1<<1)
79 79
80
81/*
82 * helper function to extract extent size hint from inode
83 */
84STATIC_INLINE xfs_extlen_t
85xfs_get_extsz_hint(
86 xfs_inode_t *ip)
87{
88 xfs_extlen_t extsz;
89
90 if (unlikely(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) {
91 extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE)
92 ? ip->i_d.di_extsize
93 : ip->i_mount->m_sb.sb_rextsize;
94 ASSERT(extsz);
95 } else {
96 extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE)
97 ? ip->i_d.di_extsize : 0;
98 }
99 return extsz;
100}
101
80/* 102/*
81 * Prototypes for functions in xfs_rw.c. 103 * Prototypes for functions in xfs_rw.c.
82 */ 104 */