dir += path.get_path();
}
-int Client::statfs(const char *path, struct statvfs *stbuf)
+int Client::statfs(const char *path, struct statvfs *stbuf,
+ const UserPerm& perms)
{
Mutex::Locker l(client_lock);
tout(cct) << "statfs" << std::endl;
return ret;
}
-int Client::ll_statfs(Inode *in, struct statvfs *stbuf)
+int Client::ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms)
{
/* Since the only thing this does is wrap a call to statfs, and
statfs takes a lock, it doesn't seem we have a need to split it
out. */
- return statfs(0, stbuf);
+ return statfs(0, stbuf, perms);
}
void Client::ll_register_callbacks(struct client_callback_args *args)
bufferlist *poutbl, std::string *prs, Context *onfinish);
// these shoud (more or less) mirror the actual system calls.
- int statfs(const char *path, struct statvfs *stbuf);
+ int statfs(const char *path, struct statvfs *stbuf, const UserPerm& perms);
// crap
int chdir(const char *s, std::string &new_cwd, const UserPerm& perms);
uint64_t snapseq, uint32_t sync);
int ll_commit_blocks(Inode *in, uint64_t offset, uint64_t length);
- int ll_statfs(Inode *in, struct statvfs *stbuf);
+ int ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms);
int ll_walk(const char* name, Inode **i, struct stat *attr); // XXX in?
uint32_t ll_stripe_unit(Inode *in);
int ll_file_layout(Inode *in, file_layout_t *layout);
client->chdir(a, ignore, perms);
} else if (strcmp(op, "statfs") == 0) {
struct statvfs stbuf;
- client->statfs("/", &stbuf);
+ client->statfs("/", &stbuf, perms);
}
// low level ops ---------------------
} else if (strcmp(op, "ll_statfs") == 0) {
int64_t i = t.get_int();
if (ll_inos.count(i))
- {} //client->ll_statfs(vinodeno_t(ll_inos[i],CEPH_NOSNAP));
+ {} //client->ll_statfs(vinodeno_t(ll_inos[i],CEPH_NOSNAP), perms);
}
struct statvfs stbuf;
CephFuse::Handle *cfuse = fuse_ll_req_prepare(req);
Inode *in = cfuse->iget(ino);
+ const struct fuse_ctx *ctx = fuse_req_ctx(req);
+ UserPerm perms(ctx->uid, ctx->gid);
- int r = cfuse->client->ll_statfs(in, &stbuf);
+ int r = cfuse->client->ll_statfs(in, &stbuf, perms);
if (r == 0)
fuse_reply_statfs(req, &stbuf);
else
{
if (!cmount->is_mounted())
return -ENOTCONN;
- return cmount->get_client()->statfs(path, stbuf);
+ UserPerm perms = cmount->get_client()->pick_my_perms();
+ return cmount->get_client()->statfs(path, stbuf, perms);
}
extern "C" int ceph_get_local_osd(struct ceph_mount_info *cmount)
extern "C" int ceph_ll_statfs(class ceph_mount_info *cmount,
Inode *in, struct statvfs *stbuf)
{
- return (cmount->get_client()->ll_statfs(in, stbuf));
+ UserPerm perms = cmount->get_client()->pick_my_perms();
+ return (cmount->get_client()->ll_statfs(in, stbuf, perms));
}
extern "C" int ceph_ll_readlink(class ceph_mount_info *cmount,