diff options
author | David Chinner <dgc@sgi.com> | 2007-06-18 08:50:37 +0200 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-07-14 07:35:36 +0200 |
commit | 957d0ebed04239b734552c7da3fae9094b6f090c (patch) | |
tree | 6f5034b22028a03e31771d1a3fa5ad8d59557c09 /fs/xfs/xfs_rw.h | |
parent | [XFS] Prevent ENOSPC from aborting transactions that need to succeed (diff) | |
download | linux-957d0ebed04239b734552c7da3fae9094b6f090c.tar.xz linux-957d0ebed04239b734552c7da3fae9094b6f090c.zip |
[XFS] Cleanup inode extent size hint extraction
SGI-PV: 966004
SGI-Modid: xfs-linux-melb:xfs-kern:28866a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_rw.h')
-rw-r--r-- | fs/xfs/xfs_rw.h | 22 |
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) #define XFS_FREE_EOF_LOCK (1<<0) #define XFS_FREE_EOF_NOLOCK (1<<1) + +/* + * helper function to extract extent size hint from inode + */ +STATIC_INLINE xfs_extlen_t +xfs_get_extsz_hint( + xfs_inode_t *ip) +{ + xfs_extlen_t extsz; + + if (unlikely(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) { + extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) + ? ip->i_d.di_extsize + : ip->i_mount->m_sb.sb_rextsize; + ASSERT(extsz); + } else { + extsz = (ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) + ? ip->i_d.di_extsize : 0; + } + return extsz; +} + /* * Prototypes for functions in xfs_rw.c. */ |