On Fri, Dec 06, 2013 at 12:30:09PM -0800, Christoph Hellwig wrote:
> Make it clear that we're only locking against the extent map on the data
> fork. Also clean the function up a little bit.
>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
.....
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_inode.c 2013-12-06 19:57:33.199138169 +0100
> +++ xfs/fs/xfs/xfs_inode.c 2013-12-06 19:58:41.667136764 +0100
> @@ -91,20 +91,15 @@ xfs_get_extsz_hint(
> * xfs_iunlock() call.
> */
> uint
> -xfs_ilock_map_shared(
> - xfs_inode_t *ip)
> +xfs_ilock_data_map_shared(
> + struct xfs_inode *ip)
> {
> - uint lock_mode;
> + uint lock_mode = XFS_ILOCK_SHARED;
>
> - if ((ip->i_d.di_format == XFS_DINODE_FMT_BTREE) &&
> - ((ip->i_df.if_flags & XFS_IFEXTENTS) == 0)) {
> + if (ip->i_d.di_format == XFS_DINODE_FMT_BTREE &&
> + (ip->i_df.if_flags & XFS_IFEXTENTS) == 0)
> lock_mode = XFS_ILOCK_EXCL;
> - } else {
> - lock_mode = XFS_ILOCK_SHARED;
> - }
> -
> xfs_ilock(ip, lock_mode);
> -
> return lock_mode;
> }
While we are changing this, I think it makes sense to move it to
being a static inline function given how simple it is....
Otherwise it looks good.
Cheers,
Dave.
--
Dave Chinner
david@xxxxxxxxxxxxx
|