]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: switch _create() implementation to UserPerm
authorGreg Farnum <gfarnum@redhat.com>
Fri, 29 Jul 2016 22:47:32 +0000 (15:47 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 21 Sep 2016 23:33:49 +0000 (16:33 -0700)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/client/Client.cc
src/client/Client.h

index 1c6598bfa6a82a498d25f7059f04ce88efaab12a..971189234911f67f290b820ef2e625cdba67977b 100644 (file)
@@ -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;
   }
index 0fbfa867ab09cd021a6f1b94ae7aea01742d6e01..20bdc2a7beb5147da3b94fc960bab21a97cb2432 100644 (file)
@@ -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);