From: David Teigland <teigland@redhat.com>
To: Steven Whitehouse <swhiteho@redhat.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [RFC PATCH] locks: skip posix unlock when there are no posix locks
Date: Fri, 19 Aug 2011 11:07:19 -0400 [thread overview]
Message-ID: <20110819150719.GA14345@redhat.com> (raw)
In-Reply-To: <1313746839.2704.29.camel@menhir>
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;
>
prev parent reply other threads:[~2011-08-19 15:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 20:38 [RFC PATCH] locks: skip posix unlock when there are no posix locks David Teigland
2011-08-19 9:40 ` Steven Whitehouse
2011-08-19 15:07 ` David Teigland [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110819150719.GA14345@redhat.com \
--to=teigland@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=swhiteho@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).