Re: [PATCH 10/13] filesystems: add set_nlink()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steven Whitehouse <swhiteho@xxxxxxxxxx> writes:

> Hi,
>
> On Wed, 2011-10-12 at 16:49 +0200, Miklos Szeredi wrote:
>> From: Miklos Szeredi <mszeredi@xxxxxxx>
>> 
>> Replace remaining direct i_nlink updates with a new set_nlink()
>> updater function.
>> 
>> Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx>
>> ---
> [snip]
>
>
>
>> diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
>> index da21eca..102cf5e 100644
>> --- a/fs/gfs2/glops.c
>> +++ b/fs/gfs2/glops.c
>> @@ -277,7 +277,7 @@ static void gfs2_set_nlink(struct inode *inode, u32 nlink)
>>  		if (nlink == 0)
>>  			clear_nlink(inode);
>>  		else
>> -			inode->i_nlink = nlink;
>> +			set_nlink(inode, nlink);
>>  	}
>>  }
>
> So long as it is ok to call set_nlink() with nlink == 0, then the if
> statement here can be removed and just replaced with set_nlink()

Current patchset will WARN if set_nlink() is called with nlink == 0.  I
think it's cleaner to keep the two cases separate.

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux