From: Greg Farnum Date: Fri, 29 Jul 2016 22:47:32 +0000 (-0700) Subject: client: switch _create() implementation to UserPerm X-Git-Tag: v11.0.1~36^2~61 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e482a509b781f898072801ad1790bd9ea4fe2694;p=ceph.git client: switch _create() implementation to UserPerm Signed-off-by: Greg Farnum --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 1c6598bfa6a8..971189234911 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -10547,7 +10547,7 @@ int Client::ll_mknod(Inode *parent, const char *name, mode_t mode, int Client::_create(Inode *dir, const char *name, int flags, mode_t mode, InodeRef *inp, Fh **fhp, int stripe_unit, int stripe_count, int object_size, const char *data_pool, bool *created, - int uid, int gid) + const UserPerm& perms) { ldout(cct, 3) << "_create(" << dir->ino << " " << name << ", 0" << oct << mode << dec << ")" << dendl; @@ -10597,7 +10597,7 @@ int Client::_create(Inode *dir, const char *name, int flags, mode_t mode, mode |= S_IFREG; bufferlist xattrs_bl; - int res = _posix_acl_create(dir, &mode, xattrs_bl, uid, gid); + int res = _posix_acl_create(dir, &mode, xattrs_bl, perms.uid(), perms.gid()); if (res < 0) goto fail; req->head.args.open.mode = mode; @@ -10610,7 +10610,7 @@ int Client::_create(Inode *dir, const char *name, int flags, mode_t mode, goto fail; req->set_dentry(de); - res = make_request(req, uid, gid, inp, created); + res = make_request(req, perms, inp, created); if (res < 0) { goto reply_error; } diff --git a/src/client/Client.h b/src/client/Client.h index 0fbfa867ab09..20bdc2a7beb5 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -837,14 +837,15 @@ private: return _open(in, flags, mode, fhp, perms); } int _renew_caps(Inode *in); - int _create(Inode *in, const char *name, int flags, mode_t mode, InodeRef *inp, Fh **fhp, - int stripe_unit, int stripe_count, int object_size, const char *data_pool, - bool *created, int uid, int gid); int _create(Inode *in, const char *name, int flags, mode_t mode, InodeRef *inp, Fh **fhp, int stripe_unit, int stripe_count, int object_size, - const char *data_pool, bool *created, const UserPerm &perms) { + const char *data_pool, bool *created, const UserPerm &perms); + int _create(Inode *in, const char *name, int flags, mode_t mode, InodeRef *inp, Fh **fhp, + int stripe_unit, int stripe_count, int object_size, const char *data_pool, + bool *created, int uid, int gid) { + UserPerm perms(uid, gid); return _create(in, name, flags, mode, inp, fhp, stripe_unit, stripe_count, - object_size, data_pool, created, perms.uid(), perms.gid()); + object_size, data_pool, created, perms); } loff_t _lseek(Fh *fh, loff_t offset, int whence);