int ur_cookielen;
struct llog_cookie *ur_logcookies;
struct iattr ur_iattr;
- struct obd_ucred ur_uc;
+ struct lvfs_ucred ur_uc;
__u64 ur_rdev;
__u64 ur_time;
__u32 ur_mode;
__u32 ur_flags;
};
-#define ur_fsuid ur_uc.ouc_fsuid
-#define ur_fsgid ur_uc.ouc_fsgid
-#define ur_cap ur_uc.ouc_cap
-#define ur_suppgid1 ur_uc.ouc_suppgid1
-#define ur_suppgid2 ur_uc.ouc_suppgid2
-#define ur_umask ur_uc.ouc_umask
+#define ur_fsuid ur_uc.luc_fsuid
+#define ur_fsgid ur_uc.luc_fsgid
+#define ur_cap ur_uc.luc_cap
+#define ur_suppgid1 ur_uc.luc_suppgid1
+#define ur_suppgid2 ur_uc.luc_suppgid2
+#define ur_umask ur_uc.luc_umask
#define MDS_LR_SERVER_SIZE 512
#endif
/* simple.c */
-struct obd_ucred {
- __u32 ouc_fsuid;
- __u32 ouc_fsgid;
- __u32 ouc_cap;
- __u32 ouc_suppgid1;
- __u32 ouc_suppgid2;
- __u32 ouc_umask;
+struct lvfs_ucred {
+ __u32 luc_fsuid;
+ __u32 luc_fsgid;
+ __u32 luc_cap;
+ __u32 luc_suppgid1;
+ __u32 luc_suppgid2;
+ __u32 luc_umask;
};
struct lvfs_callback_ops {
#define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA
#define OBD_CTXT_DEBUG /* development-only debugging */
-struct obd_run_ctxt {
+struct lvfs_run_ctxt {
struct vfsmount *pwdmnt;
struct dentry *pwd;
mm_segment_t fs;
- struct obd_ucred ouc;
+ struct lvfs_ucred ouc;
int ngroups;
struct lvfs_callback_ops cb_ops;
#ifdef OBD_CTXT_DEBUG
#endif
/* lvfs_common.c */
-struct dentry *lvfs_fid2dentry(struct obd_run_ctxt *, __u64, __u32, __u64 ,void *data);
+struct dentry *lvfs_fid2dentry(struct lvfs_run_ctxt *, __u64, __u32, __u64 ,void *data);
-void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx,
- struct obd_ucred *cred);
-void pop_ctxt(struct obd_run_ctxt *saved, struct obd_run_ctxt *new_ctx,
- struct obd_ucred *cred);
+void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx,
+ struct lvfs_ucred *cred);
+void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx,
+ struct lvfs_ucred *cred);
#ifdef __KERNEL__
#define l_filp_open filp_open
-struct obd_run_ctxt;
-struct l_file *l_dentry_open(struct obd_run_ctxt *, struct l_dentry *,
+struct lvfs_run_ctxt;
+struct l_file *l_dentry_open(struct lvfs_run_ctxt *, struct l_dentry *,
int flags);
struct l_linux_dirent {
int (*ap_refresh_count)(void *data, int cmd);
void (*ap_fill_obdo)(void *data, int cmd, struct obdo *oa);
void (*ap_completion)(void *data, int cmd, struct obdo *oa, int rc);
- void (*ap_get_ucred)(void *data, struct obd_ucred *ouc);
+ void (*ap_get_ucred)(void *data, struct lvfs_ucred *ouc);
};
/* the `oig' is passed down from a caller of obd rw methods. the callee
spinlock_t obd_osfs_lock;
struct obd_statfs obd_osfs;
unsigned long obd_osfs_age; /* jiffies */
- struct obd_run_ctxt obd_ctxt;
+ struct lvfs_run_ctxt obd_lvfs_ctxt;
struct llog_ctxt *obd_llog_ctxt[LLOG_MAX_CTXTS];
struct obd_device *obd_observer;
struct obd_export *obd_self_export;
{
LASSERT(exp->exp_obd);
- return lvfs_fid2dentry(&exp->exp_obd->obd_ctxt, id_ino, gen, gr,
+ return lvfs_fid2dentry(&exp->exp_obd->obd_lvfs_ctxt, id_ino, gen, gr,
exp->exp_obd);
}
char *test_quotafile[2] = {"usrquota_test", "grpquota_test"};
static int quotfmt_initialize(struct lustre_quota_info *lqi, struct obd_device *tgt,
- struct obd_run_ctxt *saved)
+ struct lvfs_run_ctxt *saved)
{
struct lustre_disk_dqheader dqhead;
static const uint quota_magics[] = LUSTRE_INITQMAGICS;
static const uint quota_versions[] = LUSTRE_INITQVERSIONS;
struct file *fp;
- struct inode *parent_inode = tgt->obd_ctxt.pwd->d_inode;
+ struct inode *parent_inode = tgt->obd_lvfs_ctxt.pwd->d_inode;
size_t size;
struct dentry *de;
int i, rc = 0;
ENTRY;
- push_ctxt(saved, &tgt->obd_ctxt, NULL);
+ push_ctxt(saved, &tgt->obd_lvfs_ctxt, NULL);
sema_init(&lqi->qi_sem, 1);
/* remove the stale test quotafile */
down(&parent_inode->i_sem);
- de = lookup_one_len(name, tgt->obd_ctxt.pwd, namelen);
+ de = lookup_one_len(name, tgt->obd_lvfs_ctxt.pwd, namelen);
if (!IS_ERR(de) && de->d_inode)
vfs_unlink(parent_inode, de);
if (!IS_ERR(de))
}
static int quotfmt_finalize(struct lustre_quota_info *lqi, struct obd_device *tgt,
- struct obd_run_ctxt *saved)
+ struct lvfs_run_ctxt *saved)
{
struct dentry *de;
- struct inode *parent_inode = tgt->obd_ctxt.pwd->d_inode;
+ struct inode *parent_inode = tgt->obd_lvfs_ctxt.pwd->d_inode;
int i, rc = 0;
ENTRY;
/* unlink quota file */
down(&parent_inode->i_sem);
- de = lookup_one_len(name, tgt->obd_ctxt.pwd, namelen);
+ de = lookup_one_len(name, tgt->obd_lvfs_ctxt.pwd, namelen);
if (IS_ERR(de) || de->d_inode == NULL) {
rc = IS_ERR(de) ? PTR_ERR(de) : -ENOENT;
CERROR("error lookup quotafile %s (rc = %d)\n",
up(&parent_inode->i_sem);
}
- pop_ctxt(saved, &tgt->obd_ctxt, NULL);
+ pop_ctxt(saved, &tgt->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
static int quotfmt_run_tests(struct obd_device *obd, struct obd_device *tgt)
{
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct lustre_quota_info *lqi = NULL;
int rc = 0;
ENTRY;
EXIT;
}
-static void llu_ap_get_ucred(void *data, struct obd_ucred *ouc)
+static void llu_ap_get_ucred(void *data, struct lvfs_ucred *ouc)
{
struct ll_async_page *llap;
struct ll_uctxt ctxt;
llap = LLAP_FROM_COOKIE(data);
- ouc->ouc_fsuid = current->fsuid;
- ouc->ouc_fsgid = current->fsgid;
- ouc->ouc_cap = current->cap_effective;
+ ouc->luc_fsuid = current->fsuid;
+ ouc->luc_fsgid = current->fsgid;
+ ouc->luc_cap = current->cap_effective;
ll_i2uctxt(&ctxt, llap->llap_inode, NULL);
- ouc->ouc_suppgid1 = ctxt.gid1;
+ ouc->luc_suppgid1 = ctxt.gid1;
EXIT;
}
struct list_head llap_pending_write;
struct list_head llap_pglist_item;
/* user credit information for oss enforcement quota */
- struct obd_ucred llap_ouc;
+ struct lvfs_ucred llap_ouc;
/* checksum for paranoid I/O debugging */
__u32 llap_checksum;
};
EXIT;
}
-static void ll_ap_get_ucred(void *data, struct obd_ucred *ouc)
+static void ll_ap_get_ucred(void *data, struct lvfs_ucred *ouc)
{
struct ll_async_page *llap;
RETURN(-EINVAL);
/* set user credit information for this page */
- llap->llap_ouc.ouc_fsuid = current->fsuid;
- llap->llap_ouc.ouc_fsgid = current->fsgid;
- llap->llap_ouc.ouc_cap = current->cap_effective;
+ llap->llap_ouc.luc_fsuid = current->fsuid;
+ llap->llap_ouc.luc_fsgid = current->fsgid;
+ llap->llap_ouc.luc_cap = current->cap_effective;
ll_i2uctxt(&ctxt, inode, NULL);
- llap->llap_ouc.ouc_suppgid1 = ctxt.gid1;
+ llap->llap_ouc.luc_suppgid1 = ctxt.gid1;
/* queue a write for some time in the future the first time we
* dirty the page */
lap->lap_caller_ops->ap_completion(lap->lap_caller_data, cmd, oa, rc);
}
-static void lov_ap_get_ucred(void *data, struct obd_ucred *ouc)
+static void lov_ap_get_ucred(void *data, struct lvfs_ucred *ouc)
{
struct lov_async_page *lap = LAP_FROM_COOKIE(data);
#include <linux/lvfs.h>
-struct dentry *lvfs_fid2dentry(struct obd_run_ctxt *ctxt, __u64 id,
+struct dentry *lvfs_fid2dentry(struct lvfs_run_ctxt *ctxt, __u64 id,
__u32 gen, __u64 gr, void *data)
{
return ctxt->cb_ops.l_fid2dentry(id, gen, gr, data);
#endif
/* push / pop to root of obd store */
-void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx,
- struct obd_ucred *uc)
+void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx,
+ struct lvfs_ucred *uc)
{
//ASSERT_NOT_KERNEL_CTXT("already in kernel context!\n");
ASSERT_CTXT_MAGIC(new_ctx->magic);
save->pwd = dget(current->fs->pwd);
save->pwdmnt = mntget(current->fs->pwdmnt);
save->ngroups = current_ngroups;
- save->ouc.ouc_umask = current->fs->umask;
+ save->ouc.luc_umask = current->fs->umask;
LASSERT(save->pwd);
LASSERT(save->pwdmnt);
LASSERT(new_ctx->pwdmnt);
if (uc) {
- save->ouc.ouc_fsuid = current->fsuid;
- save->ouc.ouc_fsgid = current->fsgid;
- save->ouc.ouc_cap = current->cap_effective;
- save->ouc.ouc_suppgid1 = current_groups[0];
- save->ouc.ouc_suppgid2 = current_groups[1];
-
- current->fsuid = uc->ouc_fsuid;
- current->fsgid = uc->ouc_fsgid;
- current->cap_effective = uc->ouc_cap;
+ save->ouc.luc_fsuid = current->fsuid;
+ save->ouc.luc_fsgid = current->fsgid;
+ save->ouc.luc_cap = current->cap_effective;
+ save->ouc.luc_suppgid1 = current_groups[0];
+ save->ouc.luc_suppgid2 = current_groups[1];
+
+ current->fsuid = uc->luc_fsuid;
+ current->fsgid = uc->luc_fsgid;
+ current->cap_effective = uc->luc_cap;
current_ngroups = 0;
- if (uc->ouc_suppgid1 != -1)
- current_groups[current_ngroups++] = uc->ouc_suppgid1;
- if (uc->ouc_suppgid2 != -1)
- current_groups[current_ngroups++] = uc->ouc_suppgid2;
+ if (uc->luc_suppgid1 != -1)
+ current_groups[current_ngroups++] = uc->luc_suppgid1;
+ if (uc->luc_suppgid2 != -1)
+ current_groups[current_ngroups++] = uc->luc_suppgid2;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
- if (uc->ouc_suppgid1 != -1 && uc->ouc_suppgid2 != -1 &&
- (uc->ouc_suppgid1 > uc->ouc_suppgid2)) {
- current_groups[0] = uc->ouc_suppgid2;
- current_groups[1] = uc->ouc_suppgid1;
+ if (uc->luc_suppgid1 != -1 && uc->luc_suppgid2 != -1 &&
+ (uc->luc_suppgid1 > uc->luc_suppgid2)) {
+ current_groups[0] = uc->luc_suppgid2;
+ current_groups[1] = uc->luc_suppgid1;
}
#endif
}
}
EXPORT_SYMBOL(push_ctxt);
-void pop_ctxt(struct obd_run_ctxt *saved, struct obd_run_ctxt *new_ctx,
- struct obd_ucred *uc)
+void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx,
+ struct lvfs_ucred *uc)
{
//printk("pc0");
ASSERT_CTXT_MAGIC(saved->magic);
dput(saved->pwd);
mntput(saved->pwdmnt);
- current->fs->umask = saved->ouc.ouc_umask;
+ current->fs->umask = saved->ouc.luc_umask;
if (uc) {
- current->fsuid = saved->ouc.ouc_fsuid;
- current->fsgid = saved->ouc.ouc_fsgid;
- current->cap_effective = saved->ouc.ouc_cap;
+ current->fsuid = saved->ouc.luc_fsuid;
+ current->fsgid = saved->ouc.luc_fsgid;
+ current->cap_effective = saved->ouc.luc_cap;
current_ngroups = saved->ngroups;
- current_groups[0] = saved->ouc.ouc_suppgid1;
- current_groups[1] = saved->ouc.ouc_suppgid2;
+ current_groups[0] = saved->ouc.luc_suppgid1;
+ current_groups[1] = saved->ouc.luc_suppgid2;
}
/*
}
EXPORT_SYMBOL(lustre_fsync);
-struct l_file *l_dentry_open(struct obd_run_ctxt *ctxt, struct l_dentry *de,
+struct l_file *l_dentry_open(struct lvfs_run_ctxt *ctxt, struct l_dentry *de,
int flags)
{
mntget(ctxt->pwdmnt);
#include <linux/lustre_lib.h>
/* XXX currently ctxt functions should not be used ?? */
-void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx,
- struct obd_ucred *uc)
+void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx,
+ struct lvfs_ucred *uc)
{
LBUG();
}
-void pop_ctxt(struct obd_run_ctxt *saved, struct obd_run_ctxt *new_ctx,
- struct obd_ucred *uc)
+void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx,
+ struct lvfs_ucred *uc)
{
LBUG();
}
static int quotactl_run_tests(struct obd_device *obd, struct obd_device *tgt)
{
struct super_block *sb;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc;
ENTRY;
RETURN(-EINVAL);
}
- push_ctxt(&saved, &tgt->obd_ctxt, NULL);
+ push_ctxt(&saved, &tgt->obd_lvfs_ctxt, NULL);
rc = quotactl_test_1(tgt, sb);
if (rc)
cleanup:
quotactl_test_4(tgt, sb);
- pop_ctxt(&saved, &tgt->obd_ctxt, NULL);
+ pop_ctxt(&saved, &tgt->obd_lvfs_ctxt, NULL);
return rc;
}
{
struct mds_export_data *med;
struct obd_device *obd = export->exp_obd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc = 0;
ENTRY;
if (obd_uuid_equals(&export->exp_client_uuid, &obd->obd_uuid))
GOTO(out, 0);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
/* Close any open files (which may also cause orphan unlinking). */
spin_lock(&med->med_open_lock);
while (!list_empty(&med->med_open_head)) {
spin_lock(&med->med_open_lock);
}
spin_unlock(&med->med_open_lock);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
out:
mds_client_free(export);
{
struct obd_device *obd = req->rq_export->exp_obd;
struct ldlm_reply *rep = NULL;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct mds_body *body;
struct dentry *dparent = NULL, *dchild = NULL;
- struct obd_ucred uc;
+ struct lvfs_ucred uc;
struct lustre_handle parent_lockh;
int namesize;
int rc = 0, cleanup_phase = 0, resent_req = 0;
offset = 1;
}
- uc.ouc_fsuid = body->fsuid;
- uc.ouc_fsgid = body->fsgid;
- uc.ouc_cap = body->capability;
- uc.ouc_suppgid1 = body->suppgid;
- uc.ouc_suppgid2 = -1;
- push_ctxt(&saved, &obd->obd_ctxt, &uc);
+ uc.luc_fsuid = body->fsuid;
+ uc.luc_fsgid = body->fsgid;
+ uc.luc_cap = body->capability;
+ uc.luc_suppgid1 = body->suppgid;
+ uc.luc_suppgid2 = -1;
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
cleanup_phase = 1; /* kernel context */
intent_set_disposition(rep, DISP_LOOKUP_EXECD);
}
l_dput(dchild);
case 1:
- pop_ctxt(&saved, &obd->obd_ctxt, &uc);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
default: ;
}
return rc;
{
struct mds_obd *mds = mds_req2mds(req);
struct obd_device *obd = req->rq_export->exp_obd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct dentry *de;
struct mds_body *body;
- struct obd_ucred uc;
+ struct lvfs_ucred uc;
int rc = 0;
ENTRY;
RETURN(-EFAULT);
}
- uc.ouc_fsuid = body->fsuid;
- uc.ouc_fsgid = body->fsgid;
- uc.ouc_cap = body->capability;
- push_ctxt(&saved, &obd->obd_ctxt, &uc);
+ uc.luc_fsuid = body->fsuid;
+ uc.luc_fsgid = body->fsgid;
+ uc.luc_cap = body->capability;
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
de = mds_fid2dentry(mds, &body->fid1, NULL);
if (IS_ERR(de)) {
rc = req->rq_status = PTR_ERR(de);
l_dput(de);
GOTO(out_pop, rc);
out_pop:
- pop_ctxt(&saved, &obd->obd_ctxt, &uc);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
return rc;
}
struct dentry *de;
struct file *file;
struct mds_body *body, *repbody;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc, size = sizeof(*repbody);
- struct obd_ucred uc;
+ struct lvfs_ucred uc;
ENTRY;
if (OBD_FAIL_CHECK(OBD_FAIL_MDS_READPAGE_PACK))
if (body == NULL)
GOTO (out, rc = -EFAULT);
- uc.ouc_fsuid = body->fsuid;
- uc.ouc_fsgid = body->fsgid;
- uc.ouc_cap = body->capability;
- push_ctxt(&saved, &obd->obd_ctxt, &uc);
+ uc.luc_fsuid = body->fsuid;
+ uc.luc_fsgid = body->fsgid;
+ uc.luc_cap = body->capability;
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
de = mds_fid2dentry(&obd->u.mds, &body->fid1, &mnt);
if (IS_ERR(de))
GOTO(out_pop, rc = PTR_ERR(de));
out_file:
filp_close(file, 0);
out_pop:
- pop_ctxt(&saved, &obd->obd_ctxt, &uc);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
out:
req->rq_status = rc;
RETURN(0);
struct obd_device *obd;
struct obd_export *exp;
struct obd_quotactl *oqctl;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc;
lock_kernel();
oqctl = &qchki->qi_oqctl;
obd = exp->exp_obd;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = fsfilt_quotacheck(obd, obd->u.mds.mds_sb, oqctl);
if (rc)
CERROR("%s: fsfilt_quotacheck: %d\n", obd->obd_name, rc);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = mds_quotacheck_callback(exp, oqctl);
{
struct obd_device *obd = req->rq_export->exp_obd;
struct obd_quotactl *oqctl, *repoqc;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc = 0, size = sizeof(*repoqc);
ENTRY;
if (repoqc->qc_cmd == Q_GETQUOTA)
loqc = oqctl;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = fsfilt_quotactl(obd, obd->u.mds.mds_sb, loqc);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (!rc && loqc->qc_cmd == Q_GETQUOTA) {
repoqc->qc_dqblk.dqb_curinodes +=
struct mds_obd *mds = &obd->u.mds;
struct mds_server_data *msd = mds->mds_server_data;
struct file *filp = mds->mds_rcvd_filp;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
loff_t off = 0;
int rc;
ENTRY;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
msd->msd_last_transno = cpu_to_le64(mds->mds_last_transno);
CDEBUG(D_SUPER, "MDS mount_count is "LPU64", last_transno is "LPU64"\n",
rc = fsfilt_write_record(obd, filp, msd, sizeof(*msd), &off,force_sync);
if (rc)
CERROR("error writing MDS server data: rc = %d\n", rc);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
RETURN(rc);
if (mds->mds_profile) {
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct lustre_profile *lprof;
struct config_llog_instance cfg;
cfg.cfg_instance = NULL;
cfg.cfg_uuid = mds->mds_lov_uuid;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = class_config_parse_llog(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
mds->mds_profile, &cfg);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
switch (rc) {
case 0:
break;
if (mds->mds_profile) {
char * cln_prof;
struct config_llog_instance cfg;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int len = strlen(mds->mds_profile) + sizeof("-clean") + 1;
OBD_ALLOC(cln_prof, len);
cfg.cfg_instance = NULL;
cfg.cfg_uuid = mds->mds_lov_uuid;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
class_config_parse_llog(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
cln_prof, &cfg);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
OBD_FREE(cln_prof, len);
OBD_FREE(mds->mds_profile, strlen(mds->mds_profile) + 1);
LASSERTF(med->med_lr_off > 0, "med_lr_off = %llu\n", med->med_lr_off);
if (new_client) {
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
loff_t off = med->med_lr_off;
struct file *file = mds->mds_rcvd_filp;
int rc;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = fsfilt_write_record(obd, file, med->med_mcd,
sizeof(*med->med_mcd), &off, 1);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (rc)
return rc;
struct mds_obd *mds = &exp->exp_obd->u.mds;
struct obd_device *obd = exp->exp_obd;
struct mds_client_data zero_mcd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc;
loff_t off;
ENTRY;
if (!(exp->exp_flags & OBD_OPT_FAILOVER)) {
memset(&zero_mcd, 0, sizeof zero_mcd);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = fsfilt_write_record(obd, mds->mds_rcvd_filp, &zero_mcd,
sizeof(zero_mcd), &off, 1);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
CDEBUG(rc == 0 ? D_INFO : D_ERROR,
"zeroing out client %s idx %u in %s rc %d\n",
int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt)
{
struct mds_obd *mds = &obd->u.mds;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct dentry *dentry;
struct file *file;
int rc;
fsfilt_setup(obd, mds->mds_sb);
- OBD_SET_CTXT_MAGIC(&obd->obd_ctxt);
- obd->obd_ctxt.pwdmnt = mnt;
- obd->obd_ctxt.pwd = mnt->mnt_root;
- obd->obd_ctxt.fs = get_ds();
- obd->obd_ctxt.cb_ops = mds_lvfs_ops;
+ OBD_SET_CTXT_MAGIC(&obd->obd_lvfs_ctxt);
+ obd->obd_lvfs_ctxt.pwdmnt = mnt;
+ obd->obd_lvfs_ctxt.pwd = mnt->mnt_root;
+ obd->obd_lvfs_ctxt.fs = get_ds();
+ obd->obd_lvfs_ctxt.cb_ops = mds_lvfs_ops;
/* setup the directory tree */
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
dentry = simple_mkdir(current->fs->pwd, "ROOT", 0755, 0);
if (IS_ERR(dentry)) {
rc = PTR_ERR(dentry);
GOTO(err_lov_objid, rc = -ENOENT);
}
err_pop:
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
return rc;
int mds_fs_cleanup(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int i, rc = 0;
if (obd->obd_fail)
class_disconnect_exports(obd); /* cleans up client info too */
mds_server_free_data(mds);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (mds->mds_rcvd_filp) {
rc = filp_close(mds->mds_rcvd_filp, 0);
mds->mds_rcvd_filp = NULL;
}
up(&mds->mds_quota_info.qi_sem);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
shrink_dcache_parent(mds->mds_fid_de);
dput(mds->mds_fid_de);
DQUOT_OFF(mds->mds_sb);
unsigned int tmpname = ll_insecure_random_int();
struct file *filp;
struct dentry *new_child;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
char fidname[LL_FID_NAMELEN];
void *handle;
- struct obd_ucred ucred;
+ struct lvfs_ucred ucred;
int rc = 0, err, namelen;
ENTRY;
/* the owner of object file should always be root */
memset(&ucred, 0, sizeof(ucred));
- ucred.ouc_cap = current->cap_effective | CAP_SYS_RESOURCE;
+ ucred.luc_cap = current->cap_effective | CAP_SYS_RESOURCE;
- push_ctxt(&saved, &exp->exp_obd->obd_ctxt, &ucred);
+ push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, &ucred);
sprintf(fidname, "OBJECTS/%u.%u", tmpname, current->pid);
filp = filp_open(fidname, O_CREAT | O_EXCL, 0666);
rc = err;
}
out_pop:
- pop_ctxt(&saved, &exp->exp_obd->obd_ctxt, &ucred);
+ pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, &ucred);
RETURN(rc);
}
struct mds_obd *mds = &exp->exp_obd->u.mds;
struct inode *parent_inode = mds->mds_objects_dir->d_inode;
struct obd_device *obd = exp->exp_obd;
- struct obd_run_ctxt saved;
- struct obd_ucred ucred;
+ struct lvfs_run_ctxt saved;
+ struct lvfs_ucred ucred;
char fidname[LL_FID_NAMELEN];
struct dentry *de;
void *handle;
ENTRY;
memset(&ucred, 0, sizeof(ucred));
- ucred.ouc_cap = current->cap_effective | CAP_SYS_RESOURCE;
- push_ctxt(&saved, &obd->obd_ctxt, &ucred);
+ ucred.luc_cap = current->cap_effective | CAP_SYS_RESOURCE;
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, &ucred);
namelen = ll_fid2str(fidname, oa->o_id, oa->o_generation);
l_dput(de);
up(&parent_inode->i_sem);
- pop_ctxt(&saved, &obd->obd_ctxt, &ucred);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &ucred);
RETURN(rc);
}
struct obd_device *obd = exp->exp_obd;
struct mds_obd *mds = &obd->u.mds;
struct obd_ioctl_data *data = karg;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc = 0;
ENTRY;
if (mds->mds_cfg_llh)
RETURN(-EBUSY);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = llog_create(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
&mds->mds_cfg_llh, NULL, name);
if (rc == 0)
&cfg_uuid);
else
mds->mds_cfg_llh = NULL;
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
if (!mds->mds_cfg_llh)
RETURN(-EBADF);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = llog_close(mds->mds_cfg_llh);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
mds->mds_cfg_llh = NULL;
RETURN(rc);
if (mds->mds_cfg_llh)
RETURN(-EBUSY);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = llog_create(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
&mds->mds_cfg_llh, NULL, name);
if (rc == 0) {
rc = llog_destroy(mds->mds_cfg_llh);
llog_free_handle(mds->mds_cfg_llh);
}
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
mds->mds_cfg_llh = NULL;
RETURN(rc);
RETURN(rc);
}
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = llog_write_rec(mds->mds_cfg_llh, &rec, NULL, 0,
cfg_buf, -1);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
OBD_FREE(cfg_buf, data->ioc_plen1);
RETURN(rc);
case OBD_IOC_PARSE: {
struct llog_ctxt *ctxt =
llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = class_config_parse_llog(ctxt, data->ioc_inlbuf1, NULL);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (rc)
RETURN(rc);
case OBD_IOC_DUMP_LOG: {
struct llog_ctxt *ctxt =
llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = class_config_dump_llog(ctxt, data->ioc_inlbuf1, NULL);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (rc)
RETURN(rc);
int rc2;
obd_llog_finish(obd, mds->mds_lov_desc.ld_tgt_count);
- push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
rc = llog_ioctl(ctxt, cmd, data);
- pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
llog_cat_initialize(obd, mds->mds_lov_desc.ld_tgt_count);
rc2 = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"),
"mds_conn", 0, NULL);
struct llog_ctxt *ctxt =
llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
- push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
rc = llog_ioctl(ctxt, cmd, data);
- pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
{
struct obd_device *obd = req->rq_export->exp_obd;
struct mds_body *request_body, *reply_body;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc, size = sizeof(*reply_body);
ENTRY;
RETURN(rc);
reply_body = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*reply_body));
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = mds_open_by_fid(req, &request_body->fid1, reply_body,
request_body->flags, NULL, NULL);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
struct obd_device *obd = req->rq_export->exp_obd;
struct mds_body *body;
struct mds_file_data *mfd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct inode *inode;
int rc, repsize[3] = {sizeof(struct mds_body),
obd->u.mds.mds_max_mdsize,
mds_pack_md(obd, req->rq_repmsg, 1,body,inode,MDS_PACK_MD_LOCK);
}
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
req->rq_status = mds_mfd_close(req, obd, mfd, 1);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (OBD_FAIL_CHECK(OBD_FAIL_MDS_CLOSE_PACK)) {
CERROR("test case OBD_FAIL_MDS_CLOSE_PACK\n");
struct ptlrpc_request *req, struct lustre_handle *lockh)
{
struct obd_device *obd = req->rq_export->exp_obd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc;
ENTRY;
/* checked by unpacker */
LASSERT(rec->ur_opcode < REINT_MAX && reinters[rec->ur_opcode] != NULL);
- push_ctxt(&saved, &obd->obd_ctxt, &rec->ur_uc);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, &rec->ur_uc);
rc = reinters[rec->ur_opcode] (rec, offset, req, lockh);
- pop_ctxt(&saved, &obd->obd_ctxt, &rec->ur_uc);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &rec->ur_uc);
RETURN(rc);
}
int mds_cleanup_orphans(struct obd_device *obd)
{
struct mds_obd *mds = &obd->u.mds;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct file *file;
struct dentry *dchild, *dentry;
struct vfsmount *mnt;
int i = 0, rc = 0, item = 0, namlen;
ENTRY;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
/* dentry and mnt ref dropped in dentry_open() on error, or
* in filp_close() if dentry_open() succeeds */
dentry = dget(mds->mds_pending_dir);
OBD_FREE(dirent, sizeof(*dirent));
}
err_pop:
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (rc == 0)
rc = item;
RETURN(rc);
struct mds_obd *mds = &obd->u.mds;
struct lustre_quota_info *qinfo = &mds->mds_quota_info;
const char *quotafiles[] = LUSTRE_ADMIN_QUOTAFILES;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
char name[64];
int i, rc = 0;
struct dentry *dparent = mds->mds_objects_dir;
ENTRY;
LASSERT(iparent);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
down(&qinfo->qi_sem);
for (i = 0; i < MAXQUOTAS; i++) {
}
up(&qinfo->qi_sem);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
struct mds_obd *mds = &obd->u.mds;
struct lustre_quota_info *qinfo = &mds->mds_quota_info;
const char *quotafiles[] = LUSTRE_ADMIN_QUOTAFILES;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
char name[64];
int i, rc = 0;
struct inode *iparent = mds->mds_objects_dir->d_inode;
ENTRY;
LASSERT(iparent);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
down(&qinfo->qi_sem);
/* open admin quota files and read quotafile info */
}
up(&qinfo->qi_sem);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (rc && rc != -EBUSY) {
down(&qinfo->qi_sem);
GOTO(cleanup, rc);
}
- handle->lgh_file = l_dentry_open(&obd->obd_ctxt, dchild,
+ handle->lgh_file = l_dentry_open(&obd->obd_lvfs_ctxt, dchild,
O_RDWR | O_LARGEFILE);
if (IS_ERR(handle->lgh_file)) {
rc = PTR_ERR(handle->lgh_file);
if (IS_ERR(dchild))
GOTO(cleanup, rc = PTR_ERR(dchild));
cleanup_phase = 2;
- handle->lgh_file = l_dentry_open(&obd->obd_ctxt, dchild,
+ handle->lgh_file = l_dentry_open(&obd->obd_lvfs_ctxt, dchild,
open_flags);
if (IS_ERR(handle->lgh_file))
GOTO(cleanup, rc = PTR_ERR(handle->lgh_file));
if (!strcmp(fdentry->d_parent->d_name.name, "LOGS")) {
struct obd_device *obd = handle->lgh_ctxt->loc_exp->exp_obd;
struct inode *inode = fdentry->d_parent->d_inode;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
dget(fdentry);
rc = llog_lvfs_close(handle);
}
dput(fdentry);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
int llog_get_cat_list(struct obd_device *obd, struct obd_device *disk_obd,
char *name, int count, struct llog_catid *idarray)
{
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct l_file *file;
int rc;
int size = sizeof(*idarray) * count;
LASSERT(count);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
file = filp_open(name, O_RDWR | O_CREAT | O_LARGEFILE, 0700);
if (!file || IS_ERR(file)) {
rc = PTR_ERR(file);
}
out:
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (file && !IS_ERR(file))
rc = filp_close(file, 0);
RETURN(rc);
int llog_put_cat_list(struct obd_device *obd, struct obd_device *disk_obd,
char *name, int count, struct llog_catid *idarray)
{
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct l_file *file;
int rc;
int size = sizeof(*idarray) * count;
LASSERT(count);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
file = filp_open(name, O_RDWR | O_CREAT | O_LARGEFILE, 0700);
if (!file || IS_ERR(file)) {
rc = PTR_ERR(file);
}
out:
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (file && !IS_ERR(file))
rc = filp_close(file, 0);
RETURN(rc);
{
struct llog_ctxt *ctxt;
struct llog_handle *handle;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc;
ENTRY;
GOTO(out, rc);
ctxt->loc_handle = handle;
- push_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
rc = llog_init_handle(handle, LLOG_F_IS_CAT, NULL);
- pop_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
if (rc)
GOTO(out, rc);
static int llog_run_tests(struct obd_device *obd)
{
struct llog_handle *llh;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct llog_ctxt *ctxt = llog_get_context(obd, LLOG_TEST_ORIG_CTXT);
int rc, err, cleanup_phase = 0;
char name[10];
ENTRY;
sprintf(name, "%x", llog_test_rand);
- push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
rc = llog_test_1(obd, name);
if (rc)
if (!rc)
rc = err;
case 0:
- pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
}
return rc;
fed->fed_lr_idx, fed->fed_lr_off, fed->fed_fcd->fcd_uuid);
if (new_client) {
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
loff_t off = fed->fed_lr_off;
int err;
void *handle;
CDEBUG(D_INFO, "writing client fcd at idx %u (%llu) (len %u)\n",
fed->fed_lr_idx,off,(unsigned int)sizeof(*fed->fed_fcd));
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
/* Transaction needed to fix bug 1403 */
handle = fsfilt_start(obd,
filter->fo_rcvd_filp->f_dentry->d_inode,
filter->fo_rcvd_filp->f_dentry->d_inode,
handle, 1);
}
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (err) {
CERROR("error writing %s client idx %u: rc %d\n",
struct filter_obd *filter = &exp->exp_obd->u.filter;
struct obd_device *obd = exp->exp_obd;
struct filter_client_data zero_fcd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc;
loff_t off;
ENTRY;
if (!(exp->exp_flags & OBD_OPT_FAILOVER)) {
memset(&zero_fcd, 0, sizeof zero_fcd);
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = fsfilt_write_record(obd, filter->fo_rcvd_filp, &zero_fcd,
sizeof(zero_fcd), &off, 0);
/* update server's transno */
filter_update_server_data(obd, filter->fo_rcvd_filp,
filter->fo_fsd, 1);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
CDEBUG(rc == 0 ? D_INFO : D_ERROR,
"zeroing out client %s at idx %u (%llu) in %s rc %d\n",
/* setup the object store with correct subdirectories */
static int filter_prep(struct obd_device *obd)
{
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct filter_obd *filter = &obd->u.filter;
struct file *file;
struct inode *inode;
int rc = 0;
ENTRY;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
file = filp_open(LAST_RCVD, O_RDWR | O_CREAT | O_LARGEFILE, 0700);
if (!file || IS_ERR(file)) {
rc = PTR_ERR(file);
GOTO(err_server_data, rc);
out:
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
return(rc);
/* cleanup the filter: write last used object id to status file */
static void filter_post(struct obd_device *obd)
{
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct filter_obd *filter = &obd->u.filter;
int rc, i;
* best to start a transaction with h_sync, because we removed this
* from lastobjid */
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = filter_update_server_data(obd, filter->fo_rcvd_filp,
filter->fo_fsd, 0);
if (rc)
filter_cleanup_groups(obd);
filter_free_server_data(filter);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
}
static void filter_set_last_id(struct filter_obd *filter, struct obdo *oa,
filter->fo_fstype = mnt->mnt_sb->s_type->name;
CDEBUG(D_SUPER, "%s: mnt = %p\n", filter->fo_fstype, mnt);
- OBD_SET_CTXT_MAGIC(&obd->obd_ctxt);
- obd->obd_ctxt.pwdmnt = mnt;
- obd->obd_ctxt.pwd = mnt->mnt_root;
- obd->obd_ctxt.fs = get_ds();
- obd->obd_ctxt.cb_ops = filter_lvfs_ops;
+ OBD_SET_CTXT_MAGIC(&obd->obd_lvfs_ctxt);
+ obd->obd_lvfs_ctxt.pwdmnt = mnt;
+ obd->obd_lvfs_ctxt.pwd = mnt->mnt_root;
+ obd->obd_lvfs_ctxt.fs = get_ds();
+ obd->obd_lvfs_ctxt.cb_ops = filter_lvfs_ops;
rc = filter_prep(obd);
if (rc)
struct lov_stripe_md *md, struct obd_trans_info *oti)
{
struct obd_device *obd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct filter_obd *filter;
struct dentry *dentry;
struct iattr iattr;
iattr_from_obdo(&iattr, oa, oa->o_valid);
- push_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
lock_kernel();
if (oa->o_valid & OBD_MD_FLCOOKIE) {
if (iattr.ia_valid & ATTR_SIZE)
up(&dentry->d_inode->i_sem);
unlock_kernel();
- pop_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
f_dput(dentry);
struct lov_stripe_md **ea, struct obd_trans_info *oti)
{
struct obd_device *obd = NULL;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct lov_stripe_md *lsm = NULL;
obd_gr group = 0;
int rc = 0, diff;
}
obd = exp->exp_obd;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if ((oa->o_valid & OBD_MD_FLFLAGS) &&
(oa->o_flags & OBD_FL_RECREATE_OBJS)) {
}
}
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (rc && ea != NULL && *ea != lsm) {
obd_free_memmd(exp, &lsm);
} else if (rc == 0 && ea != NULL) {
struct obd_device *obd;
struct filter_obd *filter;
struct dentry *dchild = NULL, *dparent = NULL;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
void *handle = NULL;
struct llog_cookie *fcc = NULL;
int rc, rc2, cleanup_phase = 0, have_prepared = 0;
obd = exp->exp_obd;
filter = &obd->u.filter;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
acquire_locks:
dparent = filter_parent_lock(obd, group, oa->o_id);
case 1:
filter_parent_unlock(dparent);
case 0:
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
break;
default:
CERROR("invalid cleanup_phase %d\n", cleanup_phase);
static int filter_sync(struct obd_export *exp, struct obdo *oa,
struct lov_stripe_md *lsm, obd_off start, obd_off end)
{
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct filter_obd *filter;
struct dentry *dentry;
struct llog_ctxt *ctxt;
if (IS_ERR(dentry))
RETURN(PTR_ERR(dentry));
- push_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
down(&dentry->d_inode->i_sem);
rc = filemap_fdatawrite(dentry->d_inode->i_mapping);
oa->o_valid = OBD_MD_FLID;
obdo_from_inode(oa, dentry->d_inode, FILTER_VALID_FLAGS);
- pop_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
f_dput(dentry);
RETURN(rc);
/*
struct llog_ctxt *ctxt = NULL;
- push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
rc = llog_ioctl(ctxt, cmd, data);
- pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
*/
static int filter_quotacheck(struct obd_export *exp, struct obd_quotactl *oqctl)
{
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct obd_device *obd = exp->exp_obd;
int rc;
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = fsfilt_quotacheck(obd, obd->u.filter.fo_sb, oqctl);
if (rc)
CERROR("%s: fsfilt_quotacheck: %d\n", obd->obd_name, rc);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
static int filter_quotactl(struct obd_export *exp, struct obd_quotactl *oqctl)
{
struct obd_device *obd = exp->exp_obd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int rc = 0;
ENTRY;
if (oqctl->qc_cmd == Q_QUOTAON || oqctl->qc_cmd == Q_QUOTAOFF ||
oqctl->qc_cmd == Q_GETOINFO || oqctl->qc_cmd == Q_GETOQUOTA ||
oqctl->qc_cmd == Q_GETQUOTA) {
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
rc = fsfilt_quotactl(obd, obd->u.filter.fo_sb, oqctl);
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
} else if (oqctl->qc_cmd == Q_INITQUOTA) {
unsigned int uid = 0, gid = 0;
struct obd_trans_info *oti)
{
struct obd_device *obd = exp->exp_obd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct niobuf_remote *rnb;
struct niobuf_local *lnb;
struct dentry *dentry = NULL;
memset(res, 0, niocount * sizeof(*res));
- push_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
rc = filter_alloc_iobuf(&obd->u.filter, OBD_BRW_READ, obj->ioo_bufcnt,
&iobuf);
if (iobuf != NULL)
filter_free_iobuf(iobuf);
- pop_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
if (rc)
CERROR("io error %d\n", rc);
struct niobuf_local *res,
struct obd_trans_info *oti)
{
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct niobuf_remote *rnb;
struct niobuf_local *lnb = res;
struct fsfilt_objinfo fso;
GOTO(cleanup, rc);
cleanup_phase = 1;
- push_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
dentry = filter_fid2dentry(exp->exp_obd, NULL, obj->ioo_gr,
obj->ioo_id);
if (IS_ERR(dentry))
if (rc)
filter_free_dio_pages(objcount, obj, niocount, res);
case 3:
- pop_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
filter_free_iobuf(iobuf);
case 2:
if (rc)
if (oa)
filter_grant_incoming(exp, oa);
spin_unlock(&exp->exp_obd->obd_osfs_lock);
- pop_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
filter_free_iobuf(iobuf);
break;
default:;
int rc)
{
struct obd_device *obd = exp->exp_obd;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct niobuf_local *lnb;
struct fsfilt_objinfo fso;
struct iattr iattr = { 0 };
iattr.ia_size = this_size;
}
- push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
cleanup_phase = 2;
down(&inode->i_sem);
switch (cleanup_phase) {
case 2:
- pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
LASSERT(current->journal_info == NULL);
case 1:
filter_free_iobuf(iobuf);
static int filter_quota_enforcement(struct obd_device *obd,
unsigned int fsuid, unsigned int fsgid,
- struct obd_ucred **ret_uc)
+ struct lvfs_ucred **ret_uc)
{
struct filter_obd *filter = &obd->u.filter;
- struct obd_ucred *uc = NULL;
+ struct lvfs_ucred *uc = NULL;
ENTRY;
if (!sb_any_quota_enabled(filter->fo_sb))
RETURN(-ENOMEM);
*ret_uc = uc;
- uc->ouc_fsuid = fsuid;
- uc->ouc_fsgid = fsgid;
- uc->ouc_cap = current->cap_effective;
+ uc->luc_fsuid = fsuid;
+ uc->luc_fsgid = fsgid;
+ uc->luc_cap = current->cap_effective;
if (!fsuid)
- cap_raise(uc->ouc_cap, CAP_SYS_RESOURCE);
+ cap_raise(uc->luc_cap, CAP_SYS_RESOURCE);
else
- cap_lower(uc->ouc_cap, CAP_SYS_RESOURCE);
+ cap_lower(uc->luc_cap, CAP_SYS_RESOURCE);
RETURN(0);
}
{
struct niobuf_local *lnb;
struct dio_request *dreq = NULL;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct fsfilt_objinfo fso;
struct iattr iattr = { 0 };
struct inode *inode = NULL;
int i, err, cleanup_phase = 0;
struct obd_device *obd = exp->exp_obd;
struct filter_obd *filter = &obd->u.filter;
- struct obd_ucred *uc = NULL;
+ struct lvfs_ucred *uc = NULL;
int total_size = 0;
ENTRY;
/* The client store the user credit information fsuid and fsgid
* in oa->o_uid and oa->o_gid. In case of quota enabled, we use
- * them to build the obd_ucred so as to enforce oss quota check */
+ * them to build the lvfs_ucred so as to enforce oss quota check */
rc = filter_quota_enforcement(obd, oa->o_uid, oa->o_gid, &uc);
if (rc)
GOTO(cleanup, rc);
- push_ctxt(&saved, &obd->obd_ctxt, uc);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, uc);
cleanup_phase = 2;
down(&inode->i_sem);
switch (cleanup_phase) {
case 2:
- pop_ctxt(&saved, &obd->obd_ctxt, uc);
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, uc);
if (uc)
OBD_FREE(uc, sizeof(*uc));
LASSERT(current->journal_info == NULL);
* at present. And we chose one page's user credit information as
* the whole rpc's credit information. FIXME */
if (cmd == OBD_BRW_WRITE) {
- struct obd_ucred ouc;
+ struct lvfs_ucred ouc;
ops->ap_get_ucred(caller_data, &ouc);
- oa->o_uid = ouc.ouc_fsuid;
- oa->o_gid = ouc.ouc_fsgid;
+ oa->o_uid = ouc.luc_fsuid;
+ oa->o_gid = ouc.luc_fsgid;
}
sort_brw_pages(pga, page_count);
struct obd_device *disk_obd;
struct llog_handle *loghandle;
struct llogd_body *body;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct llog_logid *logid = NULL;
struct llog_ctxt *ctxt;
char * name = NULL;
if (ctxt == NULL)
GOTO(out, rc = -EINVAL);
disk_obd = ctxt->loc_exp->exp_obd;
- push_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
rc = llog_create(ctxt, &loghandle, logid, name);
if (rc)
if (!rc)
rc = rc2;
out_pop:
- pop_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
out:
RETURN(rc);
}
struct obd_device *disk_obd;
struct llog_handle *loghandle;
struct llogd_body *body;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct llog_ctxt *ctxt;
__u32 flags;
__u8 *buf;
if (ctxt == NULL)
GOTO(out, rc = -EINVAL);
disk_obd = ctxt->loc_exp->exp_obd;
- push_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
if (rc)
rc = rc2;
out_pop:
- pop_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
OBD_FREE(buf, LLOG_CHUNK_SIZE);
out:
RETURN(rc);
struct llog_handle *loghandle;
struct llogd_body *body;
struct llog_log_hdr *hdr;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct llog_ctxt *ctxt;
__u32 flags;
int size[] = {sizeof (*hdr)};
if (ctxt == NULL)
GOTO(out, rc = -EINVAL);
disk_obd = ctxt->loc_exp->exp_obd;
- push_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
if (rc)
rc = rc2;
out_pop:
- pop_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
out:
RETURN(rc);
struct llog_cookie *logcookies;
struct llog_ctxt *ctxt;
int num_cookies, rc = 0, err, i;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct llog_handle *cathandle;
struct inode *inode;
void *handle;
}
disk_obd = ctxt->loc_exp->exp_obd;
- push_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
for (i = 0; i < num_cookies; i++, logcookies++) {
cathandle = ctxt->loc_handle;
LASSERT(cathandle != NULL);
}
}
pop_ctxt:
- pop_ctxt(&saved, &disk_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
if (rc)
CERROR("cancel %d llog-records failed: %d\n", num_cookies, rc);
else
{
struct mds_obd *mds = &obd->u.mds;
struct llog_ctxt *ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
struct llog_handle *handle = NULL;
char name[4][64];
int rc, i, l, remains = buf_len;
if (ctxt == NULL || mds == NULL)
RETURN(-EOPNOTSUPP);
- push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
sprintf(name[0], "%s", mds->mds_profile);
sprintf(name[1], "%s-clean", mds->mds_profile);
break;
}
out_pop:
- pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
{
struct mds_obd *mds = &obd->u.mds;
struct llog_handle *handle;
- struct obd_run_ctxt saved;
+ struct lvfs_run_ctxt saved;
int size, i, count;
struct llog_catid *idarray;
struct llog_logid *id;
if (rc)
GOTO(out_free, rc);
- push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
data.ctxt = ctxt;
data.out = buf;
break;
}
out_pop:
- pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
out_free:
OBD_FREE(idarray, size);
RETURN(rc);