Messenger *messenger = NULL;
Client *client;
CephFuse *cfuse;
+ UserPerm perms;
MonClient *mc = new MonClient(g_ceph_context);
int r = mc->build_initial_monmap();
}
client->update_metadata("mount_point", cfuse->get_mount_point());
-
+ perms = client->pick_my_perms();
// start up fuse
// use my argc, argv (make sure you pass a mount point!)
- r = client->mount(g_conf->client_mountpoint.c_str(), g_ceph_context->_conf->fuse_require_active_mds);
+ r = client->mount(g_conf->client_mountpoint.c_str(), perms,
+ g_ceph_context->_conf->fuse_require_active_mds);
if (r < 0) {
if (r == CEPH_FUSE_NO_MDS_UP)
cerr << "ceph-fuse[" << getpid() << "]: probably no MDS server is up?" << std::endl;
// -------------------
// MOUNT
-int Client::mount(const std::string &mount_root, bool require_mds)
+int Client::mount(const std::string &mount_root, const UserPerm& perms,
+ bool require_mds)
{
Mutex::Locker lock(client_lock);
MetaRequest *req = new MetaRequest(CEPH_MDS_OP_GETATTR);
req->set_filepath(fp);
req->head.args.getattr.mask = CEPH_STAT_CAP_INODE_ALL;
- int res = make_request(req, -1, -1);
+ int res = make_request(req, perms);
if (res < 0) {
if (res == -EACCES && root) {
ldout(cct, 1) << __func__ << " EACCES on parent of mount point; quotas may not work" << dendl;
mds_rank_t _get_random_up_mds() const;
public:
- int mount(const std::string &mount_root, bool require_mds=false);
+ int mount(const std::string &mount_root, const UserPerm& perms,
+ bool require_mds=false);
void unmount();
int mds_command(
}
int SyntheticClient::run()
-{
+{
+ UserPerm perms = client->pick_my_perms();
dout(15) << "initing" << dendl;
int err = client->init();
if (err < 0) {
}
dout(15) << "mounting" << dendl;
- err = client->mount("");
+ err = client->mount("", perms);
if (err < 0) {
dout(0) << "failed to mount: " << cpp_strerror(err) << dendl;
client->shutdown();
int seq = 0;
- UserPerm perms = client->pick_my_perms();
-
for (list<int>::iterator it = modes.begin();
it != modes.end();
++it) {
return ret;
}
- int mount(const std::string &mount_root)
+ int mount(const std::string &mount_root, const UserPerm& perms)
{
int ret;
}
}
- ret = client->mount(mount_root);
+ ret = client->mount(mount_root, perms);
if (ret) {
shutdown();
return ret;
std::string mount_root;
if (root)
mount_root = root;
- return cmount->mount(mount_root);
+ UserPerm perms = cmount->get_client()->pick_my_perms();
+ return cmount->mount(mount_root, perms);
}
extern "C" int ceph_is_mounted(struct ceph_mount_info *cmount)