]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client/MetaRequest: open w/ O_CREAT|O_TRUNC is write.
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 17 Sep 2015 02:05:46 +0000 (10:05 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 17 Sep 2015 02:05:46 +0000 (10:05 +0800)
From the function name is_write, it judge MetaRequest whether write.
For open, if it w/ O_CREAT|O_TRUNC, it's a write op and vice versa.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/client/MetaRequest.h

index 1bb0f6d3d94958f961f69f11be7f23b8806a3b8d..bb624b297ac60f6658ab32795d3551f01cc3d6db 100644 (file)
@@ -167,7 +167,7 @@ public:
   bool is_write() {
     return
       (head.op & CEPH_MDS_OP_WRITE) || 
-      (head.op == CEPH_MDS_OP_OPEN && !(head.args.open.flags & (O_CREAT|O_TRUNC)));
+      (head.op == CEPH_MDS_OP_OPEN && (head.args.open.flags & (O_CREAT|O_TRUNC)));
   }
   bool can_forward() {
     if (is_write() ||