xfs
[Top] [All Lists]

Re: [PATCH 03/11] xfs: rename xfs_ilock_map_shared

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 03/11] xfs: rename xfs_ilock_map_shared
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 9 Dec 2013 09:33:59 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20131206203128.511935311@xxxxxxxxxxxxxxxxxxxxxx>
References: <20131206203006.914776999@xxxxxxxxxxxxxxxxxxxxxx> <20131206203128.511935311@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
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

<Prev in Thread] Current Thread [Next in Thread>