]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: minor cleanup to Fh related code
authorXiubo Li <xiubli@redhat.com>
Tue, 9 Feb 2021 03:07:44 +0000 (11:07 +0800)
committerXiubo Li <xiubli@redhat.com>
Mon, 16 Aug 2021 05:25:54 +0000 (13:25 +0800)
To make the code more readable and there is no need to care about
the members order when initlizeing them.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/client/Fh.cc
src/client/Fh.h

index 62bd261404e213f626dc647f30757b6dc9da62e3..e72390df714c6ee19a1b28d1b6aa7dbf22ec96d8 100644 (file)
@@ -19,8 +19,8 @@
 #include "Fh.h"
 
 Fh::Fh(InodeRef in, int flags, int cmode, uint64_t _gen, const UserPerm &perms) :
-    inode(in), _ref(1), pos(0), mds(0), mode(cmode), gen(_gen), flags(flags),
-    pos_locked(false), actor_perms(perms), readahead()
+    inode(in), mode(cmode), gen(_gen), flags(flags), actor_perms(perms),
+    readahead()
 {
   inode->add_fh(this);
 }
index c3355ba6c52660930227e6e1b5a5c7a02a7a0d88..3448f5b6ac88e4419d53faf9c79077983d1ccc01 100644 (file)
@@ -13,14 +13,14 @@ class Inode;
 
 struct Fh {
   InodeRef  inode;
-  int      _ref;
-  loff_t    pos;
-  int       mds;        // have to talk to mds we opened with (for now)
+  int       _ref = 1;
+  loff_t    pos = 0;
+  int       mds = 0;        // have to talk to mds we opened with (for now)
   int       mode;       // the mode i opened the file with
   uint64_t  gen;
 
   int flags;
-  bool pos_locked;           // pos is currently in use
+  bool pos_locked = false;           // pos is currently in use
   std::list<ceph::condition_variable*> pos_waiters;   // waiters for pos
 
   UserPerm actor_perms; // perms I opened the file with