Whamcloud - gitweb
remove pleonastic "_object" from dt_object_operations methods
authornikita <nikita>
Thu, 20 Jul 2006 14:54:25 +0000 (14:54 +0000)
committernikita <nikita>
Thu, 20 Jul 2006 14:54:25 +0000 (14:54 +0000)
lustre/fld/fld_index.c
lustre/include/dt_object.h
lustre/kernel_patches/patches/ext3-iam-separate.patch
lustre/kernel_patches/patches/ext3-iam-uapi.patch
lustre/mdd/mdd_handler.c
lustre/mdt/mdt_fs.c
lustre/mdt/mdt_handler.c
lustre/obdclass/dt_object.c
lustre/osd/osd_handler.c
lustre/osd/osd_oi.c

index cbed158..de2023e 100644 (file)
@@ -216,8 +216,8 @@ int fld_index_init(struct lu_server_fld *fld,
         dt_obj = dt_store_open(ctx, dt, fld_index_name, &fld->fld_fid);
         if (!IS_ERR(dt_obj)) {
                 fld->fld_obj = dt_obj;
-                rc = dt_obj->do_ops->do_object_index_try(ctx, dt_obj,
-                                                         &fld_index_features);
+                rc = dt_obj->do_ops->do_index_try(ctx, dt_obj,
+                                                  &fld_index_features);
                 if (rc == 0)
                         LASSERT(dt_obj->do_index_ops != NULL);
                 else
index e6d4a7b..360a1da 100644 (file)
@@ -122,10 +122,10 @@ extern const struct dt_index_features dt_directory_features;
  * Per-dt-object operations.
  */
 struct dt_object_operations {
-        void  (*do_object_lock)(const struct lu_context *ctx,
-                                struct dt_object *dt, enum dt_lock_mode mode);
-        void  (*do_object_unlock)(const struct lu_context *ctx,
-                                  struct dt_object *dt, enum dt_lock_mode mode);
+        void  (*do_lock)(const struct lu_context *ctx,
+                         struct dt_object *dt, enum dt_lock_mode mode);
+        void  (*do_unlock)(const struct lu_context *ctx,
+                           struct dt_object *dt, enum dt_lock_mode mode);
         /*
          * Note: following ->do_{x,}attr_{set,get}() operations are very
          * similar to ->moo_{x,}attr_{set,get}() operations in struct
@@ -175,9 +175,8 @@ struct dt_object_operations {
          * precondition: !lu_object_exists(ctxt, &dt->do_lu);
          * postcondition: ergo(result == 0, lu_object_exists(ctxt, &dt->do_lu));
          */
-        int   (*do_object_create)(const struct lu_context *ctxt,
-                                  struct dt_object *dt,
-                                  struct lu_attr *attr, struct thandle *th);
+        int   (*do_create)(const struct lu_context *ctxt, struct dt_object *dt,
+                           struct lu_attr *attr, struct thandle *th);
         /*
          * Announce that this object is going to be used as an index. This
          * operation check that object supports indexing operations and
@@ -186,21 +185,21 @@ struct dt_object_operations {
          * Also probes for features. Operation is successful if all required
          * features are supported.
          */
-        int   (*do_object_index_try)(const struct lu_context *ctxt,
-                                     struct dt_object *dt,
-                                     const struct dt_index_features *feat);
+        int   (*do_index_try)(const struct lu_context *ctxt,
+                              struct dt_object *dt,
+                              const struct dt_index_features *feat);
         /*
          * Add nlink of the object
          * precondition: lu_object_exists(ctxt, &dt->do_lu);
          */
-        int   (*do_object_ref_add)(const struct lu_context *ctxt,
-                                   struct dt_object *dt, struct thandle *th);
+        int   (*do_ref_add)(const struct lu_context *ctxt,
+                            struct dt_object *dt, struct thandle *th);
         /*
          * Del nlink of the object
          * precondition: lu_object_exists(ctxt, &dt->do_lu);
          */
-        int   (*do_object_ref_del)(const struct lu_context *ctxt,
-                                   struct dt_object *dt, struct thandle *th);
+        int   (*do_ref_del)(const struct lu_context *ctxt,
+                            struct dt_object *dt, struct thandle *th);
 };
 
 /*
index 2753355..d8439ff 100644 (file)
@@ -1,7 +1,7 @@
 Index: iam/fs/ext3/Makefile
 ===================================================================
 --- iam.orig/fs/ext3/Makefile  2006-05-31 20:24:32.000000000 +0400
-+++ iam/fs/ext3/Makefile       2006-07-19 16:58:55.000000000 +0400
++++ iam/fs/ext3/Makefile       2006-07-20 18:33:52.000000000 +0400
 @@ -6,7 +6,7 @@ obj-$(CONFIG_EXT3_FS) += ext3.o
  
  ext3-y        := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
@@ -5441,7 +5441,7 @@ Index: iam/fs/ext3/namei.c
 Index: iam/include/linux/lustre_iam.h
 ===================================================================
 --- iam.orig/include/linux/lustre_iam.h        2006-05-31 20:24:32.000000000 +0400
-+++ iam/include/linux/lustre_iam.h     2006-07-19 16:58:55.000000000 +0400
++++ iam/include/linux/lustre_iam.h     2006-07-20 18:33:52.000000000 +0400
 @@ -1,9 +1,68 @@
 +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
 + * vim:expandtab:shiftwidth=8:tabstop=8:
index 985ecb7..f97aaa6 100644 (file)
@@ -1,7 +1,7 @@
 Index: iam/fs/ext3/Makefile
 ===================================================================
---- iam.orig/fs/ext3/Makefile  2006-07-19 16:58:55.000000000 +0400
-+++ iam/fs/ext3/Makefile       2006-07-19 16:58:56.000000000 +0400
+--- iam.orig/fs/ext3/Makefile  2006-07-20 18:33:52.000000000 +0400
++++ iam/fs/ext3/Makefile       2006-07-20 18:33:52.000000000 +0400
 @@ -6,7 +6,7 @@ obj-$(CONFIG_EXT3_FS) += ext3.o
  
  ext3-y        := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
@@ -13,8 +13,8 @@ Index: iam/fs/ext3/Makefile
  ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
 Index: iam/fs/ext3/dir.c
 ===================================================================
---- iam.orig/fs/ext3/dir.c     2006-07-19 16:58:55.000000000 +0400
-+++ iam/fs/ext3/dir.c  2006-07-19 16:58:56.000000000 +0400
+--- iam.orig/fs/ext3/dir.c     2006-07-20 18:33:52.000000000 +0400
++++ iam/fs/ext3/dir.c  2006-07-20 18:33:52.000000000 +0400
 @@ -28,6 +28,7 @@
  #include <linux/smp_lock.h>
  #include <linux/slab.h>
@@ -112,8 +112,8 @@ Index: iam/fs/ext3/dir.c
                    (filp->f_version != inode->i_version)) {
 Index: iam/fs/ext3/file.c
 ===================================================================
---- iam.orig/fs/ext3/file.c    2006-07-19 16:58:55.000000000 +0400
-+++ iam/fs/ext3/file.c 2006-07-19 16:58:56.000000000 +0400
+--- iam.orig/fs/ext3/file.c    2006-07-20 18:33:52.000000000 +0400
++++ iam/fs/ext3/file.c 2006-07-20 18:33:52.000000000 +0400
 @@ -23,6 +23,7 @@
  #include <linux/jbd.h>
  #include <linux/ext3_fs.h>
@@ -149,7 +149,7 @@ Index: iam/fs/ext3/file.c
 Index: iam/fs/ext3/iam-uapi.c
 ===================================================================
 --- iam.orig/fs/ext3/iam-uapi.c        2004-04-06 17:27:52.000000000 +0400
-+++ iam/fs/ext3/iam-uapi.c     2006-07-19 16:58:56.000000000 +0400
++++ iam/fs/ext3/iam-uapi.c     2006-07-20 18:33:52.000000000 +0400
 @@ -0,0 +1,361 @@
 +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
 + * vim:expandtab:shiftwidth=8:tabstop=8:
@@ -514,8 +514,8 @@ Index: iam/fs/ext3/iam-uapi.c
 +}
 Index: iam/fs/ext3/ioctl.c
 ===================================================================
---- iam.orig/fs/ext3/ioctl.c   2006-07-19 16:58:55.000000000 +0400
-+++ iam/fs/ext3/ioctl.c        2006-07-19 16:58:56.000000000 +0400
+--- iam.orig/fs/ext3/ioctl.c   2006-07-20 18:33:52.000000000 +0400
++++ iam/fs/ext3/ioctl.c        2006-07-20 18:33:52.000000000 +0400
 @@ -250,6 +250,6 @@ flags_err:
  
  
@@ -526,8 +526,8 @@ Index: iam/fs/ext3/ioctl.c
  }
 Index: iam/include/linux/lustre_iam.h
 ===================================================================
---- iam.orig/include/linux/lustre_iam.h        2006-07-19 16:58:55.000000000 +0400
-+++ iam/include/linux/lustre_iam.h     2006-07-19 16:58:56.000000000 +0400
+--- iam.orig/include/linux/lustre_iam.h        2006-07-20 18:33:52.000000000 +0400
++++ iam/include/linux/lustre_iam.h     2006-07-20 18:33:52.000000000 +0400
 @@ -30,9 +30,6 @@
  #ifndef __LINUX_LUSTRE_IAM_H__
  #define __LINUX_LUSTRE_IAM_H__
index a5f4a4d..2dfde71 100644 (file)
@@ -329,7 +329,7 @@ static void mdd_lock(const struct lu_context *ctxt,
 {
         struct dt_object  *next = mdd_object_child(obj);
 
-        next->do_ops->do_object_lock(ctxt, next, mode);
+        next->do_ops->do_lock(ctxt, next, mode);
 }
 
 static void mdd_unlock(const struct lu_context *ctxt,
@@ -337,7 +337,7 @@ static void mdd_unlock(const struct lu_context *ctxt,
 {
         struct dt_object  *next = mdd_object_child(obj);
 
-        next->do_ops->do_object_unlock(ctxt, next, mode);
+        next->do_ops->do_unlock(ctxt, next, mode);
 }
 
 static void mdd_lock2(const struct lu_context *ctxt,
@@ -379,7 +379,7 @@ static int __mdd_object_create(const struct lu_context *ctxt,
 
         if (!lu_object_exists(ctxt, &obj->mod_obj.mo_lu)) {
                 next = mdd_object_child(obj);
-                rc = next->do_ops->do_object_create(ctxt, next, attr, handle);
+                rc = next->do_ops->do_create(ctxt, next, attr, handle);
         } else
                 rc = -EEXIST;
 
@@ -387,7 +387,7 @@ static int __mdd_object_create(const struct lu_context *ctxt,
         /* increase the nlink for directory */
         if (rc == 0 && dt_try_as_dir(ctxt, mdd_object_child(obj)))
                 rc = __mdd_ref_add(ctxt, obj, handle);
-        
+
         if (rc == 0)
                 mdd_attr_get(ctxt, &obj->mod_obj, &ma->ma_attr);
 
@@ -803,7 +803,7 @@ static int mdd_create(const struct lu_context *ctxt, struct md_object *pobj,
         /*
          * Two operations have to be performed:
          *
-         *  - allocation of new object (->do_object_create()), and
+         *  - allocation of new object (->do_create()), and
          *
          *  - insertion into parent index (->dio_insert()).
          *
@@ -1001,7 +1001,7 @@ static int __mdd_ref_add(const struct lu_context *ctxt, struct mdd_object *obj,
 
         LASSERT(lu_object_exists(ctxt, &obj->mod_obj.mo_lu));
         next = mdd_object_child(obj);
-        return next->do_ops->do_object_ref_add(ctxt, next, handle);
+        return next->do_ops->do_ref_add(ctxt, next, handle);
 }
 
 static int mdd_ref_add(const struct lu_context *ctxt, struct md_object *obj)
@@ -1032,7 +1032,7 @@ __mdd_ref_del(const struct lu_context *ctxt, struct mdd_object *obj,
 
         LASSERT(lu_object_exists(ctxt, &obj->mod_obj.mo_lu));
 
-        rc = next->do_ops->do_object_ref_del(ctxt, next, handle);
+        rc = next->do_ops->do_ref_del(ctxt, next, handle);
         if (rc == 0 && ma != NULL)
                 mdd_attr_get(ctxt, &obj->mod_obj, &ma->ma_attr);
 
index c4c0d6f..32db503 100644 (file)
@@ -398,7 +398,10 @@ out:
 extern struct lu_context_key mdt_txn_key;
 extern struct lu_context_key mdt_thread_key;
 
-#define MDT_TXN_LAST_RCVD_CREDITS 1
+enum {
+        MDT_TXN_LAST_RCVD_CREDITS = 1
+};
+
 /* add credits for last_rcvd update */
 static int mdt_txn_start_cb(const struct lu_context *ctx,
                             struct dt_device *dev,
index 1880287..c204f0d 100644 (file)
@@ -1068,15 +1068,6 @@ static int mdt_req_handle(struct mdt_thread_info *info,
                  * Process request.
                  */
                 result = h->mh_act(info);
-        /*
-         * XXX result value is unconditionally shoved into ->rq_status
-         * (original code sometimes placed error code into ->rq_status, and
-         * sometimes returned it to the
-         * caller). ptlrpc_server_handle_request() doesn't check return value
-         * anyway.
-         */
-        /*XXX the status can be lost due to this, remove for now -tappro
-         * req->rq_status = result;*/
 
         LASSERT(current->journal_info == NULL);
 
index de7f070..31bdd2e 100644 (file)
@@ -132,8 +132,7 @@ EXPORT_SYMBOL(dt_object_fini);
 int dt_try_as_dir(const struct lu_context *ctx, struct dt_object *obj)
 {
         if (obj->do_index_ops == NULL)
-                obj->do_ops->do_object_index_try(ctx, obj,
-                                                 &dt_directory_features);
+                obj->do_ops->do_index_try(ctx, obj, &dt_directory_features);
         return obj->do_index_ops != NULL;
 }
 EXPORT_SYMBOL(dt_try_as_dir);
index f9f5f1d..566c0ed 100644 (file)
@@ -533,7 +533,7 @@ static int osd_inode_setattr(const struct lu_context *ctx,
         LTIME_S(iattr.ia_atime) = attr->la_atime;
         LTIME_S(iattr.ia_mtime) = attr->la_mtime;
         LTIME_S(iattr.ia_ctime) = attr->la_ctime;
-        
+
         /* TODO: handle ATTR_SIZE & truncate in the future */
         iattr.ia_valid &= ~ATTR_SIZE;
 
@@ -544,7 +544,7 @@ static int osd_inode_setattr(const struct lu_context *ctx,
 
 //        if (inode->i_op->setattr) {
 //                rc = inode->i_op->setattr(dentry, iattr);
-//        } else 
+//        } else
         {
                 rc = inode_change_ok(inode, &iattr);
                 if (!rc)
@@ -795,16 +795,16 @@ int osd_xattr_set(const struct lu_context *ctxt, struct dt_object *dt,
 }
 
 static struct dt_object_operations osd_obj_ops = {
-        .do_object_lock      = osd_object_lock,
-        .do_object_unlock    = osd_object_unlock,
-        .do_attr_get         = osd_attr_get,
-        .do_attr_set         = osd_attr_set,
-        .do_object_create    = osd_object_create,
-        .do_object_index_try = osd_index_try,
-        .do_object_ref_add   = osd_object_ref_add,
-        .do_object_ref_del   = osd_object_ref_del,
-        .do_xattr_get        = osd_xattr_get,
-        .do_xattr_set        = osd_xattr_set
+        .do_lock      = osd_object_lock,
+        .do_unlock    = osd_object_unlock,
+        .do_attr_get  = osd_attr_get,
+        .do_attr_set  = osd_attr_set,
+        .do_create    = osd_object_create,
+        .do_index_try = osd_index_try,
+        .do_ref_add   = osd_object_ref_add,
+        .do_ref_del   = osd_object_ref_del,
+        .do_xattr_get = osd_xattr_get,
+        .do_xattr_set = osd_xattr_set
 };
 
 static struct dt_body_operations osd_body_ops = {
index d4e94f0..ce1ec78 100644 (file)
@@ -88,8 +88,8 @@ int osd_oi_init(struct osd_thread_info *info,
 
         obj = dt_store_open(ctx, dev, oi_dirname, &info->oti_fid);
         if (!IS_ERR(obj)) {
-                result = obj->do_ops->do_object_index_try(ctx, obj,
-                                                          &oi_index_features);
+                result = obj->do_ops->do_index_try(ctx, obj,
+                                                   &oi_index_features);
                 if (result == 0) {
                         LASSERT(obj->do_index_ops != NULL);
                         oi->oi_dir = obj;