Re: [PATCH v3 4/4] vfs: Use dlock list for superblock's inode list

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

 



Hello,

On Tue, Jul 19, 2016 at 06:23:42AM +0100, Al Viro wrote:
> On Fri, Jul 15, 2016 at 01:39:43PM -0400, Waiman Long wrote:
> > +		inode   = list_entry(iter.curr, struct inode, i_sb_list);
> > +		mapping = inode->i_mapping;
> 
> TBH, I would very much prefer something like
> 	DEFINE_DLOCK_LIST_ITER(iter, &blockdev_superblock->s_inodes);
> 
> 	dlist_for_each_entry(inode, &iter, i_sb_list) {
> 		mapping = inode->i_mapping;
> 
> > -		spin_unlock(&blockdev_superblock->s_inode_list_lock);
> > +		spin_unlock(iter.lock);
> 
> ... and this might be worth dlist_{un,re}lock(&iter);

If iterating requires prep / cleanup stages, it might as well do

	DEFINE_DLOCK_LIST_ITER(iter);

	dlock_list_iter_start(&iter, &blockdev_superblock->s_inodes);

	// iterate

	dlock_list_iter_end(&iter);

And probably provide dlist_for_each_entry() macro which handles
everything.

Thanks.

-- 
tejun
--
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