From 08127b0f6d856746bb0a8cd4a936c7a80ff31efa Mon Sep 17 00:00:00 2001 From: green Date: Thu, 9 Jun 2005 18:47:45 +0000 Subject: [PATCH] Branch: b1_4 Make diff between b1_4 and b_cray smaller Change struct names: obd_run_ctxt -> obd_lvfs_ctxt obd_ucred -> lvfs_ucred lvfs_ucred struct members now start with luc_, not ouc_ sturct obd_device's obd_ctxt is now obd_lvfs_ctxt --- lustre/include/linux/lustre_mds.h | 14 +++---- lustre/include/linux/lvfs.h | 28 ++++++------- lustre/include/linux/lvfs_linux.h | 4 +- lustre/include/linux/obd.h | 4 +- lustre/include/linux/obd_class.h | 2 +- lustre/ldiskfs/quotafmt_test.c | 18 ++++----- lustre/liblustre/rw.c | 10 ++--- lustre/llite/llite_internal.h | 2 +- lustre/llite/rw.c | 10 ++--- lustre/lov/lov_obd.c | 2 +- lustre/lvfs/lvfs_common.c | 2 +- lustre/lvfs/lvfs_linux.c | 58 +++++++++++++-------------- lustre/lvfs/lvfs_userfs.c | 8 ++-- lustre/lvfs/quotactl_test.c | 6 +-- lustre/mds/handler.c | 82 +++++++++++++++++++-------------------- lustre/mds/mds_fs.c | 54 +++++++++++++------------- lustre/mds/mds_lov.c | 34 ++++++++-------- lustre/mds/mds_open.c | 12 +++--- lustre/mds/mds_reint.c | 6 +-- lustre/mds/mds_unlink_open.c | 6 +-- lustre/mds/quota_master.c | 12 +++--- lustre/obdclass/llog_lvfs.c | 22 +++++------ lustre/obdclass/llog_obd.c | 6 +-- lustre/obdclass/llog_test.c | 6 +-- lustre/obdfilter/filter.c | 74 +++++++++++++++++------------------ lustre/obdfilter/filter_io.c | 14 +++---- lustre/obdfilter/filter_io_24.c | 6 +-- lustre/obdfilter/filter_io_26.c | 24 ++++++------ lustre/osc/osc_request.c | 6 +-- lustre/ptlrpc/llog_server.c | 36 ++++++++--------- 30 files changed, 284 insertions(+), 284 deletions(-) diff --git a/lustre/include/linux/lustre_mds.h b/lustre/include/linux/lustre_mds.h index 301a90c..b3b23e8 100644 --- a/lustre/include/linux/lustre_mds.h +++ b/lustre/include/linux/lustre_mds.h @@ -68,19 +68,19 @@ struct mds_update_record { 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 diff --git a/lustre/include/linux/lvfs.h b/lustre/include/linux/lvfs.h index e645441..f5e0fef 100644 --- a/lustre/include/linux/lvfs.h +++ b/lustre/include/linux/lvfs.h @@ -37,13 +37,13 @@ #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 { @@ -52,11 +52,11 @@ 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 @@ -71,12 +71,12 @@ struct obd_run_ctxt { #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__ diff --git a/lustre/include/linux/lvfs_linux.h b/lustre/include/linux/lvfs_linux.h index cf73d47..fdcaa31 100644 --- a/lustre/include/linux/lvfs_linux.h +++ b/lustre/include/linux/lvfs_linux.h @@ -17,8 +17,8 @@ #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 { diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index fde4fb1..c2b72b3 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -130,7 +130,7 @@ struct obd_async_page_ops { 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 @@ -524,7 +524,7 @@ struct obd_device { 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; diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index a8c048f..c24c01b 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -580,7 +580,7 @@ obd_lvfs_fid2dentry(struct obd_export *exp, __u64 id_ino, __u32 gen, __u64 gr) { 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); } diff --git a/lustre/ldiskfs/quotafmt_test.c b/lustre/ldiskfs/quotafmt_test.c index 6c354bb..8a89e98 100644 --- a/lustre/ldiskfs/quotafmt_test.c +++ b/lustre/ldiskfs/quotafmt_test.c @@ -19,19 +19,19 @@ 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); @@ -42,7 +42,7 @@ static int quotfmt_initialize(struct lustre_quota_info *lqi, struct obd_device * /* 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)) @@ -77,10 +77,10 @@ static int quotfmt_initialize(struct lustre_quota_info *lqi, struct obd_device * } 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; @@ -97,7 +97,7 @@ static int quotfmt_finalize(struct lustre_quota_info *lqi, struct obd_device *tg /* 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", @@ -115,7 +115,7 @@ dput: up(&parent_inode->i_sem); } - pop_ctxt(saved, &tgt->obd_ctxt, NULL); + pop_ctxt(saved, &tgt->obd_lvfs_ctxt, NULL); RETURN(rc); } @@ -337,7 +337,7 @@ static int quotfmt_test_4(struct lustre_quota_info *lqi) 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; diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index 41c43d6..81e9c1a 100644 --- a/lustre/liblustre/rw.c +++ b/lustre/liblustre/rw.c @@ -356,7 +356,7 @@ static void llu_ap_completion(void *data, int cmd, struct obdo *oa, int rc) 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; @@ -364,11 +364,11 @@ static void llu_ap_get_ucred(void *data, struct obd_ucred *ouc) 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; } diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index cc12454..73532dd 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -226,7 +226,7 @@ struct ll_async_page { 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; }; diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 6656219..10c5f28 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -389,7 +389,7 @@ static void ll_ap_fill_obdo(void *data, int cmd, struct obdo *oa) 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; @@ -726,11 +726,11 @@ int ll_commit_write(struct file *file, struct page *page, unsigned from, 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 */ diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 9fd2370..e8b5492 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -1336,7 +1336,7 @@ static void lov_ap_completion(void *data, int cmd, struct obdo *oa, int rc) 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); diff --git a/lustre/lvfs/lvfs_common.c b/lustre/lvfs/lvfs_common.c index c1a6640..d8ab4a3 100644 --- a/lustre/lvfs/lvfs_common.c +++ b/lustre/lvfs/lvfs_common.c @@ -27,7 +27,7 @@ #include -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); diff --git a/lustre/lvfs/lvfs_linux.c b/lustre/lvfs/lvfs_linux.c index 054e6ec..58dd545 100644 --- a/lustre/lvfs/lvfs_linux.c +++ b/lustre/lvfs/lvfs_linux.c @@ -73,8 +73,8 @@ int obd_memmax; #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); @@ -97,7 +97,7 @@ void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx, 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); @@ -105,26 +105,26 @@ void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx, 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 } @@ -145,8 +145,8 @@ void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx, } 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); @@ -172,14 +172,14 @@ void pop_ctxt(struct obd_run_ctxt *saved, struct obd_run_ctxt *new_ctx, 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; } /* @@ -338,7 +338,7 @@ int lustre_fsync(struct file *file) } 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); diff --git a/lustre/lvfs/lvfs_userfs.c b/lustre/lvfs/lvfs_userfs.c index cbdb254..a6140d5 100644 --- a/lustre/lvfs/lvfs_userfs.c +++ b/lustre/lvfs/lvfs_userfs.c @@ -31,14 +31,14 @@ #include /* 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(); } diff --git a/lustre/lvfs/quotactl_test.c b/lustre/lvfs/quotactl_test.c index 06984c9..898437e 100644 --- a/lustre/lvfs/quotactl_test.c +++ b/lustre/lvfs/quotactl_test.c @@ -269,7 +269,7 @@ static int quotactl_test_4(struct obd_device *obd, struct super_block *sb) 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; @@ -282,7 +282,7 @@ static int quotactl_run_tests(struct obd_device *obd, struct obd_device *tgt) 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) @@ -301,7 +301,7 @@ static int quotactl_run_tests(struct obd_device *obd, struct obd_device *tgt) cleanup: quotactl_test_4(tgt, sb); - pop_ctxt(&saved, &tgt->obd_ctxt, NULL); + pop_ctxt(&saved, &tgt->obd_lvfs_ctxt, NULL); return rc; } diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 03cc3e7..7496d54 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -322,7 +322,7 @@ static int mds_destroy_export(struct obd_export *export) { 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; @@ -332,7 +332,7 @@ static int mds_destroy_export(struct obd_export *export) 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)) { @@ -362,7 +362,7 @@ static int mds_destroy_export(struct obd_export *export) 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); @@ -664,10 +664,10 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req, { 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; @@ -700,12 +700,12 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req, 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); @@ -796,7 +796,7 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req, } l_dput(dchild); case 1: - pop_ctxt(&saved, &obd->obd_ctxt, &uc); + pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc); default: ; } return rc; @@ -806,10 +806,10 @@ static int mds_getattr(int offset, struct ptlrpc_request *req) { 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; @@ -820,10 +820,10 @@ static int mds_getattr(int offset, struct ptlrpc_request *req) 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); @@ -841,7 +841,7 @@ static int mds_getattr(int offset, struct ptlrpc_request *req) 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; } @@ -948,9 +948,9 @@ static int mds_readpage(struct ptlrpc_request *req) 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)) @@ -966,10 +966,10 @@ static int mds_readpage(struct ptlrpc_request *req) 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)); @@ -1008,7 +1008,7 @@ static int mds_readpage(struct ptlrpc_request *req) 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); @@ -1045,7 +1045,7 @@ static int mds_quotacheck_thread(void *data) 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(); @@ -1065,13 +1065,13 @@ static int mds_quotacheck_thread(void *data) 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); @@ -1138,7 +1138,7 @@ static int mds_quotactl(struct ptlrpc_request *req) { 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; @@ -1197,9 +1197,9 @@ static int mds_quotactl(struct ptlrpc_request *req) 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 += @@ -1613,12 +1613,12 @@ int mds_update_server_data(struct obd_device *obd, int force_sync) 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", @@ -1626,7 +1626,7 @@ int mds_update_server_data(struct obd_device *obd, int force_sync) 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); } @@ -1801,16 +1801,16 @@ static int mds_postsetup(struct obd_device *obd) 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; @@ -1914,7 +1914,7 @@ int mds_lov_clean(struct obd_device *obd) 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); @@ -1923,10 +1923,10 @@ int mds_lov_clean(struct obd_device *obd) 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); diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 78044f5..d6be9cd 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -107,15 +107,15 @@ int mds_client_add(struct obd_device *obd, struct mds_obd *mds, 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; @@ -132,7 +132,7 @@ int mds_client_free(struct obd_export *exp) 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; @@ -169,10 +169,10 @@ int mds_client_free(struct obd_export *exp) 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", @@ -395,7 +395,7 @@ err_msd: 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; @@ -410,14 +410,14 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) 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); @@ -504,7 +504,7 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) 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; @@ -531,7 +531,7 @@ err_fid: 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) @@ -541,7 +541,7 @@ int mds_fs_cleanup(struct obd_device *obd) 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; @@ -577,7 +577,7 @@ int mds_fs_cleanup(struct obd_device *obd) } 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); @@ -596,18 +596,18 @@ int mds_obd_create(struct obd_export *exp, struct obdo *oa, 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); @@ -671,7 +671,7 @@ out_close: 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); } @@ -681,8 +681,8 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa, 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; @@ -690,8 +690,8 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa, 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); @@ -731,6 +731,6 @@ out_dput: 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); } diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 291acd9..c815962 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -293,7 +293,7 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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; @@ -305,7 +305,7 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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) @@ -313,7 +313,7 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, &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); } @@ -322,9 +322,9 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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); @@ -335,7 +335,7 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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) { @@ -345,7 +345,7 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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); @@ -377,10 +377,10 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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); @@ -389,9 +389,9 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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); @@ -401,9 +401,9 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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); @@ -448,9 +448,9 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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); @@ -463,9 +463,9 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, 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); } diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 5037d3d..e1697b4 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -788,7 +788,7 @@ int mds_pin(struct ptlrpc_request *req) { 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; @@ -799,10 +799,10 @@ int mds_pin(struct ptlrpc_request *req) 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); } @@ -1329,7 +1329,7 @@ int mds_close(struct ptlrpc_request *req) 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, @@ -1380,9 +1380,9 @@ int mds_close(struct ptlrpc_request *req) 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"); diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 5b9655a..2ed7348 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -2073,16 +2073,16 @@ int mds_reint_rec(struct mds_update_record *rec, int offset, 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); } diff --git a/lustre/mds/mds_unlink_open.c b/lustre/mds/mds_unlink_open.c index 6cd750d..3aec0e9 100644 --- a/lustre/mds/mds_unlink_open.c +++ b/lustre/mds/mds_unlink_open.c @@ -161,7 +161,7 @@ out_free_lmm: 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; @@ -173,7 +173,7 @@ int mds_cleanup_orphans(struct obd_device *obd) 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); @@ -250,7 +250,7 @@ err_out: 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); diff --git a/lustre/mds/quota_master.c b/lustre/mds/quota_master.c index d1c8797..5346ddc 100644 --- a/lustre/mds/quota_master.c +++ b/lustre/mds/quota_master.c @@ -330,7 +330,7 @@ int init_admin_quotafiles(struct obd_device *obd, struct obd_quotactl *oqctl) 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; @@ -338,7 +338,7 @@ int init_admin_quotafiles(struct obd_device *obd, struct obd_quotactl *oqctl) 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++) { @@ -400,7 +400,7 @@ int init_admin_quotafiles(struct obd_device *obd, struct obd_quotactl *oqctl) } up(&qinfo->qi_sem); - pop_ctxt(&saved, &obd->obd_ctxt, NULL); + pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); RETURN(rc); } @@ -409,14 +409,14 @@ int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl) 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 */ @@ -450,7 +450,7 @@ int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl) } 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); diff --git a/lustre/obdclass/llog_lvfs.c b/lustre/obdclass/llog_lvfs.c index 6e82aaa..d9db59b 100644 --- a/lustre/obdclass/llog_lvfs.c +++ b/lustre/obdclass/llog_lvfs.c @@ -486,7 +486,7 @@ static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res, 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); @@ -525,7 +525,7 @@ static int llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res, 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)); @@ -572,9 +572,9 @@ static int llog_lvfs_destroy(struct llog_handle *handle) 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); @@ -585,7 +585,7 @@ static int llog_lvfs_destroy(struct llog_handle *handle) } dput(fdentry); - pop_ctxt(&saved, &obd->obd_ctxt, NULL); + pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); RETURN(rc); } @@ -612,7 +612,7 @@ static int llog_lvfs_destroy(struct llog_handle *handle) 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; @@ -620,7 +620,7 @@ int llog_get_cat_list(struct obd_device *obd, struct obd_device *disk_obd, 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); @@ -643,7 +643,7 @@ int llog_get_cat_list(struct obd_device *obd, struct obd_device *disk_obd, } 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); @@ -654,7 +654,7 @@ EXPORT_SYMBOL(llog_get_cat_list); 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; @@ -662,7 +662,7 @@ int llog_put_cat_list(struct obd_device *obd, struct obd_device *disk_obd, 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); @@ -685,7 +685,7 @@ int llog_put_cat_list(struct obd_device *obd, struct obd_device *disk_obd, } 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); diff --git a/lustre/obdclass/llog_obd.c b/lustre/obdclass/llog_obd.c index bf82dfd..ca5144c 100644 --- a/lustre/obdclass/llog_obd.c +++ b/lustre/obdclass/llog_obd.c @@ -181,7 +181,7 @@ int llog_obd_origin_setup(struct obd_device *obd, int index, { struct llog_ctxt *ctxt; struct llog_handle *handle; - struct obd_run_ctxt saved; + struct lvfs_run_ctxt saved; int rc; ENTRY; @@ -205,9 +205,9 @@ int llog_obd_origin_setup(struct obd_device *obd, int index, 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); diff --git a/lustre/obdclass/llog_test.c b/lustre/obdclass/llog_test.c index e694153..2d5e7b6 100644 --- a/lustre/obdclass/llog_test.c +++ b/lustre/obdclass/llog_test.c @@ -529,14 +529,14 @@ static int llog_test_7(struct obd_device *obd) 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) @@ -576,7 +576,7 @@ static int llog_run_tests(struct obd_device *obd) 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; diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index dcfc65a..4499f86 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -190,7 +190,7 @@ static int filter_client_add(struct obd_device *obd, struct filter_obd *filter, 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; @@ -198,7 +198,7 @@ static int filter_client_add(struct obd_device *obd, struct filter_obd *filter, 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, @@ -215,7 +215,7 @@ static int filter_client_add(struct obd_device *obd, struct filter_obd *filter, 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", @@ -232,7 +232,7 @@ static int filter_client_free(struct obd_export *exp) 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; @@ -269,7 +269,7 @@ static int filter_client_free(struct obd_export *exp) 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); @@ -277,7 +277,7 @@ static int filter_client_free(struct obd_export *exp) /* 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", @@ -757,14 +757,14 @@ static int filter_prep_groups(struct obd_device *obd) /* 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); @@ -797,7 +797,7 @@ static int filter_prep(struct obd_device *obd) GOTO(err_server_data, rc); out: - pop_ctxt(&saved, &obd->obd_ctxt, NULL); + pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); return(rc); @@ -814,7 +814,7 @@ static int filter_prep(struct obd_device *obd) /* 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; @@ -822,7 +822,7 @@ static void filter_post(struct obd_device *obd) * 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) @@ -842,7 +842,7 @@ static void filter_post(struct obd_device *obd) 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, @@ -1246,11 +1246,11 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf, 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) @@ -1780,7 +1780,7 @@ int filter_setattr(struct obd_export *exp, struct obdo *oa, 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; @@ -1802,7 +1802,7 @@ int filter_setattr(struct obd_export *exp, struct obdo *oa, 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) { @@ -1871,7 +1871,7 @@ out_unlock: 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); @@ -2222,7 +2222,7 @@ static int filter_create(struct obd_export *exp, struct obdo *oa, 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; @@ -2243,7 +2243,7 @@ static int filter_create(struct obd_export *exp, struct obdo *oa, } 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)) { @@ -2265,7 +2265,7 @@ static int filter_create(struct obd_export *exp, struct obdo *oa, } } - 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) { @@ -2286,7 +2286,7 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa, 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; @@ -2299,7 +2299,7 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa, 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); @@ -2381,7 +2381,7 @@ cleanup: 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); @@ -2422,7 +2422,7 @@ static int filter_truncate(struct obd_export *exp, struct obdo *oa, 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; @@ -2444,7 +2444,7 @@ static int filter_sync(struct obd_export *exp, struct obdo *oa, 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); @@ -2464,7 +2464,7 @@ static int filter_sync(struct obd_export *exp, struct obdo *oa, 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); @@ -2598,9 +2598,9 @@ int filter_iocontrol(unsigned int cmd, struct obd_export *exp, /* 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); */ @@ -2615,17 +2615,17 @@ int filter_iocontrol(unsigned int cmd, struct obd_export *exp, 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); } @@ -2633,16 +2633,16 @@ static int filter_quotacheck(struct obd_export *exp, struct obd_quotactl *oqctl) 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; diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index 988e0bf..88e2dfa 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -272,7 +272,7 @@ static int filter_preprw_read(int cmd, struct obd_export *exp, struct obdo *oa, 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; @@ -297,7 +297,7 @@ static int filter_preprw_read(int cmd, struct obd_export *exp, struct obdo *oa, 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); @@ -375,7 +375,7 @@ static int filter_preprw_read(int cmd, struct obd_export *exp, struct obdo *oa, 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); @@ -512,7 +512,7 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa, 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; @@ -534,7 +534,7 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa, 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)) @@ -649,7 +649,7 @@ cleanup: 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) @@ -660,7 +660,7 @@ cleanup: 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:; diff --git a/lustre/obdfilter/filter_io_24.c b/lustre/obdfilter/filter_io_24.c index 1fca494..b131b0e 100644 --- a/lustre/obdfilter/filter_io_24.c +++ b/lustre/obdfilter/filter_io_24.c @@ -358,7 +358,7 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount, 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 }; @@ -405,7 +405,7 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount, 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); @@ -445,7 +445,7 @@ cleanup: 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); diff --git a/lustre/obdfilter/filter_io_26.c b/lustre/obdfilter/filter_io_26.c index f8e29b0..bf3d22b 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -405,10 +405,10 @@ static int filter_clear_page_cache(struct inode *inode, 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)) @@ -419,13 +419,13 @@ static int filter_quota_enforcement(struct obd_device *obd, 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); } @@ -577,7 +577,7 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, { 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; @@ -585,7 +585,7 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, 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; @@ -637,12 +637,12 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, /* 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); @@ -690,7 +690,7 @@ cleanup: 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); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index de285be..37a44af 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1430,10 +1430,10 @@ static struct ptlrpc_request *osc_build_req(struct client_obd *cli, * 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); diff --git a/lustre/ptlrpc/llog_server.c b/lustre/ptlrpc/llog_server.c index a038d8a..5c7af41 100644 --- a/lustre/ptlrpc/llog_server.c +++ b/lustre/ptlrpc/llog_server.c @@ -50,7 +50,7 @@ int llog_origin_handle_create(struct ptlrpc_request *req) 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; @@ -81,7 +81,7 @@ int llog_origin_handle_create(struct ptlrpc_request *req) 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) @@ -99,7 +99,7 @@ out_close: 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); } @@ -111,7 +111,7 @@ int llog_origin_handle_next_block(struct ptlrpc_request *req) 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; @@ -136,7 +136,7 @@ int llog_origin_handle_next_block(struct ptlrpc_request *req) 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) @@ -171,7 +171,7 @@ out_close: 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); @@ -185,7 +185,7 @@ int llog_origin_handle_read_header(struct ptlrpc_request *req) 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)}; @@ -203,7 +203,7 @@ int llog_origin_handle_read_header(struct ptlrpc_request *req) 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) @@ -228,7 +228,7 @@ out_close: rc = rc2; out_pop: - pop_ctxt(&saved, &disk_obd->obd_ctxt, NULL); + pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL); out: RETURN(rc); @@ -250,7 +250,7 @@ int llog_origin_handle_cancel(struct ptlrpc_request *req) 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; @@ -270,7 +270,7 @@ int llog_origin_handle_cancel(struct ptlrpc_request *req) } 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); @@ -294,7 +294,7 @@ int llog_origin_handle_cancel(struct ptlrpc_request *req) } } 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 @@ -309,7 +309,7 @@ static int llog_catinfo_config(struct obd_device *obd, char *buf, int buf_len, { 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; @@ -318,7 +318,7 @@ static int llog_catinfo_config(struct obd_device *obd, char *buf, int 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); @@ -354,7 +354,7 @@ static int llog_catinfo_config(struct obd_device *obd, char *buf, int buf_len, 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); } @@ -426,7 +426,7 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *buf, { 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; @@ -449,7 +449,7 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *buf, 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; @@ -487,7 +487,7 @@ static int llog_catinfo_deletions(struct obd_device *obd, char *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); -- 1.8.3.1