linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, nfs@lists.sourceforge.net
Subject: [PATCH 4/5] VFS: Add support for the FL_ACCESS flag to flock_lock_file()
Date: Mon, 26 Jun 2006 19:30:10 -0400	[thread overview]
Message-ID: <20060626233010.6059.52077.stgit@lade.trondhjem.org> (raw)
In-Reply-To: <20060626232936.6059.50399.stgit@lade.trondhjem.org>

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

 fs/locks.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/locks.c b/fs/locks.c
index 50cb0a2..b0b41a6 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -739,6 +739,8 @@ static int flock_lock_file(struct file *
 	int found = 0;
 
 	lock_kernel();
+	if (request->fl_flags & FL_ACCESS)
+		goto find_conflict;
 	for_each_lock(inode, before) {
 		struct file_lock *fl = *before;
 		if (IS_POSIX(fl))
@@ -771,6 +773,7 @@ static int flock_lock_file(struct file *
 	if (found)
 		cond_resched();
 
+find_conflict:
 	for_each_lock(inode, before) {
 		struct file_lock *fl = *before;
 		if (IS_POSIX(fl))
@@ -784,6 +787,8 @@ static int flock_lock_file(struct file *
 			locks_insert_block(fl, request);
 		goto out;
 	}
+	if (request->fl_flags & FL_ACCESS)
+		goto out;
 	locks_copy_lock(new_fl, request);
 	locks_insert_lock(&inode->i_flock, new_fl);
 	new_fl = NULL;

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  parent reply	other threads:[~2006-06-26 23:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 23:29 [PATCH 0/5] Enable extra optimisations on fcntl(F_UNLCK) requests on NFS Trond Myklebust
2006-06-26 23:30 ` [PATCH 1/5] VFS: Allow caller to determine if BSD or posix locks were actually freed Trond Myklebust
2006-06-26 23:30 ` [PATCH 2/5] NLM, NFSv4: Don't put UNLOCK requests on the wire unless we hold a lock Trond Myklebust
2006-06-26 23:30 ` [PATCH 3/5] NFSv4: Ensure nfs4_lock_expired() caches delegated locks Trond Myklebust
2006-06-26 23:30 ` Trond Myklebust [this message]
2006-06-26 23:30 ` [PATCH 5/5] NLM, NFSv4: Wait on local locks before we put RPC calls on the wire Trond Myklebust

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=20060626233010.6059.52077.stgit@lade.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    /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).