]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: move Fh init to ctor 17778/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 16 Mar 2017 18:30:52 +0000 (14:30 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 18 Sep 2017 19:48:12 +0000 (12:48 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/client/Client.cc
src/client/Fh.cc
src/client/Fh.h

index 049f33b8ad7b91f6627cc594313afb77229b5384..f4ef49ea8178df66ccc73e0930b77996b47c1dc4 100644 (file)
@@ -8329,15 +8329,10 @@ int Client::lookup_name(Inode *ino, Inode *parent, const UserPerm& perms)
 }
 
 
- Fh *Client::_create_fh(Inode *in, int flags, int cmode, const UserPerm& perms)
+Fh *Client::_create_fh(Inode *in, int flags, int cmode, const UserPerm& perms)
 {
   assert(in);
-  Fh *f = new Fh(in);
-  f->mode = cmode;
-  f->flags = flags;
-
-  // inode
-  f->actor_perms = perms;
+  Fh *f = new Fh(in, flags, cmode, perms);
 
   ldout(cct, 10) << "_create_fh " << in->ino << " mode " << cmode << dendl;
 
index e42a9d4128e9e9554bbc39e24b904e87446e931a..b2c68a2cb373fc4eaf4699f7a0cec5996428c4cc 100644 (file)
@@ -18,9 +18,9 @@
 
 #include "Fh.h"
 
-Fh::Fh(Inode *in) : inode(in), _ref(1), pos(0), mds(0), mode(0), flags(0),
-                pos_locked(false), actor_perms(), readahead(),
-                fcntl_locks(NULL), flock_locks(NULL)
+Fh::Fh(InodeRef in, int flags, int cmode, const UserPerm &perms) :
+    inode(in), _ref(1), pos(0), mds(0), mode(cmode), flags(flags), pos_locked(false),
+    actor_perms(perms), readahead(), fcntl_locks(NULL), flock_locks(NULL)
 {
   inode->add_fh(this);
 }
index 33733a5e1c16c1e7d8a81f1d06eeda99e91dd2c4..979456c5a16b2778352cb65f4c9bce91a0a63bac 100644 (file)
@@ -44,7 +44,8 @@ struct Fh {
       return e;
   }
   
-  Fh(Inode *in);
+  Fh() = delete;
+  Fh(InodeRef in, int flags, int cmode, const UserPerm &perms);
   ~Fh();
   void get() { ++_ref; }
   int put() { return --_ref; }