The underlying plumbing needs to remain the same for FUSE though.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
return r;
}
+int Client::ll_mknodx(Inode *parent, const char *name, mode_t mode,
+ dev_t rdev, Inode **out,
+ struct ceph_statx *stx, unsigned want, unsigned flags,
+ const UserPerm& perms)
+{
+ unsigned caps = statx_to_mask(flags, want);
+ Mutex::Locker lock(client_lock);
+
+ vinodeno_t vparent = _get_vino(parent);
+
+ ldout(cct, 3) << "ll_mknodx " << vparent << " " << name << dendl;
+ tout(cct) << "ll_mknodx" << std::endl;
+ tout(cct) << vparent.ino.val << std::endl;
+ tout(cct) << name << std::endl;
+ tout(cct) << mode << std::endl;
+ tout(cct) << rdev << std::endl;
+
+ if (!cct->_conf->fuse_default_permissions) {
+ int r = may_create(parent, perms);
+ if (r < 0)
+ return r;
+ }
+
+ InodeRef in;
+ int r = _mknod(parent, name, mode, rdev, perms, &in);
+ if (r == 0) {
+ fill_statx(in, caps, stx);
+ _ll_get(in.get());
+ }
+ tout(cct) << stx->stx_ino << std::endl;
+ ldout(cct, 3) << "ll_mknodx " << vparent << " " << name
+ << " = " << r << " (" << hex << stx->stx_ino << dec << ")" << dendl;
+ *out = in.get();
+ return r;
+}
+
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 ll_readlink(Inode *in, char *buf, size_t bufsize, const UserPerm& perms);
int ll_mknod(Inode *in, const char *name, mode_t mode, dev_t rdev,
struct stat *attr, Inode **out, const UserPerm& perms);
+ int ll_mknodx(Inode *parent, const char *name, mode_t mode, dev_t rdev,
+ Inode **out, struct ceph_statx *stx, unsigned want,
+ unsigned flags, const UserPerm& perms);
int ll_mkdir(Inode *in, const char *name, mode_t mode, struct stat *attr,
Inode **out, const UserPerm& perm);
int ll_symlink(Inode *in, const char *name, const char *value,
const char *name, mode_t mode, int oflags, Inode **outp,
Fh **fhp, struct ceph_statx *stx, unsigned want,
unsigned lflags, const UserPerm *perms);
-int ceph_ll_mknod(struct ceph_mount_info *cmount, struct Inode *parent,
- const char *name, mode_t mode, dev_t rdev,
- struct stat *attr, struct Inode **out,
- int uid, int gid);
+int ceph_ll_mknod(struct ceph_mount_info *cmount, Inode *parent,
+ const char *name, mode_t mode, dev_t rdev, Inode **out,
+ struct ceph_statx *stx, unsigned want, unsigned flags,
+ const UserPerm *perms);
int ceph_ll_mkdir(struct ceph_mount_info *cmount, struct Inode *parent,
const char *name, mode_t mode, struct stat *attr,
Inode **out, int uid, int gid);
fhp, stx, want, lflags, *perms);
}
-extern "C" int ceph_ll_mknod(class ceph_mount_info *cmount,
- struct Inode *parent, const char *name,
- mode_t mode, dev_t rdev, struct stat *attr,
- struct Inode **out, int uid, int gid)
-{
- UserPerm perms(uid, gid);
- return (cmount->get_client())->ll_mknod(parent, name, mode, rdev,
- attr, out, perms);
+extern "C" int ceph_ll_mknod(class ceph_mount_info *cmount, Inode *parent,
+ const char *name, mode_t mode, dev_t rdev,
+ Inode **out, struct ceph_statx *stx,
+ unsigned want, unsigned flags,
+ const UserPerm *perms)
+{
+ return (cmount->get_client())->ll_mknodx(parent, name, mode, rdev,
+ out, stx, want, flags, *perms);
}
extern "C" int ceph_ll_mkdir(class ceph_mount_info *cmount,