From: Matthew Wilcox <willy@debian.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Restore an optimisation to locks.c
Date: Thu, 22 Aug 2002 15:12:32 +0100 [thread overview]
Message-ID: <20020822151232.V29958@parcelfarce.linux.theplanet.co.uk> (raw)
akpm reports that this optimisation I removed in 2.4.30 actually has
a noticeable impact. Please apply:
diff -urpNX dontdiff linux-2.5.31/fs/locks.c linux-2.5.31-willy/fs/locks.c
--- linux-2.5.31/fs/locks.c 2002-08-01 14:16:39.000000000 -0700
+++ linux-2.5.31-willy/fs/locks.c 2002-08-21 08:29:29.000000000 -0700
@@ -1609,6 +1612,14 @@ void locks_remove_posix(struct file *fil
{
struct file_lock lock;
+ /*
+ * If there are no locks held on this file, we don't need to call
+ * posix_lock_file(). Another process could be setting a lock on this
+ * file at the same time, but we wouldn't remove that lock anyway.
+ */
+ if (!filp->f_dentry->d_inode->i_flock)
+ return;
+
lock.fl_type = F_UNLCK;
lock.fl_flags = FL_POSIX;
lock.fl_start = 0;
--
Revolutions do not require corporate support.
reply other threads:[~2002-08-22 14:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20020822151232.V29958@parcelfarce.linux.theplanet.co.uk \
--to=willy@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®