From: Coly Li <coyli@suse.de>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: add comments on ocfs2_do_flock()
Date: Tue, 02 Dec 2008 19:20:22 +0800 [thread overview]
Message-ID: <493519F6.5070308@suse.de> (raw)
This patch adds a comment to explain when file is locked and F_SETLKW is set, -EWOULDBLOCK should be
returned other than -EAGAIN.
It helps the code to be more understandable.
Signed-off-by: Coly Li <coyli@suse.de>
---
fs/ocfs2/locks.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/ocfs2/locks.c b/fs/ocfs2/locks.c
index 544ac62..cc9d947 100644
--- a/fs/ocfs2/locks.c
+++ b/fs/ocfs2/locks.c
@@ -75,6 +75,9 @@ static int ocfs2_do_flock(struct file *file, struct inode *inode,
ret = ocfs2_file_lock(file, level, trylock);
if (ret) {
+ /* The file is locked and the F_SETLKW
+ * flag is NOT set in cmd.
+ */
if (ret == -EAGAIN && trylock)
ret = -EWOULDBLOCK;
else
--
Coly Li
SuSE PRC Labs
reply other threads:[~2008-12-02 11:20 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=493519F6.5070308@suse.de \
--to=coyli@suse.de \
--cc=ocfs2-devel@oss.oracle.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 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.