From: "J. Bruce Fields" <bfields@fieldses.org>
To: linux-fsdevel@vger.kernel.org
To: me <bfields@umich.edu>
Cc: nfs@lists.sourceforge.net, Marc Eshel <eshel@almaden.ibm.com>
Subject: [PATCH 4/10] locks: add fl_notify arguments
Date: Wed, 6 Dec 2006 00:34:14 -0500 [thread overview]
Message-ID: <11653832601635-git-send-email-bfields@fieldses.org> (raw)
Message-ID: <665bfdae3a5b77bb7755f4735069b7188f815d89.1165380893.git.bfields@citi.umich.edu> (raw)
In-Reply-To: <11653832601058-git-send-email-bfields@fieldses.org>
In-Reply-To: <8eb625184e6025f7f3d081dfe0a805abdd62a068.1165380892.git.bfields@citi.umich.edu>
From: J. Bruce Fields <bfields@fieldses.org>
We're using fl_notify to asynchronously return the result of a lock
request. So we want fl_notify to be able to return a status and, if
appropriate, a conflicting lock.
This only current caller of fl_notify is in the blocked case, in which case
we don't use these extra arguments.
We also allow fl_notify to return an error. (Also ignored for now.)
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
fs/lockd/svclock.c | 7 ++++---
fs/locks.c | 2 +-
include/linux/fs.h | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 2ce4dc6..32f4cc4 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -637,12 +637,13 @@ nlmsvc_cancel_blocked(struct nlm_file *file, struct nlm_lock *lock)
* This function doesn't grant the blocked lock instantly, but rather moves
* the block to the head of nlm_blocked where it can be picked up by lockd.
*/
-static void
-nlmsvc_notify_blocked(struct file_lock *fl)
+static int
+nlmsvc_notify_blocked(struct file_lock *fl, struct file_lock *conf, int result)
{
struct nlm_block *block;
- dprintk("lockd: VFS unblock notification for block %p\n", fl);
+ dprintk("lockd: nlmsvc_notify_blocked lock %p conf %p result %d\n",
+ fl, conf, result);
list_for_each_entry(block, &nlm_blocked, b_list) {
if (nlm_compare_locks(&block->b_call->a_args.lock.fl, fl)) {
nlmsvc_insert_block(block, 0);
diff --git a/fs/locks.c b/fs/locks.c
index 451a61a..959347e 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -544,7 +544,7 @@ static void locks_wake_up_blocks(struct file_lock *blocker)
struct file_lock, fl_block);
__locks_delete_block(waiter);
if (waiter->fl_lmops && waiter->fl_lmops->fl_notify)
- waiter->fl_lmops->fl_notify(waiter);
+ waiter->fl_lmops->fl_notify(waiter, NULL, -EAGAIN);
else
wake_up(&waiter->fl_wait);
}
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b1d287b..9b57afc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -795,7 +795,7 @@ struct file_lock_operations {
struct lock_manager_operations {
int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
- void (*fl_notify)(struct file_lock *); /* unblock callback */
+ int (*fl_notify)(struct file_lock *, struct file_lock *, int);
void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
void (*fl_release_private)(struct file_lock *);
void (*fl_break)(struct file_lock *);
--
1.4.4.1
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2006-12-06 5:34 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-06 5:34 asynchronous locks for cluster exports J. Bruce Fields
2006-12-06 5:34 ` [PATCH 1/10] lockd: add new export operation for nfsv4/lockd locking J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-09 5:53 ` Wendy Cheng
2006-12-10 18:31 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 2/10] nfsd4: Convert NFSv4 to new lock interface J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 3/10] lockd: request deferral routine J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields [this message]
2006-12-06 5:34 ` [PATCH 4/10] locks: add fl_notify arguments J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 5/10] lockd: handle fl_notify callbacks J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 6/10] lockd: pass cookie in nlmsvc_testlock J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 7/10] lockd: handle test_lock deferrals J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 8/10] lockd: always preallocate block in nlmsvc_lock() J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 9/10] lockd: add code to handle deferred lock requests J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 10/10] gfs2: nfs lock support for gfs2 J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 6:00 ` [NFS] " Wendy Cheng
2006-12-06 13:26 ` Wendy Cheng
2006-12-06 12:02 ` [Cluster-devel] " Steven Whitehouse
2006-12-06 12:02 ` Steven Whitehouse
2006-12-06 15:49 ` David Teigland
2006-12-06 19:57 ` J. Bruce Fields
2006-12-06 20:08 ` [NFS] " J. Bruce Fields
2006-12-06 20:58 ` David Teigland
2006-12-06 21:23 ` J. Bruce Fields
2006-12-06 21:42 ` David Teigland
2006-12-06 22:00 ` [NFS] " J. Bruce Fields
2006-12-07 15:30 ` David Teigland
2006-12-08 17:35 ` [NFS] " J. Bruce Fields
2006-12-07 6:47 ` Marc Eshel
2006-12-07 15:23 ` J. Bruce Fields
2006-12-07 15:43 ` [NFS] " Marc Eshel
2006-12-07 16:21 ` J. Bruce Fields
2006-12-07 18:52 ` [NFS] " Trond Myklebust
2006-12-14 23:04 ` [PATCH 1/10] lockd: add new export operation for nfsv4/lockd locking J. Bruce Fields
2006-12-15 5:52 ` Marc Eshel
2006-12-15 7:40 ` Christoph Hellwig
2006-12-07 16:51 ` asynchronous locks for cluster exports Christoph Hellwig
2006-12-14 22:51 ` J. Bruce Fields
2006-12-15 19:51 ` J. Bruce Fields
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=11653832601635-git-send-email-bfields@fieldses.org \
--to=bfields@fieldses.org \
--cc=eshel@almaden.ibm.com \
--cc=linux-fsdevel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.