Merge PR #17778 into master

* refs/remotes/upstream/pull/17778/head:
	client: move Fh init to ctor

Reviewed-by: Jos Collin <jcollin@redhat.com>
This commit is contained in:
Patrick Donnelly 2017-09-20 12:38:18 -07:00
commit ca775fd02d
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
3 changed files with 7 additions and 11 deletions

View File

@ -8330,15 +8330,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;

View 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);
}

View 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; }