lkml.org 
[lkml]   [2002]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Restore an optimisation to locks.c

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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.044 / U:2.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site