Re: [patch 33/35] fs: icache introduce inode_get/inode_get_ilock

From: Boaz Harrosh
Date: Tue Oct 19 2010 - 06:17:38 EST


On 10/19/2010 05:42 AM, npiggin@xxxxxxxxx wrote:
> Factor open coded inode lock, increment, unlock into a function inode_get().
> Rename __iget to inode_get_ilock.
>
> Signed-off-by: Nick Piggin <npiggin@xxxxxxxxx>
>
> ---

<>

> Index: linux-2.6/fs/exofs/inode.c
> ===================================================================
> --- linux-2.6.orig/fs/exofs/inode.c 2010-10-19 14:18:58.000000000 +1100
> +++ linux-2.6/fs/exofs/inode.c 2010-10-19 14:19:16.000000000 +1100
> @@ -1162,9 +1162,7 @@
> /* increment the refcount so that the inode will still be around when we
> * reach the callback
> */
> - spin_lock(&inode->i_lock);
> - inode->i_count++;
> - spin_unlock(&inode->i_lock);
> + inode_get(inode);
>
> ios->done = create_done;
> ios->private = inode;
> Index: linux-2.6/fs/exofs/namei.c
> ===================================================================
> --- linux-2.6.orig/fs/exofs/namei.c 2010-10-19 14:18:58.000000000 +1100
> +++ linux-2.6/fs/exofs/namei.c 2010-10-19 14:19:00.000000000 +1100
> @@ -153,9 +153,7 @@
>
> inode->i_ctime = CURRENT_TIME;
> inode_inc_link_count(inode);
> - spin_lock(&inode->i_lock);
> - inode->i_count++;
> - spin_unlock(&inode->i_lock);
> + inode_get(inode);
>
> return exofs_add_nondir(dentry, inode);
> }

Why won't you define an intermediate inode_get() in patch 08/35 and
change both puts and gets of all file_systems in one patch? Instead
of two tree sweeping patches. (At least for all the trivial places
like here)

Thanks
Boaz


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/