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