summaryrefslogtreecommitdiff
path: root/fs/ocfs2/aops.h
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-04-17 04:28:51 +0400
committerMark Fasheh <mark.fasheh@oracle.com>2007-04-27 02:07:45 +0400
commit7cdfc3a1c3971c9125c317cb8c2525745851798e (patch)
treeac0103cba9eaf0bc07b2e63893fa4e9637e6934e /fs/ocfs2/aops.h
parent8110b073a9135acf0a71bccfc20c0d1023f179c6 (diff)
downloadlinux-7cdfc3a1c3971c9125c317cb8c2525745851798e.tar.xz
ocfs2: Remember rw lock level during direct io
Cluster locking might have been redone because a direct write won't complete, so this needs to be reflected in the iocb. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/aops.h')
-rw-r--r--fs/ocfs2/aops.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/ocfs2/aops.h b/fs/ocfs2/aops.h
index 1b4ba5356a42..45821d479b5a 100644
--- a/fs/ocfs2/aops.h
+++ b/fs/ocfs2/aops.h
@@ -97,9 +97,16 @@ int ocfs2_map_and_write_splice_data(struct inode *inode,
/* all ocfs2_dio_end_io()'s fault */
#define ocfs2_iocb_is_rw_locked(iocb) \
test_bit(0, (unsigned long *)&iocb->private)
-#define ocfs2_iocb_set_rw_locked(iocb) \
- set_bit(0, (unsigned long *)&iocb->private)
+static inline void ocfs2_iocb_set_rw_locked(struct kiocb *iocb, int level)
+{
+ set_bit(0, (unsigned long *)&iocb->private);
+ if (level)
+ set_bit(1, (unsigned long *)&iocb->private);
+ else
+ clear_bit(1, (unsigned long *)&iocb->private);
+}
#define ocfs2_iocb_clear_rw_locked(iocb) \
clear_bit(0, (unsigned long *)&iocb->private)
-
+#define ocfs2_iocb_rw_locked_level(iocb) \
+ test_bit(1, (unsigned long *)&iocb->private)
#endif /* OCFS2_FILE_H */