Skip to contentSkip to conversation

ocfs2: add comments on ocfs2_do_flock()

PATCH New Coly Li 1 participant 1 message Dec 2, 2008 OCFS2

lore
Share & tools
lore

Coly Li

author
#0 lore raw

PATCH 1/1 ocfs2: add comments on ocfs2_do_flock()

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.

---
 fs/ocfs2/locks.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/locks.c +3 -0
index 544ac62..cc9d947 100644
@@ -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
Signature · 2 lines
Coly Li
SuSE PRC Labs