Unionfs: use igrab instead of atomic_inc inode refcnt
authorErez_Zadok <ezk@cs.sunysb.edu>
Fri, 16 Nov 2007 18:47:05 +0000 (13:47 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:02:58 +0000 (19:02 -0400)
In branch management code, use igrab() which is better than directly
incrementing the lower inode reference count.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/super.c

index 1d53608ba421075a58b5ca25fce3c9e5e38b21f4..261390fdd7bf501bf64b0b5443c7f3cdecb28ee2 100644 (file)
@@ -773,7 +773,7 @@ out_no_change:
        for (i=dbstart(sb->s_root); i<=dbend(sb->s_root); i++) {
                struct dentry *lower_dentry =
                        unionfs_lower_dentry_idx(sb->s_root, i);
-               atomic_inc(&lower_dentry->d_inode->i_count);
+               igrab(lower_dentry->d_inode);
                new_lower_inodes[i] = lower_dentry->d_inode;
        }
        /* 2. release reference on all older lower inodes */