Whamcloud - gitweb
Branch b_hd_kdmu
[fs/lustre-release.git] / lustre / cmm / mdc_object.c
index 70a1c3e..2e884ba 100644 (file)
@@ -52,9 +52,9 @@
 #include "cmm_internal.h"
 #include "mdc_internal.h"
 
-static struct md_object_operations mdc_mo_ops;
-static struct md_dir_operations mdc_dir_ops;
-static struct lu_object_operations mdc_obj_ops;
+static const struct md_object_operations mdc_mo_ops;
+static const struct md_dir_operations mdc_dir_ops;
+static const struct lu_object_operations mdc_obj_ops;
 
 extern struct lu_context_key mdc_thread_key;
 
@@ -86,23 +86,17 @@ static void mdc_object_free(const struct lu_env *env, struct lu_object *lo)
         OBD_FREE_PTR(mco);
 }
 
-static int mdc_object_init(const struct lu_env *env, struct lu_object *lo)
+static int mdc_object_init(const struct lu_env *env, struct lu_object *lo,
+                           const struct lu_object_conf *_)
 {
         ENTRY;
         lo->lo_header->loh_attr |= LOHA_REMOTE;
         RETURN(0);
 }
 
-static int mdc_object_print(const struct lu_env *env, void *cookie,
-                            lu_printer_t p, const struct lu_object *lo)
-{
-       return (*p)(env, cookie, LUSTRE_CMM_MDC_NAME"-object@%p", lo);
-}
-
-static struct lu_object_operations mdc_obj_ops = {
+static const struct lu_object_operations mdc_obj_ops = {
         .loo_object_init    = mdc_object_init,
         .loo_object_free    = mdc_object_free,
-       .loo_object_print   = mdc_object_print,
 };
 
 /* md_object_operations */
@@ -182,7 +176,7 @@ static int mdc_req2attr_update(const struct lu_env *env,
                 LASSERT(ma->ma_capa != NULL);
                 *ma->ma_capa = *capa;
         }
-                
+
         if ((body->valid & OBD_MD_FLEASIZE) || (body->valid & OBD_MD_FLDIREA)) {
                 if (body->eadatasize == 0) {
                         CERROR("No size defined for easize field\n");
@@ -195,7 +189,7 @@ static int mdc_req2attr_update(const struct lu_env *env,
                         RETURN(-EPROTO);
 
                 LASSERT(ma->ma_lmm != NULL);
-                LASSERT(ma->ma_lmm_size >= body->eadatasize); 
+                LASSERT(ma->ma_lmm_size >= body->eadatasize);
                 ma->ma_lmm_size = body->eadatasize;
                 memcpy(ma->ma_lmm, md, ma->ma_lmm_size);
                 ma->ma_valid |= MA_LOV;
@@ -213,7 +207,7 @@ static int mdc_req2attr_update(const struct lu_env *env,
                         RETURN(-EPROTO);
                 }
 
-                cookie = req_capsule_server_sized_get(&req->rq_pill, 
+                cookie = req_capsule_server_sized_get(&req->rq_pill,
                                                       &RMF_LOGCOOKIES,
                                                       body->aclsize);
                 if (cookie == NULL)
@@ -232,7 +226,7 @@ static int mdc_req2attr_update(const struct lu_env *env,
                         RETURN(-EPROTO);
                 }
 
-                acl = req_capsule_server_sized_get(&req->rq_pill, 
+                acl = req_capsule_server_sized_get(&req->rq_pill,
                                                    &RMF_ACL,
                                                    body->aclsize);
                 if (acl == NULL)
@@ -355,7 +349,7 @@ static int mdc_object_create(const struct lu_env *env,
         mci = mdc_info_init(env);
         mci->mci_opdata.op_bias = MDS_CROSS_REF;
         mci->mci_opdata.op_fid2 = *lu_object_fid(&mo->mo_lu);
-        
+
         /* Parent fid is needed to create dotdot on the remote node. */
         mci->mci_opdata.op_fid1 = *(spec->u.sp_pfid);
         mci->mci_opdata.op_mod_time = la->la_ctime;
@@ -517,7 +511,7 @@ int mdc_send_page(struct cmm_device *cm, const struct lu_env *env,
 }
 #endif
 
-static struct md_object_operations mdc_mo_ops = {
+static const struct md_object_operations mdc_mo_ops = {
         .moo_attr_get       = mdc_attr_get,
         .moo_attr_set       = mdc_attr_set,
         .moo_object_create  = mdc_object_create,
@@ -578,7 +572,7 @@ static int mdc_rename_tgt(const struct lu_env *env, struct md_object *mo_p,
 
         RETURN(rc);
 }
-/* 
+/*
  * Return resulting fid in sfid
  * 0: fids are not relatives
  * fid: fid at which search stopped
@@ -600,7 +594,7 @@ static int mdc_is_subdir(const struct lu_env *env, struct md_object *mo,
                 body = req_capsule_server_get(&mci->mci_req->rq_pill,
                                               &RMF_MDT_BODY);
                 LASSERT(body->valid & OBD_MD_FLID);
-        
+
                 CDEBUG(D_INFO, "Remote mdo_is_subdir(), new src "DFID"\n",
                        PFID(&body->fid1));
                 *sfid = body->fid1;
@@ -609,7 +603,7 @@ static int mdc_is_subdir(const struct lu_env *env, struct md_object *mo,
         RETURN(rc);
 }
 
-static struct md_dir_operations mdc_dir_ops = {
+static const struct md_dir_operations mdc_dir_ops = {
         .mdo_is_subdir   = mdc_is_subdir,
         .mdo_rename_tgt  = mdc_rename_tgt
 };