*/
int ceph_ll_delegation(struct ceph_mount_info *cmount, Fh *fh,
unsigned int cmd, ceph_deleg_cb_t cb, void *priv);
+
+mode_t ceph_umask(struct ceph_mount_info *cmount, mode_t mode);
+
#ifdef __cplusplus
}
#endif
#include "include/cephfs/libcephfs.h"
+#define DEFAULT_UMASK 002
+
+static mode_t umask_cb(void *);
struct ceph_mount_info
{
+ mode_t umask = DEFAULT_UMASK;
public:
explicit ceph_mount_info(CephContext *cct_)
: default_perms(),
if (ret)
goto fail;
+ {
+ client_callback_args args = {};
+ args.handle = this;
+ args.umask_cb = umask_cb;
+ client->ll_register_callbacks(&args);
+ }
+
default_perms = Client::pick_my_perms(cct);
inited = true;
return 0;
return mounted;
}
+ mode_t set_umask(mode_t umask)
+ {
+ this->umask = umask;
+ return umask;
+ }
+
int conf_read_file(const char *path_list)
{
int ret = cct->_conf.parse_config_files(path_list, nullptr, 0);
std::string cwd;
};
+static mode_t umask_cb(void *handle)
+{
+ return ((struct ceph_mount_info *)handle)->umask;
+}
+
static void do_out_buffer(bufferlist& outbl, char **outbuf, size_t *outbuflen)
{
if (outbuf) {
return cmount->conf_read_file(path);
}
+extern "C" mode_t ceph_umask(struct ceph_mount_info *cmount, mode_t mode)
+{
+ return cmount->set_umask(mode);
+}
+
extern "C" int ceph_conf_parse_argv(struct ceph_mount_info *cmount, int argc,
const char **argv)
{