Whamcloud - gitweb
LU-1518 mdd: Revert "Fixup mdd_{obf,dot_lustre}_obj_ops."
authorJohann Lombardi <johann@whamcloud.com>
Tue, 19 Jun 2012 08:44:29 +0000 (04:44 -0400)
committerJohann Lombardi <johann@whamcloud.com>
Tue, 19 Jun 2012 08:45:26 +0000 (04:45 -0400)
This reverts commit cf0d73004a20923c690591c1f3f61a8c872ad86e

Reverting this patch due to build failure (moo_version_get not defined).

Change-Id: I7cac5c6d6de2924d46c3a74ed4aa138f50501a16
Reviewed-on: http://review.whamcloud.com/3137
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Johann Lombardi <johann@whamcloud.com>
lustre/mdd/mdd_device.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c

index 5b1c230..75abe60 100644 (file)
@@ -459,6 +459,21 @@ static int dot_lustre_mdd_permission(const struct lu_env *env,
                 return 0;
 }
 
+static int dot_lustre_mdd_attr_get(const struct lu_env *env,
+                                   struct md_object *obj, struct md_attr *ma)
+{
+        struct mdd_object *mdd_obj = md2mdd_obj(obj);
+
+        return mdd_attr_get_internal_locked(env, mdd_obj, ma);
+}
+
+static int dot_lustre_mdd_attr_set(const struct lu_env *env,
+                                   struct md_object *obj,
+                                   const struct md_attr *ma)
+{
+        return -EPERM;
+}
+
 static int dot_lustre_mdd_xattr_get(const struct lu_env *env,
                                     struct md_object *obj, struct lu_buf *buf,
                                     const char *name)
@@ -566,8 +581,8 @@ static int dot_file_unlock(const struct lu_env *env, struct md_object *obj,
 
 static struct md_object_operations mdd_dot_lustre_obj_ops = {
         .moo_permission    = dot_lustre_mdd_permission,
-        .moo_attr_get      = mdd_attr_get,
-        .moo_attr_set      = mdd_attr_set,
+        .moo_attr_get      = dot_lustre_mdd_attr_get,
+        .moo_attr_set      = dot_lustre_mdd_attr_set,
         .moo_xattr_get     = dot_lustre_mdd_xattr_get,
         .moo_xattr_list    = dot_lustre_mdd_xattr_list,
         .moo_xattr_set     = dot_lustre_mdd_xattr_set,
@@ -708,7 +723,8 @@ static int obf_attr_get(const struct lu_env *env, struct md_object *obj,
                 /* "fid" is a virtual object and hence does not have any "real"
                  * attributes. So we reuse attributes of .lustre for "fid" dir */
                 ma->ma_need |= MA_INODE;
-                rc = mdd_attr_get(env, &mdd->mdd_dot_lustre->mod_obj, ma);
+                rc = dot_lustre_mdd_attr_get(env, &mdd->mdd_dot_lustre->mod_obj,
+                                             ma);
                 if (rc)
                         return rc;
                 ma->ma_valid |= MA_INODE;
@@ -744,12 +760,6 @@ static int obf_attr_set(const struct lu_env *env, struct md_object *obj,
         return -EPERM;
 }
 
-static int obf_xattr_list(const struct lu_env *env,
-                          struct md_object *obj, struct lu_buf *buf)
-{
-        return 0;
-}
-
 static int obf_xattr_get(const struct lu_env *env,
                          struct md_object *obj, struct lu_buf *buf,
                          const char *name)
@@ -757,21 +767,6 @@ static int obf_xattr_get(const struct lu_env *env,
         return 0;
 }
 
-static int obf_xattr_set(const struct lu_env *env,
-                         struct md_object *obj,
-                         const struct lu_buf *buf, const char *name,
-                         int fl)
-{
-        return -EPERM;
-}
-
-static int obf_xattr_del(const struct lu_env *env,
-                         struct md_object *obj,
-                         const char *name)
-{
-        return -EPERM;
-}
-
 static int obf_mdd_open(const struct lu_env *env, struct md_object *obj,
                         int flags)
 {
@@ -809,24 +804,14 @@ static int obf_path(const struct lu_env *env, struct md_object *obj,
         return -ENOSYS;
 }
 
-static dt_obj_version_t obf_version_get(const struct lu_env *env,
-                                        struct md_object *obj)
-{
-        return 0;
-}
-
 static struct md_object_operations mdd_obf_obj_ops = {
-        .moo_attr_get    = obf_attr_get,
-        .moo_attr_set    = obf_attr_set,
-        .moo_xattr_list  = obf_xattr_list,
-        .moo_xattr_get   = obf_xattr_get,
-        .moo_xattr_set   = obf_xattr_set,
-        .moo_xattr_del   = obf_xattr_del,
-        .moo_open        = obf_mdd_open,
-        .moo_close       = obf_mdd_close,
-        .moo_readpage    = obf_mdd_readpage,
-        .moo_version_get = obf_version_get,
-        .moo_path        = obf_path
+        .moo_attr_get   = obf_attr_get,
+        .moo_attr_set   = obf_attr_set,
+        .moo_xattr_get  = obf_xattr_get,
+        .moo_open       = obf_mdd_open,
+        .moo_close      = obf_mdd_close,
+        .moo_readpage   = obf_mdd_readpage,
+        .moo_path       = obf_path
 };
 
 /**
index d2ab7b8..bdeb805 100644 (file)
@@ -219,10 +219,6 @@ int mdd_get_md_locked(const struct lu_env *env, struct mdd_object *obj,
 int mdd_data_get(const struct lu_env *env, struct mdd_object *obj, void **data);
 int mdd_la_get(const struct lu_env *env, struct mdd_object *obj,
                struct lu_attr *la, struct lustre_capa *capa);
-int mdd_attr_get(const struct lu_env *env, struct md_object *obj,
-                 struct md_attr *ma);
-int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
-                 const struct md_attr *ma);
 int mdd_attr_set_internal(const struct lu_env *env,
                           struct mdd_object *obj,
                           struct lu_attr *attr,
index a8dbadb..ccea39b 100644 (file)
@@ -851,8 +851,8 @@ int mdd_attr_get_internal_locked(const struct lu_env *env,
 /*
  * No permission check is needed.
  */
-int mdd_attr_get(const struct lu_env *env, struct md_object *obj,
-                 struct md_attr *ma)
+static int mdd_attr_get(const struct lu_env *env, struct md_object *obj,
+                        struct md_attr *ma)
 {
         struct mdd_object *mdd_obj = md2mdd_obj(obj);
         int                rc;
@@ -1633,8 +1633,8 @@ static int mdd_declare_attr_set(const struct lu_env *env,
 }
 
 /* set attr and LOV EA at once, return updated attr */
-int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
-                 const struct md_attr *ma)
+static int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
+                        const struct md_attr *ma)
 {
         struct mdd_object *mdd_obj = md2mdd_obj(obj);
         struct mdd_device *mdd = mdo2mdd(obj);