Whamcloud - gitweb
Branch: b_new_cmd
authorwangdi <wangdi>
Mon, 4 Sep 2006 07:14:49 +0000 (07:14 +0000)
committerwangdi <wangdi>
Mon, 4 Sep 2006 07:14:49 +0000 (07:14 +0000)
1)remove writepage/sendpage moo ops
2)comment some sanity check in mkfs_lustre for cmd.

lustre/cmm/cmm_split.c
lustre/cmm/mdc_internal.h
lustre/cmm/mdc_object.c
lustre/include/lustre_mdc.h
lustre/include/md_object.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/mdc/mdc_request.c
lustre/utils/mkfs_lustre.c

index 00ba740..1b4e9e4 100644 (file)
@@ -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);
         }
index bb8e4a0..13886ed 100644 (file)
@@ -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 */
index 491b31e..76c06f8 100644 (file)
@@ -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 */
index a061942..8273421 100644 (file)
@@ -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
index ab0605b..8c1dd40 100644 (file)
@@ -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,
index 5abc211..20feb62 100644 (file)
@@ -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 **);
 
index 216a927..7e36cbb 100644 (file)
@@ -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)
 {
index d754d82..c1fa898 100644 (file)
@@ -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,
index 412db4e..4fa872b 100644 (file)
@@ -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) {