From dbcb15c723e31435cd825d2378bc3fc1867ac676 Mon Sep 17 00:00:00 2001 From: wangdi Date: Mon, 4 Sep 2006 07:14:49 +0000 Subject: [PATCH] Branch: b_new_cmd 1)remove writepage/sendpage moo ops 2)comment some sanity check in mkfs_lustre for cmd. --- lustre/cmm/cmm_split.c | 4 ++-- lustre/cmm/mdc_internal.h | 5 +++++ lustre/cmm/mdc_object.c | 12 ++++-------- lustre/include/lustre_mdc.h | 4 ++++ lustre/include/md_object.h | 23 +---------------------- lustre/include/obd.h | 5 +---- lustre/include/obd_class.h | 14 -------------- lustre/mdc/mdc_request.c | 4 +--- lustre/utils/mkfs_lustre.c | 8 ++++++-- 9 files changed, 24 insertions(+), 55 deletions(-) diff --git a/lustre/cmm/cmm_split.c b/lustre/cmm/cmm_split.c index 00ba740..1b4e9e4 100644 --- a/lustre/cmm/cmm_split.c +++ b/lustre/cmm/cmm_split.c @@ -208,8 +208,8 @@ static int cmm_send_split_pages(const struct lu_context *ctx, RETURN(PTR_ERR(obj)); for (i = 0; i < rdpg->rp_npages; i++) { - rc = mo_sendpage(ctx, md_object_next(&obj->cmo_obj), - rdpg->rp_pages[i]); + rc = mdc_send_page(ctx, md_object_next(&obj->cmo_obj), + rdpg->rp_pages[i]); if (rc) GOTO(cleanup, rc); } diff --git a/lustre/cmm/mdc_internal.h b/lustre/cmm/mdc_internal.h index bb8e4a0..13886ed 100644 --- a/lustre/cmm/mdc_internal.h +++ b/lustre/cmm/mdc_internal.h @@ -95,5 +95,10 @@ static inline struct mdc_device *lu2mdc_dev(struct lu_device *ld) struct lu_object *mdc_object_alloc(const struct lu_context *, const struct lu_object_header *, struct lu_device *); +#ifdef HAVE_SPLIT_SUPPORT +int mdc_send_page(const struct lu_context *ctx, struct md_object *mo, + const struct page *page) +#endif + #endif /* __KERNEL__ */ #endif /* _CMM_MDC_INTERNAL_H */ diff --git a/lustre/cmm/mdc_object.c b/lustre/cmm/mdc_object.c index 491b31e..76c06f8 100644 --- a/lustre/cmm/mdc_object.c +++ b/lustre/cmm/mdc_object.c @@ -237,16 +237,15 @@ static int mdc_ref_del(const struct lu_context *ctx, struct md_object *mo, } #ifdef HAVE_SPLIT_SUPPORT -static int mdc_sendpage(const struct lu_context *ctx, struct md_object *mo, - const struct page *page) +int mdc_send_page(const struct lu_context *ctx, struct md_object *mo, + const struct page *page) { struct mdc_device *mc = md2mdc_dev(md_obj2dev(mo)); int rc; ENTRY; - rc = md_sendpage(mc->mc_desc.cl_exp, lu_object_fid(&mo->mo_lu), - page); - + rc = mdc_sendpage(mc->mc_desc.cl_exp, lu_object_fid(&mo->mo_lu), + page); RETURN(rc); } #endif @@ -255,9 +254,6 @@ static struct md_object_operations mdc_mo_ops = { .moo_object_create = mdc_object_create, .moo_ref_add = mdc_ref_add, .moo_ref_del = mdc_ref_del, -#ifdef HAVE_SPLIT_SUPPORT - .moo_sendpage = mdc_sendpage, -#endif }; /* md_dir_operations */ diff --git a/lustre/include/lustre_mdc.h b/lustre/include/lustre_mdc.h index a061942..8273421 100644 --- a/lustre/include/lustre_mdc.h +++ b/lustre/include/lustre_mdc.h @@ -35,4 +35,8 @@ int it_disposition(struct lookup_intent *it, int flag); void it_clear_disposition(struct lookup_intent *it, int flag); void it_set_disposition(struct lookup_intent *it, int flag); int it_open_error(int phase, struct lookup_intent *it); +#ifdef HAVE_SPLIT_SUPPORT +int mdc_sendpage(struct obd_export *exp, const struct lu_fid *fid, + const struct page *page); +#endif #endif diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index ab0605b..8c1dd40 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -111,12 +111,7 @@ struct md_object_operations { int (*moo_readpage)(const struct lu_context *, struct md_object *, const struct lu_rdpg *); -#ifdef HAVE_SPLIT_SUPPORT - int (*moo_writepage)(const struct lu_context *, struct md_object *, - const struct page *page); - int (*moo_sendpage)(const struct lu_context *, struct md_object *, - const struct page*); -#endif + int (*moo_readlink)(const struct lu_context *ctxt, struct md_object *obj, void *buf, int buf_len); @@ -324,22 +319,6 @@ static inline int mo_readpage(const struct lu_context *cx, struct md_object *m, return m->mo_ops->moo_readpage(cx, m, rdpg); } -#ifdef HAVE_SPLIT_SUPPORT -static inline int mo_writepage(const struct lu_context *cx, struct md_object *m, - const struct page *pg) -{ - LASSERT(m->mo_ops->moo_writepage); - return m->mo_ops->moo_writepage(cx, m, pg); -} - -static inline int mo_sendpage(const struct lu_context *cx, struct md_object *m, - const struct page *pg) -{ - LASSERT(m->mo_ops->moo_sendpage); - return m->mo_ops->moo_sendpage(cx, m, pg); -} -#endif - static inline int mo_object_create(const struct lu_context *cx, struct md_object *m, const struct md_create_spec *spc, diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 5abc211..20feb62 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -1126,10 +1126,7 @@ struct md_ops { struct ptlrpc_request **); int (*m_readpage)(struct obd_export *, const struct lu_fid *, __u64, struct page *, struct ptlrpc_request **); -#ifdef HAVE_SPLIT_SUPPORT - int (*m_sendpage)(struct obd_export *, const struct lu_fid *, - const struct page *); -#endif + int (*m_unlink)(struct obd_export *, struct md_op_data *, struct ptlrpc_request **); diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 216a927..7e36cbb 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -1751,20 +1751,6 @@ static inline int md_readpage(struct obd_export *exp, RETURN(rc); } -#ifdef HAVE_SPLIT_SUPPORT -static inline int md_sendpage(struct obd_export *exp, - const struct lu_fid *fid, - const struct page *page) -{ - int rc; - ENTRY; - EXP_CHECK_MD_OP(exp, sendpage); - MD_COUNTER_INCREMENT(exp->exp_obd, sendpage); - rc = MDP(exp->exp_obd, sendpage)(exp, fid, page); - RETURN(rc); -} -#endif - static inline int md_unlink(struct obd_export *exp, struct md_op_data *op_data, struct ptlrpc_request **request) { diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index d754d82..c1fa898 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -762,6 +762,7 @@ out: ptlrpc_req_finished(req); RETURN(rc); } +EXPORT_SYMBOL(mdc_sendpage); #endif int mdc_readpage(struct obd_export *exp, const struct lu_fid *fid, @@ -1410,9 +1411,6 @@ struct md_ops mdc_md_ops = { .m_getxattr = mdc_getxattr, .m_sync = mdc_sync, .m_readpage = mdc_readpage, -#ifdef HAVE_SPLIT_SUPPORT - .m_sendpage = mdc_sendpage, -#endif .m_unlink = mdc_unlink, .m_cancel_unused = mdc_cancel_unused, .m_init_ea_size = mdc_init_ea_size, diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 412db4e..4fa872b 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -1440,19 +1440,23 @@ int main(int argc, char *argv[]) ret = EINVAL; goto out; } - +#if 0 + /* + * Comment out these 2 checks temporarily, since for multi-MDSes + * in single node only 1 mds node could have mgs service + */ if (IS_MDT(ldd) && !IS_MGS(ldd) && (mop.mo_mgs_failnodes == 0)) { verrprint("No management node specified, adding MGS to this " "MDT\n"); ldd->ldd_flags |= LDD_F_SV_TYPE_MGS; } - if (!IS_MGS(ldd) && (mop.mo_mgs_failnodes == 0)) { fatal(); fprintf(stderr, "Must specify either --mgs or --mgsnode\n"); ret = EINVAL; goto out; } +#endif /* These are the permanent mount options (always included) */ switch (ldd->ldd_mount_type) { -- 1.8.3.1