Use per-session context, introduced by last commit to store struct md_ucred.
}
int cmm_root_get(const struct lu_env *env, struct md_device *md,
- struct lu_fid *fid, struct md_ucred *uc)
+ struct lu_fid *fid)
{
struct cmm_device *cmm_dev = md2cmm_dev(md);
/* valid only on master MDS */
if (cmm_dev->cmm_local_num == 0)
return cmm_child_ops(cmm_dev)->mdo_root_get(env,
- cmm_dev->cmm_child, fid, uc);
+ cmm_dev->cmm_child, fid);
else
return -EINVAL;
}
static int cmm_statfs(const struct lu_env *env, struct md_device *md,
- struct kstatfs *sfs, struct md_ucred *uc) {
+ struct kstatfs *sfs)
+{
struct cmm_device *cmm_dev = md2cmm_dev(md);
int rc;
ENTRY;
rc = cmm_child_ops(cmm_dev)->mdo_statfs(env,
- cmm_dev->cmm_child, sfs, uc);
+ cmm_dev->cmm_child, sfs);
RETURN (rc);
}
static int cmm_maxsize_get(const struct lu_env *env, struct md_device *md,
- int *md_size, int *cookie_size, struct md_ucred *uc)
+ int *md_size, int *cookie_size)
{
struct cmm_device *cmm_dev = md2cmm_dev(md);
int rc;
ENTRY;
rc = cmm_child_ops(cmm_dev)->mdo_maxsize_get(env, cmm_dev->cmm_child,
- md_size, cookie_size, uc);
+ md_size, cookie_size);
RETURN(rc);
}
#ifdef HAVE_SPLIT_SUPPORT
/* cmm_split.c */
int cml_try_to_split(const struct lu_env *env,
- struct md_object *mo, struct md_ucred *uc);
+ struct md_object *mo);
#endif
#endif /* __KERNEL__ */
static int cml_object_create(const struct lu_env *env,
struct md_object *mo,
const struct md_create_spec *spec,
- struct md_attr *attr,
- struct md_ucred *uc)
+ struct md_attr *attr)
{
int rc;
ENTRY;
- rc = mo_object_create(env, md_object_next(mo), spec, attr, uc);
+ rc = mo_object_create(env, md_object_next(mo), spec, attr);
RETURN(rc);
}
static int cml_permission(const struct lu_env *env,
- struct md_object *mo, int mask, struct md_ucred *uc)
+ struct md_object *mo, int mask)
{
int rc;
ENTRY;
- rc = mo_permission(env, md_object_next(mo), mask, uc);
+ rc = mo_permission(env, md_object_next(mo), mask);
RETURN(rc);
}
static int cml_attr_get(const struct lu_env *env, struct md_object *mo,
- struct md_attr *attr, struct md_ucred *uc)
+ struct md_attr *attr)
{
int rc;
ENTRY;
- rc = mo_attr_get(env, md_object_next(mo), attr, uc);
+ rc = mo_attr_get(env, md_object_next(mo), attr);
RETURN(rc);
}
static int cml_attr_set(const struct lu_env *env, struct md_object *mo,
- const struct md_attr *attr, struct md_ucred *uc)
+ const struct md_attr *attr)
{
int rc;
ENTRY;
- rc = mo_attr_set(env, md_object_next(mo), attr, uc);
+ rc = mo_attr_set(env, md_object_next(mo), attr);
RETURN(rc);
}
static int cml_xattr_get(const struct lu_env *env, struct md_object *mo,
- struct lu_buf *buf, const char *name,
- struct md_ucred *uc)
+ struct lu_buf *buf, const char *name)
{
int rc;
ENTRY;
- rc = mo_xattr_get(env, md_object_next(mo), buf, name, uc);
+ rc = mo_xattr_get(env, md_object_next(mo), buf, name);
RETURN(rc);
}
static int cml_readlink(const struct lu_env *env, struct md_object *mo,
- struct lu_buf *buf, struct md_ucred *uc)
+ struct lu_buf *buf)
{
int rc;
ENTRY;
- rc = mo_readlink(env, md_object_next(mo), buf, uc);
+ rc = mo_readlink(env, md_object_next(mo), buf);
RETURN(rc);
}
static int cml_xattr_list(const struct lu_env *env, struct md_object *mo,
- struct lu_buf *buf, struct md_ucred *uc)
+ struct lu_buf *buf)
{
int rc;
ENTRY;
- rc = mo_xattr_list(env, md_object_next(mo), buf, uc);
+ rc = mo_xattr_list(env, md_object_next(mo), buf);
RETURN(rc);
}
static int cml_xattr_set(const struct lu_env *env, struct md_object *mo,
const struct lu_buf *buf,
- const char *name, int fl, struct md_ucred *uc)
+ const char *name, int fl)
{
int rc;
ENTRY;
- rc = mo_xattr_set(env, md_object_next(mo), buf, name, fl, uc);
+ rc = mo_xattr_set(env, md_object_next(mo), buf, name, fl);
RETURN(rc);
}
static int cml_xattr_del(const struct lu_env *env, struct md_object *mo,
- const char *name, struct md_ucred *uc)
+ const char *name)
{
int rc;
ENTRY;
- rc = mo_xattr_del(env, md_object_next(mo), name, uc);
+ rc = mo_xattr_del(env, md_object_next(mo), name);
RETURN(rc);
}
-static int cml_ref_add(const struct lu_env *env, struct md_object *mo,
- struct md_ucred *uc)
+static int cml_ref_add(const struct lu_env *env, struct md_object *mo)
{
int rc;
ENTRY;
- rc = mo_ref_add(env, md_object_next(mo), uc);
+ rc = mo_ref_add(env, md_object_next(mo));
RETURN(rc);
}
static int cml_ref_del(const struct lu_env *env, struct md_object *mo,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
- rc = mo_ref_del(env, md_object_next(mo), ma, uc);
+ rc = mo_ref_del(env, md_object_next(mo), ma);
RETURN(rc);
}
static int cml_open(const struct lu_env *env, struct md_object *mo,
- int flags, struct md_ucred *uc)
+ int flags)
{
int rc;
ENTRY;
- rc = mo_open(env, md_object_next(mo), flags, uc);
+ rc = mo_open(env, md_object_next(mo), flags);
RETURN(rc);
}
static int cml_close(const struct lu_env *env, struct md_object *mo,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
- rc = mo_close(env, md_object_next(mo), ma, uc);
+ rc = mo_close(env, md_object_next(mo), ma);
RETURN(rc);
}
static int cml_readpage(const struct lu_env *env, struct md_object *mo,
- const struct lu_rdpg *rdpg, struct md_ucred *uc)
+ const struct lu_rdpg *rdpg)
{
int rc;
ENTRY;
- rc = mo_readpage(env, md_object_next(mo), rdpg, uc);
+ rc = mo_readpage(env, md_object_next(mo), rdpg);
RETURN(rc);
}
/* md_dir operations */
static int cml_lookup(const struct lu_env *env, struct md_object *mo_p,
- const char *name, struct lu_fid *lf, struct md_ucred *uc)
+ const char *name, struct lu_fid *lf)
{
int rc;
ENTRY;
- rc = mdo_lookup(env, md_object_next(mo_p), name, lf, uc);
+ rc = mdo_lookup(env, md_object_next(mo_p), name, lf);
RETURN(rc);
}
static int cml_create(const struct lu_env *env,
struct md_object *mo_p, const char *child_name,
struct md_object *mo_c, const struct md_create_spec *spec,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
#ifdef HAVE_SPLIT_SUPPORT
- rc = cml_try_to_split(env, mo_p, uc);
+ rc = cml_try_to_split(env, mo_p);
if (rc)
RETURN(rc);
#endif
rc = mdo_create(env, md_object_next(mo_p), child_name,
- md_object_next(mo_c), spec, ma, uc);
+ md_object_next(mo_c), spec, ma);
RETURN(rc);
static int cml_create_data(const struct lu_env *env, struct md_object *p,
struct md_object *o,
const struct md_create_spec *spec,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
rc = mdo_create_data(env, md_object_next(p), md_object_next(o),
- spec, ma, uc);
+ spec, ma);
RETURN(rc);
}
static int cml_link(const struct lu_env *env, struct md_object *mo_p,
struct md_object *mo_s, const char *name,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
rc = mdo_link(env, md_object_next(mo_p), md_object_next(mo_s),
- name, ma, uc);
+ name, ma);
RETURN(rc);
}
static int cml_unlink(const struct lu_env *env, struct md_object *mo_p,
struct md_object *mo_c, const char *name,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
rc = mdo_unlink(env, md_object_next(mo_p), md_object_next(mo_c),
- name, ma, uc);
+ name, ma);
RETURN(rc);
}
}
static int __cmm_mode_get(const struct lu_env *env, struct md_device *md,
- const struct lu_fid *lf, struct md_attr *ma,
- struct md_ucred *uc)
+ const struct lu_fid *lf, struct md_attr *ma)
{
struct cmm_thread_info *cmi;
struct md_object *mo_s = md_object_find(env, md, lf);
tmp_ma->ma_need = MA_INODE;
/* get type from src, can be remote req */
- rc = mo_attr_get(env, md_object_next(mo_s), tmp_ma, uc);
+ rc = mo_attr_get(env, md_object_next(mo_s), tmp_ma);
if (rc == 0) {
ma->ma_attr.la_mode = tmp_ma->ma_attr.la_mode;
ma->ma_attr.la_flags = tmp_ma->ma_attr.la_flags;
static int cml_rename(const struct lu_env *env, struct md_object *mo_po,
struct md_object *mo_pn, const struct lu_fid *lf,
const char *s_name, struct md_object *mo_t,
- const char *t_name, struct md_attr *ma,
- struct md_ucred *uc)
+ const char *t_name, struct md_attr *ma)
{
int rc;
ENTRY;
- rc = __cmm_mode_get(env, md_obj2dev(mo_po), lf, ma, uc);
+ rc = __cmm_mode_get(env, md_obj2dev(mo_po), lf, ma);
if (rc != 0)
RETURN(rc);
if (mo_t && lu_object_exists(&mo_t->mo_lu) < 0) {
/* mo_t is remote object and there is RPC to unlink it */
- rc = mo_ref_del(env, md_object_next(mo_t), ma, uc);
+ rc = mo_ref_del(env, md_object_next(mo_t), ma);
if (rc)
RETURN(rc);
mo_t = NULL;
/* local rename, mo_t can be NULL */
rc = mdo_rename(env, md_object_next(mo_po),
md_object_next(mo_pn), lf, s_name,
- md_object_next(mo_t), t_name, ma, uc);
+ md_object_next(mo_t), t_name, ma);
RETURN(rc);
}
static int cml_rename_tgt(const struct lu_env *env, struct md_object *mo_p,
struct md_object *mo_t, const struct lu_fid *lf,
- const char *name, struct md_attr *ma,
- struct md_ucred *uc)
+ const char *name, struct md_attr *ma)
{
int rc;
ENTRY;
rc = mdo_rename_tgt(env, md_object_next(mo_p),
- md_object_next(mo_t), lf, name, ma, uc);
+ md_object_next(mo_t), lf, name, ma);
RETURN(rc);
}
/* used only in case of rename_tgt() when target is not exist */
static int cml_name_insert(const struct lu_env *env, struct md_object *p,
- const char *name, const struct lu_fid *lf, int isdir,
- struct md_ucred *uc)
+ const char *name, const struct lu_fid *lf, int isdir)
{
int rc;
ENTRY;
- rc = mdo_name_insert(env, md_object_next(p), name, lf, isdir, uc);
+ rc = mdo_name_insert(env, md_object_next(p), name, lf, isdir);
RETURN(rc);
}
/* Common method for remote and local use. */
static int cmm_is_subdir(const struct lu_env *env, struct md_object *mo,
- const struct lu_fid *fid, struct lu_fid *sfid,
- struct md_ucred *uc)
+ const struct lu_fid *fid, struct lu_fid *sfid)
{
struct cmm_thread_info *cmi;
int rc;
ENTRY;
cmi = lu_context_key_get(&env->le_ctx, &cmm_thread_key);
- rc = __cmm_mode_get(env, md_obj2dev(mo), fid, &cmi->cmi_ma, uc);
+ rc = __cmm_mode_get(env, md_obj2dev(mo), fid, &cmi->cmi_ma);
if (rc)
RETURN(rc);
if (!S_ISDIR(cmi->cmi_ma.ma_attr.la_mode))
RETURN(0);
- rc = mdo_is_subdir(env, md_object_next(mo), fid, sfid, uc);
+ rc = mdo_is_subdir(env, md_object_next(mo), fid, sfid);
RETURN(rc);
}
static int cmr_object_create(const struct lu_env *env,
struct md_object *mo,
const struct md_create_spec *spec,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
RETURN(-EFAULT);
}
static int cmr_permission(const struct lu_env *env, struct md_object *mo,
- int mask, struct md_ucred *uc)
+ int mask)
{
RETURN(-EREMOTE);
}
static int cmr_attr_get(const struct lu_env *env, struct md_object *mo,
- struct md_attr *attr, struct md_ucred *uc)
+ struct md_attr *attr)
{
RETURN(-EREMOTE);
}
static int cmr_attr_set(const struct lu_env *env, struct md_object *mo,
- const struct md_attr *attr, struct md_ucred *uc)
+ const struct md_attr *attr)
{
RETURN(-EFAULT);
}
static int cmr_xattr_get(const struct lu_env *env, struct md_object *mo,
- struct lu_buf *buf, const char *name,
- struct md_ucred *uc)
+ struct lu_buf *buf, const char *name)
{
RETURN(-EFAULT);
}
static int cmr_readlink(const struct lu_env *env, struct md_object *mo,
- struct lu_buf *buf, struct md_ucred *uc)
+ struct lu_buf *buf)
{
RETURN(-EFAULT);
}
static int cmr_xattr_list(const struct lu_env *env, struct md_object *mo,
- struct lu_buf *buf, struct md_ucred *uc)
+ struct lu_buf *buf)
{
RETURN(-EFAULT);
}
static int cmr_xattr_set(const struct lu_env *env, struct md_object *mo,
- const struct lu_buf *buf, const char *name, int fl,
- struct md_ucred *uc)
+ const struct lu_buf *buf, const char *name, int fl)
{
RETURN(-EFAULT);
}
static int cmr_xattr_del(const struct lu_env *env, struct md_object *mo,
- const char *name, struct md_ucred *uc)
+ const char *name)
{
RETURN(-EFAULT);
}
-static int cmr_ref_add(const struct lu_env *env, struct md_object *mo,
- struct md_ucred *uc)
+static int cmr_ref_add(const struct lu_env *env, struct md_object *mo)
{
RETURN(-EFAULT);
}
static int cmr_ref_del(const struct lu_env *env, struct md_object *mo,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
RETURN(-EFAULT);
}
static int cmr_open(const struct lu_env *env, struct md_object *mo,
- int flags, struct md_ucred *uc)
+ int flags)
{
RETURN(-EREMOTE);
}
static int cmr_close(const struct lu_env *env, struct md_object *mo,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
RETURN(-EFAULT);
}
static int cmr_readpage(const struct lu_env *env, struct md_object *mo,
- const struct lu_rdpg *rdpg, struct md_ucred *uc)
+ const struct lu_rdpg *rdpg)
{
RETURN(-EREMOTE);
}
/* remote part of md_dir operations */
static int cmr_lookup(const struct lu_env *env, struct md_object *mo_p,
- const char *name, struct lu_fid *lf, struct md_ucred *uc)
+ const char *name, struct lu_fid *lf)
{
/*
* This can happens while rename() If new parent is remote dir, lookup
static int cmr_create(const struct lu_env *env, struct md_object *mo_p,
const char *child_name, struct md_object *mo_c,
const struct md_create_spec *spec,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct cmm_thread_info *cmi;
struct md_attr *tmp_ma;
LASSERT(cmi);
tmp_ma = &cmi->cmi_ma;
tmp_ma->ma_need = MA_INODE;
- rc = mo_attr_get(env, md_object_next(mo_p), tmp_ma, uc);
+ rc = mo_attr_get(env, md_object_next(mo_p), tmp_ma);
if (rc)
RETURN(rc);
}
}
/* remote object creation and local name insert */
- rc = mo_object_create(env, md_object_next(mo_c), spec, ma, uc);
+ rc = mo_object_create(env, md_object_next(mo_c), spec, ma);
if (rc == 0) {
rc = mdo_name_insert(env, md_object_next(mo_p),
child_name, lu_object_fid(&mo_c->mo_lu),
- S_ISDIR(ma->ma_attr.la_mode), uc);
+ S_ISDIR(ma->ma_attr.la_mode));
}
RETURN(rc);
static int cmr_link(const struct lu_env *env, struct md_object *mo_p,
struct md_object *mo_s, const char *name,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
//XXX: make sure that MDT checks name isn't exist
- rc = mo_ref_add(env, md_object_next(mo_s), uc);
+ rc = mo_ref_add(env, md_object_next(mo_s));
if (rc == 0) {
rc = mdo_name_insert(env, md_object_next(mo_p),
- name, lu_object_fid(&mo_s->mo_lu), 0, uc);
+ name, lu_object_fid(&mo_s->mo_lu), 0);
}
RETURN(rc);
static int cmr_unlink(const struct lu_env *env, struct md_object *mo_p,
struct md_object *mo_c, const char *name,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
- rc = mo_ref_del(env, md_object_next(mo_c), ma, uc);
+ rc = mo_ref_del(env, md_object_next(mo_c), ma);
if (rc == 0) {
- rc = mdo_name_remove(env, md_object_next(mo_p), name, uc);
+ rc = mdo_name_remove(env, md_object_next(mo_p), name);
}
RETURN(rc);
struct md_object *mo_po, struct md_object *mo_pn,
const struct lu_fid *lf, const char *s_name,
struct md_object *mo_t, const char *t_name,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
/* get real type of src */
- rc = __cmm_mode_get(env, md_obj2dev(mo_po), lf, ma, uc);
+ rc = __cmm_mode_get(env, md_obj2dev(mo_po), lf, ma);
if (rc != 0)
RETURN(rc);
* mo_t or not. Therefore mo_t is NULL here but remote server should do
* lookup and process this further */
rc = mdo_rename_tgt(env, md_object_next(mo_pn),
- NULL/* mo_t */, lf, t_name, ma, uc);
+ NULL/* mo_t */, lf, t_name, ma);
/* only old name is removed localy */
if (rc == 0)
rc = mdo_name_remove(env, md_object_next(mo_po),
- s_name, uc);
+ s_name);
RETURN(rc);
}
static int cmr_rename_tgt(const struct lu_env *env,
struct md_object *mo_p, struct md_object *mo_t,
const struct lu_fid *lf, const char *name,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
/* target object is remote one */
- rc = mo_ref_del(env, md_object_next(mo_t), ma, uc);
+ rc = mo_ref_del(env, md_object_next(mo_t), ma);
/* continue locally with name handling only */
if (rc == 0)
rc = mdo_rename_tgt(env, md_object_next(mo_p),
- NULL, lf, name, ma, uc);
+ NULL, lf, name, ma);
RETURN(rc);
}
static int cmm_expect_splitting(const struct lu_env *env,
struct md_object *mo,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
struct cmm_device *cmm = cmm_obj2dev(md2cmm_obj(mo));
struct lu_fid *fid = NULL;
if (ma->ma_lmv_size)
GOTO(cleanup, rc = CMM_NO_SPLIT_EXPECTED);
OBD_ALLOC_PTR(fid);
- rc = cmm_child_ops(cmm)->mdo_root_get(env, cmm->cmm_child, fid, uc);
+ rc = cmm_child_ops(cmm)->mdo_root_get(env, cmm->cmm_child, fid);
if (rc)
GOTO(cleanup, rc);
struct cmm_device *cmm,
struct lu_fid *fid, struct md_attr *ma,
const struct lmv_stripe_md *lmv,
- int lmv_size, struct md_ucred *uc)
+ int lmv_size)
{
struct cmm_object *obj;
struct md_create_spec *spec;
spec->u.sp_ea.eadatalen = lmv_size;
spec->sp_cr_flags |= MDS_CREATE_SLAVE_OBJ;
rc = mo_object_create(env, md_object_next(&obj->cmo_obj),
- spec, ma, uc);
+ spec, ma);
OBD_FREE_PTR(spec);
cmm_object_put(env, obj);
}
static int cmm_create_slave_objects(const struct lu_env *env,
- struct md_object *mo, struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_object *mo, struct md_attr *ma)
{
struct cmm_device *cmm = cmm_obj2dev(md2cmm_obj(mo));
struct lmv_stripe_md *lmv = NULL, *slave_lmv = NULL;
slave_lmv->mea_count = 0;
for (i = 1; i < cmm->cmm_tgt_count + 1; i ++) {
rc = cmm_creat_remote_obj(env, cmm, &lmv->mea_ids[i], ma,
- slave_lmv, sizeof(slave_lmv), uc);
+ slave_lmv, sizeof(slave_lmv));
if (rc)
GOTO(cleanup, rc);
}
static int cmm_send_split_pages(const struct lu_env *env,
struct md_object *mo, struct lu_rdpg *rdpg,
- struct lu_fid *fid, int len,
- struct md_ucred *uc)
+ struct lu_fid *fid, int len)
{
struct cmm_device *cmm = cmm_obj2dev(md2cmm_obj(mo));
struct cmm_object *obj;
RETURN(PTR_ERR(obj));
rc = mdc_send_page(cmm, env, md_object_next(&obj->cmo_obj),
- rdpg->rp_pages[0], len, uc);
+ rdpg->rp_pages[0], len);
cmm_object_put(env, obj);
RETURN(rc);
}
static int cmm_remove_entries(const struct lu_env *env,
struct md_object *mo, struct lu_rdpg *rdpg,
- __u32 hash_end, __u32 *len, struct md_ucred *uc)
+ __u32 hash_end, __u32 *len)
{
struct lu_dirpage *dp;
struct lu_dirent *ent;
OBD_ALLOC(name, ent->lde_namelen + 1);
memcpy(name, ent->lde_name, ent->lde_namelen);
rc = mdo_name_remove(env, md_object_next(mo),
- name, uc);
+ name);
OBD_FREE(name, ent->lde_namelen + 1);
}
if (rc) {
static int cmm_split_entries(const struct lu_env *env,
struct md_object *mo, struct lu_rdpg *rdpg,
- struct lu_fid *lf, __u32 end, struct md_ucred *uc)
+ struct lu_fid *lf, __u32 end)
{
int rc, done = 0;
ENTRY;
memset(kmap(rdpg->rp_pages[0]), 0, CFS_PAGE_SIZE);
kunmap(rdpg->rp_pages[0]);
- rc = mo_readpage(env, md_object_next(mo), rdpg, uc);
+ rc = mo_readpage(env, md_object_next(mo), rdpg);
/* -E2BIG means it already reach the end of the dir */
if (rc) {
if (rc != -ERANGE) {
}
/* Remove the old entries */
- rc = cmm_remove_entries(env, mo, rdpg, end, &len, uc);
+ rc = cmm_remove_entries(env, mo, rdpg, end, &len);
if (rc)
RETURN(rc);
/* Send page to slave object */
if (len > 0) {
- rc = cmm_send_split_pages(env, mo, rdpg, lf, len, uc);
+ rc = cmm_send_split_pages(env, mo, rdpg, lf, len);
if (rc)
RETURN(rc);
}
}
#define SPLIT_PAGE_COUNT 1
static int cmm_scan_and_split(const struct lu_env *env,
- struct md_object *mo, struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_object *mo, struct md_attr *ma)
{
struct cmm_device *cmm = cmm_obj2dev(md2cmm_obj(mo));
__u32 hash_segement;
rdpg->rp_hash = i * hash_segement;
hash_end = rdpg->rp_hash + hash_segement;
- rc = cmm_split_entries(env, mo, rdpg, lf, hash_end, uc);
+ rc = cmm_split_entries(env, mo, rdpg, lf, hash_end);
if (rc)
GOTO(cleanup, rc);
}
RETURN(rc);
}
-int cml_try_to_split(const struct lu_env *env, struct md_object *mo,
- struct md_ucred *uc)
+int cml_try_to_split(const struct lu_env *env, struct md_object *mo)
{
struct cmm_device *cmm = cmm_obj2dev(md2cmm_obj(mo));
struct md_attr *ma;
RETURN(-ENOMEM);
ma->ma_need = MA_INODE|MA_LMV;
- rc = mo_attr_get(env, mo, ma, uc);
+ rc = mo_attr_get(env, mo, ma);
if (rc)
GOTO(cleanup, ma);
/* step1: checking whether the dir need to be splitted */
- rc = cmm_expect_splitting(env, mo, ma, uc);
+ rc = cmm_expect_splitting(env, mo, ma);
if (rc != CMM_EXPECT_SPLIT)
GOTO(cleanup, rc = 0);
GOTO(cleanup, rc = 0);
/* step2: create slave objects */
- rc = cmm_create_slave_objects(env, mo, ma, uc);
+ rc = cmm_create_slave_objects(env, mo, ma);
if (rc)
GOTO(cleanup, ma);
/* step3: scan and split the object */
- rc = cmm_scan_and_split(env, mo, ma, uc);
+ rc = cmm_scan_and_split(env, mo, ma);
if (rc)
GOTO(cleanup, ma);
/* step4: set mea to the master object */
rc = mo_xattr_set(env, md_object_next(mo), ma->ma_lmv,
- ma->ma_lmv_size, MDS_LMV_MD_NAME, 0, uc);
+ ma->ma_lmv_size, MDS_LMV_MD_NAME, 0);
if (rc == -ERESTART)
CWARN("Dir"DFID" has been split \n",
struct lu_device *);
#ifdef HAVE_SPLIT_SUPPORT
int mdc_send_page(struct cmm_device *cmm, const struct lu_env *env,
- struct md_object *mo, struct page *page, __u32 end,
- struct md_ucred *uc);
+ struct md_object *mo, struct page *page, __u32 end);
#endif
#endif /* __KERNEL__ */
}
static int mdc_attr_get(const struct lu_env *env, struct md_object *mo,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdc_device *mc = md2mdc_dev(md_obj2dev(mo));
struct mdc_thread_info *mci;
static int mdc_object_create(const struct lu_env *env,
struct md_object *mo,
const struct md_create_spec *spec,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdc_device *mc = md2mdc_dev(md_obj2dev(mo));
struct lu_attr *la = &ma->ma_attr;
struct mdc_thread_info *mci;
const void *symname;
+ struct md_ucred *uc = md_ucred(env);
int rc, symlen;
uid_t uid;
gid_t gid;
RETURN(rc);
}
-static int mdc_ref_add(const struct lu_env *env, struct md_object *mo,
- struct md_ucred *uc)
+static int mdc_ref_add(const struct lu_env *env, struct md_object *mo)
{
struct mdc_device *mc = md2mdc_dev(md_obj2dev(mo));
struct mdc_thread_info *mci;
+ struct md_ucred *uc = md_ucred(env);
int rc;
ENTRY;
}
static int mdc_ref_del(const struct lu_env *env, struct md_object *mo,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdc_device *mc = md2mdc_dev(md_obj2dev(mo));
struct lu_attr *la = &ma->ma_attr;
struct mdc_thread_info *mci;
+ struct md_ucred *uc = md_ucred(env);
int rc;
ENTRY;
#ifdef HAVE_SPLIT_SUPPORT
int mdc_send_page(struct cmm_device *cm, const struct lu_env *env,
- struct md_object *mo, struct page *page, __u32 offset,
- struct md_ucred *uc)
+ struct md_object *mo, struct page *page, __u32 offset)
{
struct mdc_device *mc = md2mdc_dev(md_obj2dev(mo));
int rc;
/* md_dir_operations */
static int mdc_rename_tgt(const struct lu_env *env, struct md_object *mo_p,
struct md_object *mo_t, const struct lu_fid *lf,
- const char *name, struct md_attr *ma,
- struct md_ucred *uc)
+ const char *name, struct md_attr *ma)
{
struct mdc_device *mc = md2mdc_dev(md_obj2dev(mo_p));
struct lu_attr *la = &ma->ma_attr;
struct mdc_thread_info *mci;
+ struct md_ucred *uc = md_ucred(env);
int rc;
ENTRY;
}
static int mdc_is_subdir(const struct lu_env *env, struct md_object *mo,
- const struct lu_fid *fid, struct lu_fid *sfid,
- struct md_ucred *uc)
+ const struct lu_fid *fid, struct lu_fid *sfid)
{
struct mdc_device *mc = md2mdc_dev(md_obj2dev(mo));
struct mdc_thread_info *mci;
int bulk_csum_svc(struct ptlrpc_bulk_desc *desc, int read,
struct lustre_msg *vmsg, int voff,
struct lustre_msg *rmsg, int roff);
+
+
#endif /* _LUSTRE_SEC_H_ */
struct mdt_identity *mu_identity;
};
+/*
+ * Implemented in mdd/mdd_handler.c.
+ *
+ * XXX should be moved into separate .h/.c together with all md security
+ * related definitions.
+ */
+struct md_ucred *md_ucred(const struct lu_env *env);
+
/* metadata attributes */
enum ma_valid {
MA_INODE = (1 << 0),
*/
struct md_object_operations {
int (*moo_permission)(const struct lu_env *env,
- struct md_object *obj,
- int mask,
- struct md_ucred *uc);
+ struct md_object *obj, int mask);
- int (*moo_attr_get)(const struct lu_env *env,
- struct md_object *obj,
- struct md_attr *attr,
- struct md_ucred *uc);
+ int (*moo_attr_get)(const struct lu_env *env, struct md_object *obj,
+ struct md_attr *attr);
- int (*moo_attr_set)(const struct lu_env *env,
- struct md_object *obj,
- const struct md_attr *attr,
- struct md_ucred *uc);
+ int (*moo_attr_set)(const struct lu_env *env, struct md_object *obj,
+ const struct md_attr *attr);
int (*moo_xattr_get)(const struct lu_env *env, struct md_object *obj,
- struct lu_buf *buf, const char *name,
- struct md_ucred *uc);
+ struct lu_buf *buf, const char *name);
int (*moo_xattr_list)(const struct lu_env *env, struct md_object *obj,
- struct lu_buf *buf, struct md_ucred *uc);
+ struct lu_buf *buf);
int (*moo_xattr_set)(const struct lu_env *env, struct md_object *obj,
const struct lu_buf *buf, const char *name,
- int fl, struct md_ucred *uc);
+ int fl);
- int (*moo_xattr_del)(const struct lu_env *env,
- struct md_object *obj,
- const char *name,
- struct md_ucred *uc);
+ int (*moo_xattr_del)(const struct lu_env *env, struct md_object *obj,
+ const char *name);
- int (*moo_readpage)(const struct lu_env *env,
- struct md_object *obj,
- const struct lu_rdpg *rdpg,
- struct md_ucred *uc);
+ int (*moo_readpage)(const struct lu_env *env, struct md_object *obj,
+ const struct lu_rdpg *rdpg);
int (*moo_readlink)(const struct lu_env *env, struct md_object *obj,
- struct lu_buf *buf, struct md_ucred *uc);
+ struct lu_buf *buf);
/* part of cross-ref operation */
int (*moo_object_create)(const struct lu_env *env,
struct md_object *obj,
const struct md_create_spec *spec,
- struct md_attr *ma,
- struct md_ucred *uc);
+ struct md_attr *ma);
- int (*moo_ref_add)(const struct lu_env *env,
- struct md_object *obj,
- struct md_ucred *uc);
+ int (*moo_ref_add)(const struct lu_env *env, struct md_object *obj);
int (*moo_ref_del)(const struct lu_env *env,
- struct md_object *obj,
- struct md_attr *ma,
- struct md_ucred *uc);
+ struct md_object *obj, struct md_attr *ma);
int (*moo_open)(const struct lu_env *env,
- struct md_object *obj,
- int flag,
- struct md_ucred *uc);
-
- int (*moo_close)(const struct lu_env *env,
- struct md_object *obj,
- struct md_attr *ma,
- struct md_ucred *uc);
+ struct md_object *obj, int flag);
+
+ int (*moo_close)(const struct lu_env *env, struct md_object *obj,
+ struct md_attr *ma);
int (*moo_capa_get)(const struct lu_env *, struct md_object *,
struct lustre_capa *);
};
* Operations implemented for each directory object.
*/
struct md_dir_operations {
- int (*mdo_is_subdir) (const struct lu_env *env,
- struct md_object *obj,
- const struct lu_fid *fid,
- struct lu_fid *sfid,
- struct md_ucred *uc);
-
- int (*mdo_lookup)(const struct lu_env *env,
- struct md_object *obj,
- const char *name,
- struct lu_fid *fid,
- struct md_ucred *uc);
-
- int (*mdo_create)(const struct lu_env *env,
- struct md_object *pobj,
- const char *name,
- struct md_object *child,
+ int (*mdo_is_subdir) (const struct lu_env *env, struct md_object *obj,
+ const struct lu_fid *fid, struct lu_fid *sfid);
+
+ int (*mdo_lookup)(const struct lu_env *env, struct md_object *obj,
+ const char *name, struct lu_fid *fid);
+
+ int (*mdo_create)(const struct lu_env *env, struct md_object *pobj,
+ const char *name, struct md_object *child,
const struct md_create_spec *spec,
- struct md_attr *ma,
- struct md_ucred *uc);
+ struct md_attr *ma);
/* This method is used for creating data object for this meta object*/
- int (*mdo_create_data)(const struct lu_env *env,
- struct md_object *p,
+ int (*mdo_create_data)(const struct lu_env *env, struct md_object *p,
struct md_object *o,
const struct md_create_spec *spec,
- struct md_attr *ma,
- struct md_ucred *uc);
-
- int (*mdo_rename)(const struct lu_env *env,
- struct md_object *spobj,
- struct md_object *tpobj,
- const struct lu_fid *lf,
- const char *sname,
- struct md_object *tobj,
- const char *tname,
- struct md_attr *ma,
- struct md_ucred *uc);
-
- int (*mdo_link)(const struct lu_env *env,
- struct md_object *tgt_obj,
- struct md_object *src_obj,
- const char *name,
- struct md_attr *ma,
- struct md_ucred *uc);
-
- int (*mdo_unlink)(const struct lu_env *env,
- struct md_object *pobj,
- struct md_object *cobj,
- const char *name,
- struct md_attr *ma,
- struct md_ucred *uc);
+ struct md_attr *ma);
+
+ int (*mdo_rename)(const struct lu_env *env, struct md_object *spobj,
+ struct md_object *tpobj, const struct lu_fid *lf,
+ const char *sname, struct md_object *tobj,
+ const char *tname, struct md_attr *ma);
+
+ int (*mdo_link)(const struct lu_env *env, struct md_object *tgt_obj,
+ struct md_object *src_obj, const char *name,
+ struct md_attr *ma);
+
+ int (*mdo_unlink)(const struct lu_env *env, struct md_object *pobj,
+ struct md_object *cobj, const char *name,
+ struct md_attr *ma);
/* partial ops for cross-ref case */
- int (*mdo_name_insert)(const struct lu_env *env,
- struct md_object *obj,
- const char *name,
- const struct lu_fid *fid,
- int isdir,
- struct md_ucred *uc);
+ int (*mdo_name_insert)(const struct lu_env *env, struct md_object *obj,
+ const char *name, const struct lu_fid *fid,
+ int isdir);
int (*mdo_name_remove)(const struct lu_env *env,
- struct md_object *obj, const char *name,
- struct md_ucred *uc);
-
- int (*mdo_rename_tgt)(const struct lu_env *env,
- struct md_object *pobj,
- struct md_object *tobj,
- const struct lu_fid *fid,
- const char *name,
- struct md_attr *ma,
- struct md_ucred *uc);
+ struct md_object *obj, const char *name);
+
+ int (*mdo_rename_tgt)(const struct lu_env *env, struct md_object *pobj,
+ struct md_object *tobj, const struct lu_fid *fid,
+ const char *name, struct md_attr *ma);
};
struct md_device_operations {
/* meta-data device related handlers. */
- int (*mdo_root_get)(const struct lu_env *env,
- struct md_device *m,
- struct lu_fid *f,
- struct md_ucred *uc);
-
- int (*mdo_maxsize_get)(const struct lu_env *env,
- struct md_device *m,
- int *md_size,
- int *cookie_size,
- struct md_ucred *uc);
-
- int (*mdo_statfs)(const struct lu_env *env,
- struct md_device *m,
- struct kstatfs *sfs,
- struct md_ucred *uc);
+ int (*mdo_root_get)(const struct lu_env *env, struct md_device *m,
+ struct lu_fid *f);
+
+ int (*mdo_maxsize_get)(const struct lu_env *env, struct md_device *m,
+ int *md_size, int *cookie_size);
+
+ int (*mdo_statfs)(const struct lu_env *env, struct md_device *m,
+ struct kstatfs *sfs);
int (*mdo_init_capa_keys)(struct md_device *m,
struct lustre_capa_key *keys);
/* md operations */
static inline int mo_permission(const struct lu_env *env,
struct md_object *m,
- int mask,
- struct md_ucred *uc)
+ int mask)
{
LASSERT(m->mo_ops->moo_permission);
- return m->mo_ops->moo_permission(env, m, mask, uc);
+ return m->mo_ops->moo_permission(env, m, mask);
}
static inline int mo_attr_get(const struct lu_env *env,
struct md_object *m,
- struct md_attr *at,
- struct md_ucred *uc)
+ struct md_attr *at)
{
LASSERT(m->mo_ops->moo_attr_get);
- return m->mo_ops->moo_attr_get(env, m, at, uc);
+ return m->mo_ops->moo_attr_get(env, m, at);
}
static inline int mo_readlink(const struct lu_env *env,
struct md_object *m,
- struct lu_buf *buf,
- struct md_ucred *uc)
+ struct lu_buf *buf)
{
LASSERT(m->mo_ops->moo_readlink);
- return m->mo_ops->moo_readlink(env, m, buf, uc);
+ return m->mo_ops->moo_readlink(env, m, buf);
}
static inline int mo_attr_set(const struct lu_env *env,
struct md_object *m,
- const struct md_attr *at,
- struct md_ucred *uc)
+ const struct md_attr *at)
{
LASSERT(m->mo_ops->moo_attr_set);
- return m->mo_ops->moo_attr_set(env, m, at, uc);
+ return m->mo_ops->moo_attr_set(env, m, at);
}
static inline int mo_xattr_get(const struct lu_env *env,
struct md_object *m,
struct lu_buf *buf,
- const char *name,
- struct md_ucred *uc)
+ const char *name)
{
LASSERT(m->mo_ops->moo_xattr_get);
- return m->mo_ops->moo_xattr_get(env, m, buf, name, uc);
+ return m->mo_ops->moo_xattr_get(env, m, buf, name);
}
static inline int mo_xattr_del(const struct lu_env *env,
struct md_object *m,
- const char *name,
- struct md_ucred *uc)
+ const char *name)
{
LASSERT(m->mo_ops->moo_xattr_del);
- return m->mo_ops->moo_xattr_del(env, m, name, uc);
+ return m->mo_ops->moo_xattr_del(env, m, name);
}
static inline int mo_xattr_set(const struct lu_env *env,
struct md_object *m,
const struct lu_buf *buf,
const char *name,
- int flags,
- struct md_ucred *uc)
+ int flags)
{
LASSERT(m->mo_ops->moo_xattr_set);
- return m->mo_ops->moo_xattr_set(env, m, buf, name, flags, uc);
+ return m->mo_ops->moo_xattr_set(env, m, buf, name, flags);
}
static inline int mo_xattr_list(const struct lu_env *env,
struct md_object *m,
- struct lu_buf *buf,
- struct md_ucred *uc)
+ struct lu_buf *buf)
{
LASSERT(m->mo_ops->moo_xattr_list);
- return m->mo_ops->moo_xattr_list(env, m, buf, uc);
+ return m->mo_ops->moo_xattr_list(env, m, buf);
}
static inline int mo_open(const struct lu_env *env,
struct md_object *m,
- int flags,
- struct md_ucred *uc)
+ int flags)
{
LASSERT(m->mo_ops->moo_open);
- return m->mo_ops->moo_open(env, m, flags, uc);
+ return m->mo_ops->moo_open(env, m, flags);
}
static inline int mo_close(const struct lu_env *env,
struct md_object *m,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
LASSERT(m->mo_ops->moo_close);
- return m->mo_ops->moo_close(env, m, ma, uc);
+ return m->mo_ops->moo_close(env, m, ma);
}
static inline int mo_readpage(const struct lu_env *env,
struct md_object *m,
- const struct lu_rdpg *rdpg,
- struct md_ucred *uc)
+ const struct lu_rdpg *rdpg)
{
LASSERT(m->mo_ops->moo_readpage);
- return m->mo_ops->moo_readpage(env, m, rdpg, uc);
+ return m->mo_ops->moo_readpage(env, m, rdpg);
}
static inline int mo_object_create(const struct lu_env *env,
struct md_object *m,
const struct md_create_spec *spc,
- struct md_attr *at,
- struct md_ucred *uc)
+ struct md_attr *at)
{
LASSERT(m->mo_ops->moo_object_create);
- return m->mo_ops->moo_object_create(env, m, spc, at, uc);
+ return m->mo_ops->moo_object_create(env, m, spc, at);
}
static inline int mo_ref_add(const struct lu_env *env,
- struct md_object *m,
- struct md_ucred *uc)
+ struct md_object *m)
{
LASSERT(m->mo_ops->moo_ref_add);
- return m->mo_ops->moo_ref_add(env, m, uc);
+ return m->mo_ops->moo_ref_add(env, m);
}
static inline int mo_ref_del(const struct lu_env *env,
struct md_object *m,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
LASSERT(m->mo_ops->moo_ref_del);
- return m->mo_ops->moo_ref_del(env, m, ma, uc);
+ return m->mo_ops->moo_ref_del(env, m, ma);
}
static inline int mo_capa_get(const struct lu_env *env,
static inline int mdo_lookup(const struct lu_env *env,
struct md_object *p,
const char *name,
- struct lu_fid *f,
- struct md_ucred *uc)
+ struct lu_fid *f)
{
LASSERT(p->mo_dir_ops->mdo_lookup);
- return p->mo_dir_ops->mdo_lookup(env, p, name, f, uc);
+ return p->mo_dir_ops->mdo_lookup(env, p, name, f);
}
static inline int mdo_create(const struct lu_env *env,
const char *child_name,
struct md_object *c,
const struct md_create_spec *spc,
- struct md_attr *at,
- struct md_ucred *uc)
+ struct md_attr *at)
{
LASSERT(c->mo_dir_ops->mdo_create);
- return c->mo_dir_ops->mdo_create(env, p, child_name, c, spc, at, uc);
+ return c->mo_dir_ops->mdo_create(env, p, child_name, c, spc, at);
}
static inline int mdo_create_data(const struct lu_env *env,
struct md_object *p,
struct md_object *c,
const struct md_create_spec *spec,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
LASSERT(c->mo_dir_ops->mdo_create_data);
- return c->mo_dir_ops->mdo_create_data(env, p, c, spec, ma, uc);
+ return c->mo_dir_ops->mdo_create_data(env, p, c, spec, ma);
}
static inline int mdo_rename(const struct lu_env *env,
const char *sname,
struct md_object *t,
const char *tname,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
LASSERT(tp->mo_dir_ops->mdo_rename);
- return tp->mo_dir_ops->mdo_rename(env, sp, tp, lf, sname, t, tname,
- ma, uc);
+ return tp->mo_dir_ops->mdo_rename(env, sp, tp, lf, sname, t, tname, ma);
}
static inline int mdo_is_subdir(const struct lu_env *env,
struct md_object *mo,
const struct lu_fid *fid,
- struct lu_fid *sfid,
- struct md_ucred *uc)
+ struct lu_fid *sfid)
{
LASSERT(mo->mo_dir_ops->mdo_is_subdir);
- return mo->mo_dir_ops->mdo_is_subdir(env, mo, fid, sfid, uc);
+ return mo->mo_dir_ops->mdo_is_subdir(env, mo, fid, sfid);
}
static inline int mdo_link(const struct lu_env *env,
struct md_object *p,
struct md_object *s,
const char *name,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
LASSERT(s->mo_dir_ops->mdo_link);
- return s->mo_dir_ops->mdo_link(env, p, s, name, ma, uc);
+ return s->mo_dir_ops->mdo_link(env, p, s, name, ma);
}
static inline int mdo_unlink(const struct lu_env *env,
struct md_object *p,
struct md_object *c,
const char *name,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
LASSERT(c->mo_dir_ops->mdo_unlink);
- return c->mo_dir_ops->mdo_unlink(env, p, c, name, ma, uc);
+ return c->mo_dir_ops->mdo_unlink(env, p, c, name, ma);
}
static inline int mdo_name_insert(const struct lu_env *env,
struct md_object *p,
const char *name,
const struct lu_fid *f,
- int isdir,
- struct md_ucred *uc)
+ int isdir)
{
LASSERT(p->mo_dir_ops->mdo_name_insert);
- return p->mo_dir_ops->mdo_name_insert(env, p, name, f, isdir, uc);
+ return p->mo_dir_ops->mdo_name_insert(env, p, name, f, isdir);
}
static inline int mdo_name_remove(const struct lu_env *env,
struct md_object *p,
- const char *name,
- struct md_ucred *uc)
+ const char *name)
{
LASSERT(p->mo_dir_ops->mdo_name_remove);
- return p->mo_dir_ops->mdo_name_remove(env, p, name, uc);
+ return p->mo_dir_ops->mdo_name_remove(env, p, name);
}
static inline int mdo_rename_tgt(const struct lu_env *env,
struct md_object *t,
const struct lu_fid *lf,
const char *name,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
if (t) {
LASSERT(t->mo_dir_ops->mdo_rename_tgt);
- return t->mo_dir_ops->mdo_rename_tgt(env, p, t, lf, name,
- ma, uc);
+ return t->mo_dir_ops->mdo_rename_tgt(env, p, t, lf, name, ma);
} else {
LASSERT(p->mo_dir_ops->mdo_rename_tgt);
- return p->mo_dir_ops->mdo_rename_tgt(env, p, t, lf, name,
- ma, uc);
+ return p->mo_dir_ops->mdo_rename_tgt(env, p, t, lf, name, ma);
}
}
Index: iam/fs/ext3/super.c
===================================================================
---- iam.orig/fs/ext3/super.c 2006-09-29 01:08:34.000000000 +0400
-+++ iam/fs/ext3/super.c 2006-09-29 01:08:34.000000000 +0400
+--- iam.orig/fs/ext3/super.c 2006-09-29 02:41:03.000000000 +0400
++++ iam/fs/ext3/super.c 2006-09-29 02:41:03.000000000 +0400
@@ -1168,8 +1168,8 @@ static int ext3_check_descriptors (struc
* e2fsck was run on this filesystem, and it must have already done the orphan
* inode cleanup for us, so we can safely abort without any further action.
static int __mdd_lookup(const struct lu_env *env,
struct md_object *pobj,
const char *name, const struct lu_fid* fid,
- int mask, struct md_ucred *uc);
+ int mask);
static int __mdd_lookup_locked(const struct lu_env *env,
struct md_object *pobj,
const char *name, const struct lu_fid* fid,
- int mask, struct md_ucred *uc);
+ int mask);
static int mdd_exec_permission_lite(const struct lu_env *env,
- struct mdd_object *obj,
- struct md_ucred *uc);
+ struct mdd_object *obj);
static int __mdd_permission_internal(const struct lu_env *env,
struct mdd_object *obj,
- int mask, int getattr,
- struct md_ucred *uc);
+ int mask, int getattr);
static struct md_object_operations mdd_obj_ops;
static struct md_dir_operations mdd_dir_ops;
}
static inline int mdd_permission_internal(const struct lu_env *env,
- struct mdd_object *obj, int mask,
- struct md_ucred *uc)
+ struct mdd_object *obj, int mask)
{
- return __mdd_permission_internal(env, obj, mask, 1, uc);
+ return __mdd_permission_internal(env, obj, mask, 1);
}
struct mdd_thread_info *mdd_env_info(const struct lu_env *env)
/*Check whether it may create the cobj under the pobj*/
static int mdd_may_create(const struct lu_env *env,
struct mdd_object *pobj, struct mdd_object *cobj,
- int need_check, struct md_ucred *uc)
+ int need_check)
{
int rc = 0;
ENTRY;
/*check pobj may create or not*/
if (need_check)
rc = mdd_permission_internal(env, pobj,
- MAY_WRITE | MAY_EXEC, uc);
+ MAY_WRITE | MAY_EXEC);
RETURN(rc);
}
*/
static inline int mdd_is_sticky(const struct lu_env *env,
struct mdd_object *pobj,
- struct mdd_object *cobj,
- struct md_ucred *uc)
+ struct mdd_object *cobj)
{
struct lu_attr *tmp_la = &mdd_env_info(env)->mti_la;
+ struct md_ucred *uc = md_ucred(env);
int rc;
rc = __mdd_la_get(env, cobj, tmp_la);
/*Check whether it may delete the cobj under the pobj*/
static int mdd_may_delete(const struct lu_env *env,
struct mdd_object *pobj, struct mdd_object *cobj,
- int is_dir, int need_check, struct md_ucred *uc)
+ int is_dir, int need_check)
{
struct mdd_device *mdd = mdo2mdd(&cobj->mod_obj);
int rc = 0;
if (mdd_is_dead_obj(pobj))
RETURN(-ENOENT);
- if (mdd_is_sticky(env, pobj, cobj, uc))
+ if (mdd_is_sticky(env, pobj, cobj))
RETURN(-EPERM);
if (need_check)
rc = mdd_permission_internal(env, pobj,
- MAY_WRITE | MAY_EXEC, uc);
+ MAY_WRITE | MAY_EXEC);
}
RETURN(rc);
}
* No permission check is needed.
*/
static int mdd_attr_get(const struct lu_env *env, struct md_object *obj,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
int rc;
*/
static int mdd_xattr_get(const struct lu_env *env,
struct md_object *obj, struct lu_buf *buf,
- const char *name, struct md_ucred *uc)
+ const char *name)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct dt_object *next;
* no need check again.
*/
static int mdd_readlink(const struct lu_env *env, struct md_object *obj,
- struct lu_buf *buf, struct md_ucred *uc)
+ struct lu_buf *buf)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct dt_object *next;
}
static int mdd_xattr_list(const struct lu_env *env, struct md_object *obj,
- struct lu_buf *buf, struct md_ucred *uc)
+ struct lu_buf *buf)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct dt_object *next;
* and port to
*/
int mdd_fix_attr(const struct lu_env *env, struct mdd_object *obj,
- struct lu_attr *la, struct md_ucred *uc)
+ struct lu_attr *la)
{
struct lu_attr *tmp_la = &mdd_env_info(env)->mti_la;
+ struct md_ucred *uc = md_ucred(env);
time_t now = CURRENT_SECONDS;
int rc;
ENTRY;
/* For tuncate (or setsize), we should have MAY_WRITE perm */
if (la->la_valid & (LA_SIZE | LA_BLOCKS)) {
- rc = mdd_permission_internal(env, obj, MAY_WRITE, uc);
+ rc = mdd_permission_internal(env, obj, MAY_WRITE);
if (rc)
RETURN(rc);
/* set attr and LOV EA at once, return updated attr */
static int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
- const struct md_attr *ma, struct md_ucred *uc)
+ const struct md_attr *ma)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct mdd_device *mdd = mdo2mdd(obj);
*la_copy = ma->ma_attr;
mdd_write_lock(env, mdd_obj);
- rc = mdd_fix_attr(env, mdd_obj, la_copy, uc);
+ rc = mdd_fix_attr(env, mdd_obj, la_copy);
mdd_write_unlock(env, mdd_obj);
if (rc)
GOTO(cleanup, rc);
}
static int mdd_xattr_sanity_check(const struct lu_env *env,
- struct mdd_object *obj,
- struct md_ucred *uc)
+ struct mdd_object *obj)
{
- struct lu_attr *tmp_la = &mdd_env_info(env)->mti_la;
+ struct lu_attr *tmp_la = &mdd_env_info(env)->mti_la;
+ struct md_ucred *uc = md_ucred(env);
int rc;
ENTRY;
}
static int mdd_xattr_set(const struct lu_env *env, struct md_object *obj,
- const struct lu_buf *buf, const char *name, int fl,
- struct md_ucred *uc)
+ const struct lu_buf *buf, const char *name, int fl)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct mdd_device *mdd = mdo2mdd(obj);
int rc;
ENTRY;
- rc = mdd_xattr_sanity_check(env, mdd_obj, uc);
+ rc = mdd_xattr_sanity_check(env, mdd_obj);
if (rc)
RETURN(rc);
}
int mdd_xattr_del(const struct lu_env *env, struct md_object *obj,
- const char *name, struct md_ucred *uc)
+ const char *name)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct mdd_device *mdd = mdo2mdd(obj);
int rc;
ENTRY;
- rc = mdd_xattr_sanity_check(env, mdd_obj, uc);
+ rc = mdd_xattr_sanity_check(env, mdd_obj);
if (rc)
RETURN(rc);
static int mdd_link_sanity_check(const struct lu_env *env,
struct mdd_object *tgt_obj,
- struct mdd_object *src_obj,
- struct md_ucred *uc)
+ struct mdd_object *src_obj)
{
int rc;
ENTRY;
- rc = mdd_may_create(env, tgt_obj, NULL, 1, uc);
+ rc = mdd_may_create(env, tgt_obj, NULL, 1);
if (rc)
RETURN(rc);
static int mdd_link(const struct lu_env *env, struct md_object *tgt_obj,
struct md_object *src_obj, const char *name,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdd_object *mdd_tobj = md2mdd_obj(tgt_obj);
struct mdd_object *mdd_sobj = md2mdd_obj(src_obj);
mdd_lock2(env, mdd_tobj, mdd_sobj);
- rc = mdd_link_sanity_check(env, mdd_tobj, mdd_sobj, uc);
+ rc = mdd_link_sanity_check(env, mdd_tobj, mdd_sobj);
if (rc)
GOTO(out, rc);
static int mdd_unlink_sanity_check(const struct lu_env *env,
struct mdd_object *pobj,
struct mdd_object *cobj,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
struct dt_object *dt_cobj = mdd_object_child(cobj);
int rc = 0;
ENTRY;
rc = mdd_may_delete(env, pobj, cobj,
- S_ISDIR(ma->ma_attr.la_mode), 1, uc);
+ S_ISDIR(ma->ma_attr.la_mode), 1);
if (rc)
RETURN(rc);
static int mdd_unlink(const struct lu_env *env,
struct md_object *pobj, struct md_object *cobj,
- const char *name, struct md_attr *ma, struct md_ucred *uc)
+ const char *name, struct md_attr *ma)
{
struct mdd_device *mdd = mdo2mdd(pobj);
struct mdd_object *mdd_pobj = md2mdd_obj(pobj);
mdd_lock2(env, mdd_pobj, mdd_cobj);
- rc = mdd_unlink_sanity_check(env, mdd_pobj, mdd_cobj, ma, uc);
+ rc = mdd_unlink_sanity_check(env, mdd_pobj, mdd_cobj, ma);
if (rc)
GOTO(cleanup, rc);
/* partial unlink */
static int mdd_ref_del(const struct lu_env *env, struct md_object *obj,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct mdd_device *mdd = mdo2mdd(obj);
mdd_write_lock(env, mdd_obj);
- rc = mdd_unlink_sanity_check(env, NULL, mdd_obj, ma, uc);
+ rc = mdd_unlink_sanity_check(env, NULL, mdd_obj, ma);
if (rc)
GOTO(cleanup, rc);
struct lu_fid *fid)
{
return __mdd_lookup_locked(env, &obj->mod_obj,
- dotdot, fid, 0, NULL);
+ dotdot, fid, 0);
}
/*
const struct lu_fid *sfid,
int src_is_dir,
struct mdd_object *sobj,
- struct mdd_object *tobj,
- struct md_ucred *uc)
+ struct mdd_object *tobj)
{
struct mdd_device *mdd = mdo2mdd(&src_pobj->mod_obj);
int rc = 0, need_check = 1;
ENTRY;
mdd_read_lock(env, src_pobj);
- rc = mdd_may_delete(env, src_pobj, sobj, src_is_dir, need_check, uc);
+ rc = mdd_may_delete(env, src_pobj, sobj, src_is_dir, need_check);
mdd_read_unlock(env, src_pobj);
if (rc)
RETURN(rc);
if (!tobj) {
mdd_read_lock(env, tgt_pobj);
- rc = mdd_may_create(env, tgt_pobj, NULL, need_check, uc);
+ rc = mdd_may_create(env, tgt_pobj, NULL, need_check);
mdd_read_unlock(env, tgt_pobj);
} else {
mdd_read_lock(env, tgt_pobj);
rc = mdd_may_delete(env, tgt_pobj, tobj, src_is_dir,
- need_check, uc);
+ need_check);
mdd_read_unlock(env, tgt_pobj);
if (!rc && S_ISDIR(mdd_object_type(tobj)) &&
mdd_dir_is_empty(env, tobj))
struct md_object *src_pobj, struct md_object *tgt_pobj,
const struct lu_fid *lf, const char *sname,
struct md_object *tobj, const char *tname,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdd_device *mdd = mdo2mdd(src_pobj);
struct mdd_object *mdd_spobj = md2mdd_obj(src_pobj);
/*XXX: shouldn't this check be done under lock below? */
rc = mdd_rename_sanity_check(env, mdd_spobj, mdd_tpobj,
- lf, is_dir, mdd_sobj, mdd_tobj, uc);
+ lf, is_dir, mdd_sobj, mdd_tobj);
if (rc)
GOTO(out, rc);
static int
__mdd_lookup(const struct lu_env *env, struct md_object *pobj,
- const char *name, const struct lu_fid* fid, int mask,
- struct md_ucred *uc)
+ const char *name, const struct lu_fid* fid, int mask)
{
struct mdd_object *mdd_obj = md2mdd_obj(pobj);
struct dt_object *dir = mdd_object_child(mdd_obj);
RETURN(-ESTALE);
if (mask == MAY_EXEC)
- rc = mdd_exec_permission_lite(env, mdd_obj, uc);
+ rc = mdd_exec_permission_lite(env, mdd_obj);
else
- rc = mdd_permission_internal(env, mdd_obj, mask, uc);
+ rc = mdd_permission_internal(env, mdd_obj, mask);
if (rc)
RETURN(rc);
static int
__mdd_lookup_locked(const struct lu_env *env, struct md_object *pobj,
- const char *name, const struct lu_fid* fid, int mask,
- struct md_ucred *uc)
+ const char *name, const struct lu_fid* fid, int mask)
{
struct mdd_object *mdd_obj = md2mdd_obj(pobj);
int rc;
mdd_read_lock(env, mdd_obj);
- rc = __mdd_lookup(env, pobj, name, fid, mask, uc);
+ rc = __mdd_lookup(env, pobj, name, fid, mask);
mdd_read_unlock(env, mdd_obj);
return rc;
static int mdd_lookup(const struct lu_env *env,
struct md_object *pobj, const char *name,
- struct lu_fid* fid, struct md_ucred *uc)
+ struct lu_fid* fid)
{
int rc;
ENTRY;
- rc = __mdd_lookup_locked(env, pobj, name, fid, MAY_EXEC, uc);
+ rc = __mdd_lookup_locked(env, pobj, name, fid, MAY_EXEC);
RETURN(rc);
}
*/
static int mdd_is_subdir(const struct lu_env *env,
struct md_object *mo, const struct lu_fid *fid,
- struct lu_fid *sfid, struct md_ucred *uc)
+ struct lu_fid *sfid)
{
struct mdd_device *mdd = mdo2mdd(mo);
int rc;
* XXX: Need MAY_WRITE to be checked?
*/
static int mdd_cd_sanity_check(const struct lu_env *env,
- struct mdd_object *obj, struct md_ucred *uc)
+ struct mdd_object *obj)
{
int rc = 0;
ENTRY;
#if 0
mdd_read_lock(env, obj);
- rc = mdd_permission_internal(env, obj, MAY_WRITE, uc);
+ rc = mdd_permission_internal(env, obj, MAY_WRITE);
mdd_read_unlock(env, obj);
#endif
static int mdd_create_data(const struct lu_env *env,
struct md_object *pobj, struct md_object *cobj,
const struct md_create_spec *spec,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdd_device *mdd = mdo2mdd(cobj);
struct mdd_object *mdd_pobj = md2mdd_obj(pobj);/* XXX maybe NULL */
int rc;
ENTRY;
- rc = mdd_cd_sanity_check(env, son, uc);
+ rc = mdd_cd_sanity_check(env, son);
if (rc)
RETURN(rc);
static int mdd_create_sanity_check(const struct lu_env *env,
struct md_object *pobj,
- const char *name, struct md_attr *ma,
- struct md_ucred *uc)
+ const char *name, struct md_attr *ma)
{
struct mdd_thread_info *info = mdd_env_info(env);
struct lu_attr *la = &info->mti_la;
RETURN(-ENOENT);
rc = __mdd_lookup_locked(env, pobj, name, fid,
- MAY_WRITE | MAY_EXEC, uc);
+ MAY_WRITE | MAY_EXEC);
if (rc != -ENOENT)
RETURN(rc ? : -EEXIST);
struct md_object *pobj, const char *name,
struct md_object *child,
const struct md_create_spec *spec,
- struct md_attr* ma, struct md_ucred *uc)
+ struct md_attr* ma)
{
struct mdd_device *mdd = mdo2mdd(pobj);
struct mdd_object *mdd_pobj = md2mdd_obj(pobj);
ENTRY;
/* sanity checks before big job */
- rc = mdd_create_sanity_check(env, pobj, name, ma, uc);
+ rc = mdd_create_sanity_check(env, pobj, name, ma);
if (rc)
RETURN(rc);
/* partial operation */
static int mdd_oc_sanity_check(const struct lu_env *env,
struct mdd_object *obj,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
ENTRY;
static int mdd_object_create(const struct lu_env *env,
struct md_object *obj,
const struct md_create_spec *spec,
- struct md_attr *ma,
- struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdd_device *mdd = mdo2mdd(obj);
int rc;
ENTRY;
- rc = mdd_oc_sanity_check(env, mdd_obj, ma, uc);
+ rc = mdd_oc_sanity_check(env, mdd_obj, ma);
if (rc)
RETURN(rc);
static int mdd_ni_sanity_check(const struct lu_env *env,
struct md_object *pobj,
const char *name,
- const struct lu_fid *fid,
- struct md_ucred *uc)
+ const struct lu_fid *fid)
{
struct mdd_object *obj = md2mdd_obj(pobj);
int rc;
if (mdd_is_dead_obj(obj))
RETURN(-ENOENT);
- rc = __mdd_lookup(env, pobj, name, fid, MAY_WRITE | MAY_EXEC, uc);
+ rc = __mdd_lookup(env, pobj, name, fid, MAY_WRITE | MAY_EXEC);
if (rc != -ENOENT)
RETURN(rc ? : -EEXIST);
else
static int mdd_name_insert(const struct lu_env *env,
struct md_object *pobj,
const char *name, const struct lu_fid *fid,
- int isdir, struct md_ucred *uc)
+ int isdir)
{
struct mdd_object *mdd_obj = md2mdd_obj(pobj);
struct thandle *handle;
RETURN(PTR_ERR(handle));
mdd_write_lock(env, mdd_obj);
- rc = mdd_ni_sanity_check(env, pobj, name, fid, uc);
+ rc = mdd_ni_sanity_check(env, pobj, name, fid);
if (rc)
GOTO(out_unlock, rc);
*/
static int mdd_nr_sanity_check(const struct lu_env *env,
struct md_object *pobj,
- const char *name,
- struct md_ucred *uc)
+ const char *name)
{
struct mdd_thread_info *info = mdd_env_info(env);
struct lu_fid *fid = &info->mti_fid;
if (mdd_is_dead_obj(obj))
RETURN(-ENOENT);
- rc = __mdd_lookup(env, pobj, name, fid, MAY_WRITE | MAY_EXEC, uc);
+ rc = __mdd_lookup(env, pobj, name, fid, MAY_WRITE | MAY_EXEC);
RETURN(rc);
}
static int mdd_name_remove(const struct lu_env *env,
struct md_object *pobj,
- const char *name,
- struct md_ucred *uc)
+ const char *name)
{
struct mdd_device *mdd = mdo2mdd(pobj);
struct mdd_object *mdd_obj = md2mdd_obj(pobj);
RETURN(PTR_ERR(handle));
mdd_write_lock(env, mdd_obj);
- rc = mdd_nr_sanity_check(env, pobj, name, uc);
+ rc = mdd_nr_sanity_check(env, pobj, name);
if (rc)
GOTO(out_unlock, rc);
struct mdd_object *tgt_pobj,
struct mdd_object *tobj,
const struct lu_fid *sfid,
- const char *name, struct md_attr *ma,
- struct md_ucred *uc)
+ const char *name, struct md_attr *ma)
{
struct mdd_device *mdd = mdo2mdd(&tgt_pobj->mod_obj);
int rc, src_is_dir;
src_is_dir = S_ISDIR(ma->ma_attr.la_mode);
if (tobj) {
- rc = mdd_may_delete(env, tgt_pobj, tobj, src_is_dir, 1, uc);
+ rc = mdd_may_delete(env, tgt_pobj, tobj, src_is_dir, 1);
if (!rc && S_ISDIR(mdd_object_type(tobj)) &&
mdd_dir_is_empty(env, tobj))
RETURN(-ENOTEMPTY);
} else {
- rc = mdd_may_create(env, tgt_pobj, NULL, 1, uc);
+ rc = mdd_may_create(env, tgt_pobj, NULL, 1);
}
/* source should not be ancestor of target dir */
static int mdd_rename_tgt(const struct lu_env *env,
struct md_object *pobj, struct md_object *tobj,
const struct lu_fid *lf, const char *name,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
struct mdd_device *mdd = mdo2mdd(pobj);
struct mdd_object *mdd_tpobj = md2mdd_obj(pobj);
}
/*TODO rename sanity checking*/
- rc = mdd_rt_sanity_check(env, mdd_tpobj, mdd_tobj, lf, name, ma, uc);
+ rc = mdd_rt_sanity_check(env, mdd_tpobj, mdd_tobj, lf, name, ma);
if (rc)
GOTO(cleanup, rc);
* No permission check is needed.
*/
static int mdd_root_get(const struct lu_env *env,
- struct md_device *m, struct lu_fid *f,
- struct md_ucred *uc)
+ struct md_device *m, struct lu_fid *f)
{
struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
* No permission check is needed.
*/
static int mdd_statfs(const struct lu_env *env, struct md_device *m,
- struct kstatfs *sfs, struct md_ucred *uc)
+ struct kstatfs *sfs)
{
struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
int rc;
* No permission check is needed.
*/
static int mdd_maxsize_get(const struct lu_env *env, struct md_device *m,
- int *md_size, int *cookie_size, struct md_ucred *uc)
+ int *md_size, int *cookie_size)
{
struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
ENTRY;
* XXX: if permission check is needed here?
*/
static int mdd_ref_add(const struct lu_env *env,
- struct md_object *obj, struct md_ucred *uc)
+ struct md_object *obj)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct mdd_device *mdd = mdo2mdd(obj);
}
static int mdd_open_sanity_check(const struct lu_env *env,
- struct mdd_object *obj, int flag,
- struct md_ucred *uc)
+ struct mdd_object *obj, int flag)
{
struct lu_attr *tmp_la = &mdd_env_info(env)->mti_la;
int mode = accmode(obj, flag);
RETURN(-EISDIR);
if (!(flag & MDS_OPEN_CREATED)) {
- rc = __mdd_permission_internal(env, obj, mode, 0, uc);
+ rc = __mdd_permission_internal(env, obj, mode, 0);
if (rc)
RETURN(rc);
}
}
/* O_NOATIME can only be set by the owner or superuser */
- if (flag & O_NOATIME)
- if (uc->mu_fsuid != tmp_la->la_uid && !mdd_capable(uc, CAP_FOWNER))
+ if (flag & O_NOATIME) {
+ struct md_ucred *uc = md_ucred(env);
+
+ if (uc->mu_fsuid != tmp_la->la_uid &&
+ !mdd_capable(uc, CAP_FOWNER))
RETURN(-EPERM);
+ }
RETURN(0);
}
static int mdd_open(const struct lu_env *env, struct md_object *obj,
- int flags, struct md_ucred *uc)
+ int flags)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
int rc = 0;
mdd_write_lock(env, mdd_obj);
- rc = mdd_open_sanity_check(env, mdd_obj, flags, uc);
+ rc = mdd_open_sanity_check(env, mdd_obj, flags);
if (rc == 0)
mdd_obj->mod_count ++;
* No permission check is needed.
*/
static int mdd_close(const struct lu_env *env, struct md_object *obj,
- struct md_attr *ma, struct md_ucred *uc)
+ struct md_attr *ma)
{
int rc;
struct mdd_object *mdd_obj = md2mdd_obj(obj);
}
static int mdd_readpage_sanity_check(const struct lu_env *env,
- struct mdd_object *obj,
- struct md_ucred *uc)
+ struct mdd_object *obj)
{
struct dt_object *next = mdd_object_child(obj);
int rc;
if (S_ISDIR(mdd_object_type(obj)) &&
dt_try_as_dir(env, next))
- rc = mdd_permission_internal(env, obj, MAY_READ, uc);
+ rc = mdd_permission_internal(env, obj, MAY_READ);
else
rc = -ENOTDIR;
}
static int mdd_readpage(const struct lu_env *env, struct md_object *obj,
- const struct lu_rdpg *rdpg, struct md_ucred *uc)
+ const struct lu_rdpg *rdpg)
{
struct dt_object *next;
struct mdd_object *mdd_obj = md2mdd_obj(obj);
next = mdd_object_child(mdd_obj);
mdd_read_lock(env, mdd_obj);
- rc = mdd_readpage_sanity_check(env, mdd_obj, uc);
+ rc = mdd_readpage_sanity_check(env, mdd_obj);
if (rc)
GOTO(out_unlock, rc);
#endif
static int mdd_check_acl(const struct lu_env *env, struct mdd_object *obj,
- struct lu_attr* la, int mask, struct md_ucred *uc)
+ struct lu_attr* la, int mask)
{
#ifdef CONFIG_FS_POSIX_ACL
struct dt_object *next;
struct lu_buf *buf = &mdd_env_info(env)->mti_buf;
+ struct md_ucred *uc = md_ucred(env);
posix_acl_xattr_entry *entry;
int entry_count;
int rc;
}
static int mdd_exec_permission_lite(const struct lu_env *env,
- struct mdd_object *obj,
- struct md_ucred *uc)
+ struct mdd_object *obj)
{
- struct lu_attr *la = &mdd_env_info(env)->mti_la;
+ struct lu_attr *la = &mdd_env_info(env)->mti_la;
+ struct md_ucred *uc = md_ucred(env);
umode_t mode;
int rc;
ENTRY;
static int __mdd_permission_internal(const struct lu_env *env,
struct mdd_object *obj,
- int mask, int getattr,
- struct md_ucred *uc)
+ int mask, int getattr)
{
- struct lu_attr *la = &mdd_env_info(env)->mti_la;
+ struct lu_attr *la = &mdd_env_info(env)->mti_la;
+ struct md_ucred *uc = md_ucred(env);
__u32 mode;
int rc;
if (((mode >> 3) & mask & S_IRWXO) != mask)
goto check_groups;
- rc = mdd_check_acl(env, obj, la, mask, uc);
+ rc = mdd_check_acl(env, obj, la, mask);
if (rc == -EACCES)
goto check_capabilities;
else if ((rc != -EAGAIN) && (rc != -EOPNOTSUPP))
static inline int mdd_permission_internal_locked(const struct lu_env *env,
struct mdd_object *obj,
- int mask, struct md_ucred *uc)
+ int mask)
{
int rc;
mdd_read_lock(env, obj);
- rc = mdd_permission_internal(env, obj, mask, uc);
+ rc = mdd_permission_internal(env, obj, mask);
mdd_read_unlock(env, obj);
return rc;
}
static int mdd_permission(const struct lu_env *env, struct md_object *obj,
- int mask, struct md_ucred *uc)
+ int mask)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
int rc;
ENTRY;
- rc = mdd_permission_internal_locked(env, mdd_obj, mask, uc);
+ rc = mdd_permission_internal_locked(env, mdd_obj, mask);
RETURN(rc);
}
OBD_FREE_PTR(m);
}
+static void *mdd_ucred_key_init(const struct lu_context *ctx,
+ struct lu_context_key *key)
+{
+ struct md_ucred *uc;
+
+ OBD_ALLOC_PTR(uc);
+ if (uc == NULL)
+ uc = ERR_PTR(-ENOMEM);
+ return uc;
+}
+
+static void mdd_ucred_key_fini(const struct lu_context *ctx,
+ struct lu_context_key *key, void *data)
+{
+ struct md_ucred *uc = data;
+ OBD_FREE_PTR(uc);
+}
+
+static struct lu_context_key mdd_ucred_key = {
+ .lct_tags = LCT_SESSION,
+ .lct_init = mdd_ucred_key_init,
+ .lct_fini = mdd_ucred_key_fini
+};
+
+struct md_ucred *md_ucred(const struct lu_env *env)
+{
+ LASSERT(env->le_ses != NULL);
+ return lu_context_key_get(env->le_ses, &mdd_ucred_key);
+}
+EXPORT_SYMBOL(md_ucred);
+
static int mdd_type_init(struct lu_device_type *t)
{
- return lu_context_key_register(&mdd_thread_key);
+ int result;
+
+ result = lu_context_key_register(&mdd_thread_key);
+ if (result == 0)
+ result = lu_context_key_register(&mdd_ucred_key);
+ return result;
}
static void mdd_type_fini(struct lu_device_type *t)
{
+ lu_context_key_degister(&mdd_ucred_key);
lu_context_key_degister(&mdd_thread_key);
}
} else {
body = req_capsule_server_get(&info->mti_pill, &RMF_MDT_BODY);
rc = next->md_ops->mdo_root_get(info->mti_env, next,
- &body->fid1, NULL);
+ &body->fid1);
if (rc == 0)
body->valid |= OBD_MD_FLID;
}
osfs = req_capsule_server_get(&info->mti_pill,&RMF_OBD_STATFS);
/* XXX max_age optimisation is needed here. See mds_statfs */
rc = next->md_ops->mdo_statfs(info->mti_env, next,
- &info->mti_u.ksfs, NULL);
+ &info->mti_u.ksfs);
statfs_pack(osfs, &info->mti_u.ksfs);
}
ma->ma_lmm_size = req_capsule_get_size(pill, &RMF_MDT_MD,
RCL_SERVER);
}
- rc = mo_attr_get(env, next, ma, NULL);
+ rc = mo_attr_get(env, next, ma);
if (rc == -EREMOTE) {
/* This object is located on remote node.*/
repbody->fid1 = *mdt_object_fid(o);
reqbody->valid & OBD_MD_LINKNAME) {
buffer->lb_buf = ma->ma_lmm;
buffer->lb_len = ma->ma_lmm_size;
- rc = mo_readlink(env, next, buffer, NULL);
+ rc = mo_readlink(env, next, buffer);
if (rc <= 0) {
CERROR("readlink failed: %d\n", rc);
rc = -EFAULT;
&RMF_ACL, RCL_SERVER);
if (buffer->lb_len > 0) {
rc = mo_xattr_get(env, next, buffer,
- XATTR_NAME_ACL_ACCESS, NULL);
+ XATTR_NAME_ACL_ACCESS);
if (rc < 0) {
if (rc == -ENODATA || rc == -EOPNOTSUPP)
rc = 0;
*/
LASSERT(fid_is_sane(&info->mti_body->fid2));
rc = mdo_is_subdir(info->mti_env, mdt_object_child(obj),
- &info->mti_body->fid2, &repbody->fid1, NULL);
+ &info->mti_body->fid2, &repbody->fid1);
if (rc < 0)
RETURN(rc);
RETURN(rc);
/*step 2: lookup child's fid by name */
- rc = mdo_lookup(info->mti_env, next, name, child_fid, &info->mti_uc);
+ rc = mdo_lookup(info->mti_env, next, name, child_fid);
if (rc != 0) {
if (rc == -ENOENT)
mdt_set_disposition(info, ldlm_rep, DISP_LOOKUP_NEG);
}
/* call lower layers to fill allocated pages with directory data */
- rc = mo_readpage(info->mti_env, mdt_object_child(object), rdpg,
- &info->mti_uc);
+ rc = mo_readpage(info->mti_env, mdt_object_child(object), rdpg);
if (rc) {
if (rc == -ERANGE)
rc1 = rc;
next = mdt_object_child(info->mti_object);
info->mti_attr.ma_need = MA_INODE;
rc = mo_attr_get(info->mti_env, next,
- &info->mti_attr, NULL);
+ &info->mti_attr);
if (rc == 0) {
body = req_capsule_server_get(pill,
&RMF_MDT_BODY);
case MD_LOV_SYNC:
rc = next->md_ops->mdo_maxsize_get(env, next,
&m->mdt_max_mdsize,
- &m->mdt_max_cookiesize, NULL);
+ &m->mdt_max_cookiesize);
CDEBUG(D_INFO, "get max mdsize %d max cookiesize %d\n",
m->mdt_max_mdsize, m->mdt_max_cookiesize);
break;
.lct_fini = mdt_txn_key_fini
};
+struct md_ucred *mdt_ucred(const struct mdt_thread_info *info)
+{
+ return md_ucred(info->mti_env);
+}
static int mdt_type_init(struct lu_device_type *t)
{
void *buf)
{
struct ptlrpc_request *req = mdt_info_req(info);
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct md_object *next = mdt_object_child(o);
struct mdt_export_data *med = mdt_req2med(req);
struct mdt_remote_perm *perm = buf;
perm->rp_fsgid = uc->mu_o_fsgid;
perm->rp_access_perm = 0;
- if (mo_permission(info->mti_env, next, MAY_READ, uc) == 0)
+ if (mo_permission(info->mti_env, next, MAY_READ) == 0)
perm->rp_access_perm |= MAY_READ;
- if (mo_permission(info->mti_env, next, MAY_WRITE, uc) == 0)
+ if (mo_permission(info->mti_env, next, MAY_WRITE) == 0)
perm->rp_access_perm |= MAY_WRITE;
- if (mo_permission(info->mti_env, next, MAY_EXEC, uc) == 0)
+ if (mo_permission(info->mti_env, next, MAY_EXEC) == 0)
perm->rp_access_perm |= MAY_EXEC;
RETURN(0);
void mdt_body_reverse_idmap(struct mdt_thread_info *info, struct mdt_body *body)
{
struct ptlrpc_request *req = mdt_info_req(info);
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_export_data *med = mdt_req2med(req);
struct mdt_idmap_table *idmap = med->med_idmap;
uid_t uid;
int mdt_fix_attr_ucred(struct mdt_thread_info *info, __u32 op)
{
struct ptlrpc_request *req = mdt_info_req(info);
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct lu_attr *attr = &info->mti_attr.ma_attr;
struct mdt_export_data *med = mdt_req2med(req);
struct mdt_idmap_table *idmap = med->med_idmap;
*/
struct mdt_object *mti_object;
/*
- * User credential.
- */
- struct md_ucred mti_uc;
- /*
* Object attributes.
*/
struct md_attr mti_attr;
} \
} while(0)
+struct md_ucred *mdt_ucred(const struct mdt_thread_info *info);
+
/*
* fid Capability
*/
void mdt_exit_ucred(struct mdt_thread_info *info)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_device *mdt = info->mti_mdt;
if (uc->mu_valid != UCRED_INIT) {
static int old_init_ucred(struct mdt_thread_info *info,
struct mdt_body *body)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_device *mdt = info->mti_mdt;
struct mdt_identity *identity = NULL;
static int old_init_ucred_reint(struct mdt_thread_info *info)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_device *mdt = info->mti_mdt;
struct mdt_identity *identity = NULL;
struct mdt_export_data *med = mdt_req2med(req);
struct mdt_device *mdt = info->mti_mdt;
struct ptlrpc_user_desc *pud = req->rq_user_desc;
- struct md_ucred *ucred = &info->mti_uc;
+ struct md_ucred *ucred = mdt_ucred(info);
struct mdt_identity *identity = NULL;
lnet_nid_t peernid = req->rq_peer.nid;
__u32 setxid_perm = 0;
int mdt_init_ucred(struct mdt_thread_info *info, struct mdt_body *body)
{
struct ptlrpc_request *req = mdt_info_req(info);
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
if ((uc->mu_valid == UCRED_OLD) || (uc->mu_valid == UCRED_NEW))
return 0;
int mdt_init_ucred_reint(struct mdt_thread_info *info)
{
struct ptlrpc_request *req = mdt_info_req(info);
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
if ((uc->mu_valid == UCRED_OLD) || (uc->mu_valid == UCRED_NEW))
return 0;
static int mdt_setattr_unpack_rec(struct mdt_thread_info *info)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct md_attr *ma = &info->mti_attr;
struct lu_attr *la = &ma->ma_attr;
struct req_capsule *pill = &info->mti_pill;
static int mdt_create_unpack(struct mdt_thread_info *info)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_rec_create *rec;
struct lu_attr *attr = &info->mti_attr.ma_attr;
struct mdt_reint_record *rr = &info->mti_rr;
static int mdt_link_unpack(struct mdt_thread_info *info)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_rec_link *rec;
struct lu_attr *attr = &info->mti_attr.ma_attr;
struct mdt_reint_record *rr = &info->mti_rr;
static int mdt_unlink_unpack(struct mdt_thread_info *info)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_rec_unlink *rec;
struct lu_attr *attr = &info->mti_attr.ma_attr;
struct mdt_reint_record *rr = &info->mti_rr;
static int mdt_rename_unpack(struct mdt_thread_info *info)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_rec_rename *rec;
struct lu_attr *attr = &info->mti_attr.ma_attr;
struct mdt_reint_record *rr = &info->mti_rr;
static int mdt_open_unpack(struct mdt_thread_info *info)
{
- struct md_ucred *uc = &info->mti_uc;
+ struct md_ucred *uc = mdt_ucred(info);
struct mdt_rec_create *rec;
struct lu_attr *attr = &info->mti_attr.ma_attr;
struct req_capsule *pill = &info->mti_pill;
ma->ma_need = MA_INODE | MA_LOV;
rc = mdo_create_data(info->mti_env,
p ? mdt_object_child(p) : NULL,
- mdt_object_child(o), spec, ma, &info->mti_uc);
+ mdt_object_child(o), spec, ma);
RETURN(rc);
}
RETURN(rc);
rc = mo_open(info->mti_env, mdt_object_child(o),
- created ? flags | MDS_OPEN_CREATED : flags,
- &info->mti_uc);
+ created ? flags | MDS_OPEN_CREATED : flags);
if (rc)
RETURN(rc);
if (rc > 0) {
struct md_object *next;
next = mdt_object_child(child);
- rc = mo_attr_get(env, next, ma, NULL);
+ rc = mo_attr_get(env, next, ma);
if (rc == 0)
rc = mdt_mfd_open(info, parent, child,
flags, 1, ldlm_rep);
DISP_LOOKUP_EXECD |
DISP_LOOKUP_POS));
- rc = mo_attr_get(env, mdt_object_child(o), ma, NULL);
+ rc = mo_attr_get(env, mdt_object_child(o), ma);
if (rc == 0)
rc = mdt_mfd_open(info, NULL, o, flags, 0, rep);
} else if (rc == 0) {
rc = lu_object_exists(&o->mot_obj.mo_lu);
if (rc > 0) {
- rc = mo_attr_get(info->mti_env, mdt_object_child(o), ma, NULL);
+ rc = mo_attr_get(info->mti_env, mdt_object_child(o), ma);
if (rc == 0)
rc = mdt_mfd_open(info, NULL, o, flags, 0, rep);
} else if (rc == 0) {
GOTO(out, result = PTR_ERR(parent));
result = mdo_lookup(info->mti_env, mdt_object_child(parent),
- rr->rr_name, child_fid, &info->mti_uc);
+ rr->rr_name, child_fid);
if (result != 0 && result != -ENOENT && result != -ESTALE)
GOTO(out_parent, result);
rr->rr_name,
mdt_object_child(child),
&info->mti_spec,
- &info->mti_attr,
- &info->mti_uc);
+ &info->mti_attr);
if (result == -ERESTART) {
mdt_clear_disposition(info, ldlm_rep, DISP_OPEN_CREATE);
GOTO(out_child, result);
} else {
/* We have to get attr & lov ea for this object */
result = mo_attr_get(info->mti_env, mdt_object_child(child),
- ma, NULL);
+ ma);
/*
* The object is on remote node, return its FID for remote open.
*/
mdt_object_child(parent),
mdt_object_child(child),
rr->rr_name,
- &info->mti_attr,
- &info->mti_uc);
+ &info->mti_attr);
if (rc2 != 0)
CERROR("error in cleanup of open");
}
ma->ma_need |= MA_INODE;
if (!MFD_CLOSED(mode))
- rc = mo_close(info->mti_env, next, ma, NULL);
+ rc = mo_close(info->mti_env, next, ma);
else if (ret == -EAGAIN)
- rc = mo_attr_get(info->mti_env, next, ma, NULL);
+ rc = mo_attr_get(info->mti_env, next, ma);
/* If the object is unlinked, do not try to re-enable SIZEONMDS */
if ((ret == -EAGAIN) && (ma->ma_valid & MA_INODE) &&
LASSERT(!IS_ERR(child));
body = req_capsule_server_get(&mti->mti_pill, &RMF_MDT_BODY);
- rc = mo_attr_get(mti->mti_env, mdt_object_child(child),
- &mti->mti_attr, NULL);
+ rc = mo_attr_get(mti->mti_env, mdt_object_child(child), &mti->mti_attr);
if (rc == -EREMOTE) {
/* object was created on remote server */
req->rq_status = rc;
obj = mdt_object_find(mti->mti_env, mdt, mti->mti_rr.rr_fid1,
mti->mti_rr.rr_capa1);
LASSERT(!IS_ERR(obj));
- mo_attr_get(mti->mti_env, mdt_object_child(obj),
- &mti->mti_attr, NULL);
+ mo_attr_get(mti->mti_env, mdt_object_child(obj), &mti->mti_attr);
mdt_pack_attr2body(body, &mti->mti_attr.ma_attr, mdt_object_fid(obj));
mdt_body_reverse_idmap(mti, body);
rc = mdo_create(info->mti_env, next, rr->rr_name,
mdt_object_child(child),
- &info->mti_spec, ma, &info->mti_uc);
+ &info->mti_spec, ma);
if (rc == 0) {
/* return fid & attr to client. */
if (ma->ma_valid & MA_INODE)
ma->ma_need = MA_INODE;
rc = mo_object_create(info->mti_env, next, &info->mti_spec,
- ma, &info->mti_uc);
+ ma);
if (rc == 0) {
/* return fid & attr to client. */
if (ma->ma_valid & MA_INODE)
OBD_FAIL_MDS_REINT_SETATTR_WRITE);
/* all attrs are packed into mti_attr in unpack_setattr */
- rc = mo_attr_set(info->mti_env, mdt_object_child(mo), ma,
- &info->mti_uc);
+ rc = mo_attr_set(info->mti_env, mdt_object_child(mo), ma);
if (rc != 0)
GOTO(out, rc);
ma->ma_need = MA_INODE;
next = mdt_object_child(mo);
- rc = mo_attr_get(info->mti_env, next, ma, NULL);
+ rc = mo_attr_get(info->mti_env, next, ma);
if (rc != 0)
GOTO(out, rc);
if (strlen(rr->rr_name) == 0) {
/* remote partial operation */
- rc = mo_ref_del(info->mti_env, mdt_object_child(mp), ma,
- &info->mti_uc);
+ rc = mo_ref_del(info->mti_env, mdt_object_child(mp), ma);
GOTO(out_unlock_parent, rc);
}
/* step 2: find & lock the child */
rc = mdo_lookup(info->mti_env, mdt_object_child(mp),
- rr->rr_name, child_fid, &info->mti_uc);
+ rr->rr_name, child_fid);
if (rc != 0)
GOTO(out_unlock_parent, rc);
*/
ma->ma_need = MA_INODE;
rc = mdo_unlink(info->mti_env, mdt_object_child(mp),
- mdt_object_child(mc), rr->rr_name, ma, &info->mti_uc);
+ mdt_object_child(mc), rr->rr_name, ma);
if (rc)
GOTO(out_unlock_child, rc);
if (strlen(rr->rr_name) == 0) {
/* remote partial operation */
- rc = mo_ref_add(info->mti_env, mdt_object_child(ms),
- &info->mti_uc);
+ rc = mo_ref_add(info->mti_env, mdt_object_child(ms));
GOTO(out_unlock_source, rc);
}
/*step 2: find & lock the target parent dir*/
OBD_FAIL_MDS_REINT_LINK_WRITE);
rc = mdo_link(info->mti_env, mdt_object_child(mp),
- mdt_object_child(ms), rr->rr_name, ma, &info->mti_uc);
+ mdt_object_child(ms), rr->rr_name, ma);
GOTO(out_unlock_target, rc);
out_unlock_target:
/*step 2: find & lock the target object if exists*/
rc = mdo_lookup(info->mti_env, mdt_object_child(mtgtdir),
- rr->rr_tgt, tgt_fid, &info->mti_uc);
+ rr->rr_tgt, tgt_fid);
if (rc != 0 && rc != -ENOENT) {
GOTO(out_unlock_tgtdir, rc);
} else if (rc == 0) {
rc = mdo_rename_tgt(info->mti_env, mdt_object_child(mtgtdir),
mdt_object_child(mtgt), rr->rr_fid2,
- rr->rr_tgt, ma, &info->mti_uc);
+ rr->rr_tgt, ma);
} else /* -ENOENT */ {
rc = mdo_name_insert(info->mti_env, mdt_object_child(mtgtdir),
rr->rr_tgt, rr->rr_fid2,
- S_ISDIR(ma->ma_attr.la_mode),
- &info->mti_uc);
+ S_ISDIR(ma->ma_attr.la_mode));
}
/* handle last link of tgt object */
dst = mdt_object_find(info->mti_env, info->mti_mdt, &dst_fid,
BYPASS_CAPA);
if (!IS_ERR(dst)) {
- rc = mdo_is_subdir(info->mti_env,
- mdt_object_child(dst),
- fid, &dst_fid, NULL);
+ rc = mdo_is_subdir(info->mti_env, mdt_object_child(dst),
+ fid, &dst_fid);
mdt_object_put(info->mti_env, dst);
if (rc < 0) {
CERROR("Error while doing mdo_is_subdir(), rc %d\n",
{
struct mdt_reint_record *rr = &info->mti_rr;
struct req_capsule *pill = &info->mti_pill;
- struct ptlrpc_request *req = mdt_info_req(info);
struct md_attr *ma = &info->mti_attr;
struct mdt_object *msrcdir;
struct mdt_object *mtgtdir;
ENTRY;
-#if 0
- DEBUG_REQ(D_INODE, req, "rename "DFID"/%s to "DFID"/%s",
- PFID(rr->rr_fid1), rr->rr_name,
- PFID(rr->rr_fid2), rr->rr_tgt);
-#endif
-
rc = req_capsule_get_size(pill, &RMF_NAME, RCL_CLIENT);
if (rc == 1) {
/* if (rr->rr_name[0] == 0) {*/
/*step 3: find & lock the old object*/
rc = mdo_lookup(info->mti_env, mdt_object_child(msrcdir),
- rr->rr_name, old_fid, &info->mti_uc);
+ rr->rr_name, old_fid);
if (rc != 0)
GOTO(out_unlock_target, rc);
/*step 4: find & lock the new object*/
/* new target object may not exist now */
rc = mdo_lookup(info->mti_env, mdt_object_child(mtgtdir),
- rr->rr_tgt, new_fid, &info->mti_uc);
+ rr->rr_tgt, new_fid);
if (rc == 0) {
/* the new_fid should have been filled at this moment*/
if (lu_fid_eq(old_fid, new_fid))
rc = mdo_rename(info->mti_env, mdt_object_child(msrcdir),
mdt_object_child(mtgtdir), old_fid, rr->rr_name,
(mnew ? mdt_object_child(mnew) : NULL),
- rr->rr_tgt, ma, &info->mti_uc);
+ rr->rr_tgt, ma);
/* handle last link of tgt object */
if (rc == 0 && mnew)
struct obd_device *obd = req->rq_export->exp_obd;
struct mdt_device *mdt = info->mti_mdt;
struct lvfs_ucred uc;
+ struct md_ucred *uc0 = mdt_ucred(info);
struct lvfs_run_ctxt saved;
struct rmtacl_upcall_data data;
struct upcall_cache_entry *entry;
data.aud_cmd = cmd;
- uc.luc_uid = info->mti_uc.mu_uid;
- uc.luc_gid = info->mti_uc.mu_gid;
- uc.luc_fsuid = info->mti_uc.mu_fsuid;
- uc.luc_fsgid = info->mti_uc.mu_fsgid;
- uc.luc_cap = info->mti_uc.mu_cap;
- uc.luc_umask = info->mti_uc.mu_umask;
- uc.luc_ginfo = info->mti_uc.mu_ginfo;
- uc.luc_identity = info->mti_uc.mu_identity;
+ uc.luc_uid = uc0->mu_uid;
+ uc.luc_gid = uc0->mu_gid;
+ uc.luc_fsuid = uc0->mu_fsuid;
+ uc.luc_fsgid = uc0->mu_fsgid;
+ uc.luc_cap = uc0->mu_cap;
+ uc.luc_umask = uc0->mu_umask;
+ uc.luc_ginfo = uc0->mu_ginfo;
+ uc.luc_identity = uc0->mu_identity;
push_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
entry = upcall_cache_get_entry(mdt->mdt_rmtacl_cache, (__u64)key,
else
rc = mo_xattr_get(info->mti_env,
mdt_object_child(info->mti_object),
- &LU_BUF_NULL, xattr_name, NULL);
+ &LU_BUF_NULL, xattr_name);
} else if ((valid & OBD_MD_FLXATTRLS) == OBD_MD_FLXATTRLS) {
rc = mo_xattr_list(info->mti_env,
mdt_object_child(info->mti_object),
- &LU_BUF_NULL, NULL);
+ &LU_BUF_NULL);
} else {
CERROR("valid bits: "LPX64"\n", info->mti_body->valid);
return -EINVAL;
rc = do_remote_getfacl(info, &body->fid1, buf);
} else {
- rc = mo_xattr_get(info->mti_env, next, buf,
- xattr_name, NULL);
+ rc = mo_xattr_get(info->mti_env, next, buf, xattr_name);
}
if (rc < 0 && rc != -ENODATA && rc != -EOPNOTSUPP &&
} else if (info->mti_body->valid & OBD_MD_FLXATTRLS) {
CDEBUG(D_INODE, "listxattr\n");
- rc = mo_xattr_list(info->mti_env, next, buf, NULL);
+ rc = mo_xattr_list(info->mti_env, next, buf);
if (rc < 0)
CDEBUG(D_OTHER, "listxattr failed: %d\n", rc);
} else
buf->lb_buf = xattr;
buf->lb_len = xattr_len;
- rc = mo_xattr_set(env, child, buf,
- xattr_name, flags, &info->mti_uc);
+ rc = mo_xattr_set(env, child, buf, xattr_name, flags);
}
} else if ((valid & OBD_MD_FLXATTRRM) == OBD_MD_FLXATTRRM) {
- rc = mo_xattr_del(env, child, xattr_name, &info->mti_uc);
+ rc = mo_xattr_del(env, child, xattr_name);
} else {
CERROR("valid bits: "LPX64"\n", body->valid);
rc = -EINVAL;