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 <[EMAIL PROTECTED]>
---
 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


_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

Reply via email to