Re: [RFC PATCH] locks: skip posix unlock when there are no posix locks

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

 



On Fri, Aug 19, 2011 at 10:40:39AM +0100, Steven Whitehouse wrote:
> > -	if (!filp->f_path.dentry->d_inode->i_flock)
> > +	inode = filp->f_path.dentry->d_inode;
> > +
> > +	if (!inode->i_flock)
> >  		return;
> >  
> So if you take the lock at this point, and drop it after the loop, that
> should resolve the issue without incurring the extra overhead on every
> single close,

Yep, thanks.

> > +	for_each_lock(inode, before) {
> > +		struct file_lock *fl = *before;
> > +		if (IS_POSIX(fl))
> > +			goto do_unlock;
> > +	}
> > +	return;
> > +
> > +do_unlock:
> >  	lock.fl_type = F_UNLCK;
> >  	lock.fl_flags = FL_POSIX | FL_CLOSE;
> >  	lock.fl_start = 0;
> 
--
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