From: nikita Date: Thu, 20 Jul 2006 14:54:25 +0000 (+0000) Subject: remove pleonastic "_object" from dt_object_operations methods X-Git-Tag: v1_8_0_110~486^2~1376 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=a5e3975ae6de89709fc31e1954c678ebd5104050;p=fs%2Flustre-release.git remove pleonastic "_object" from dt_object_operations methods --- diff --git a/lustre/fld/fld_index.c b/lustre/fld/fld_index.c index cbed158..de2023e 100644 --- a/lustre/fld/fld_index.c +++ b/lustre/fld/fld_index.c @@ -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 diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index e6d4a7b..360a1da 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -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); }; /* diff --git a/lustre/kernel_patches/patches/ext3-iam-separate.patch b/lustre/kernel_patches/patches/ext3-iam-separate.patch index 2753355..d8439ff 100644 --- a/lustre/kernel_patches/patches/ext3-iam-separate.patch +++ b/lustre/kernel_patches/patches/ext3-iam-separate.patch @@ -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: diff --git a/lustre/kernel_patches/patches/ext3-iam-uapi.patch b/lustre/kernel_patches/patches/ext3-iam-uapi.patch index 985ecb7..f97aaa6 100644 --- a/lustre/kernel_patches/patches/ext3-iam-uapi.patch +++ b/lustre/kernel_patches/patches/ext3-iam-uapi.patch @@ -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 #include @@ -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 #include @@ -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__ diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index a5f4a4d..2dfde71 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -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); diff --git a/lustre/mdt/mdt_fs.c b/lustre/mdt/mdt_fs.c index c4c0d6f..32db503 100644 --- a/lustre/mdt/mdt_fs.c +++ b/lustre/mdt/mdt_fs.c @@ -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, diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 1880287..c204f0d 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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); diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index de7f070..31bdd2e 100644 --- a/lustre/obdclass/dt_object.c +++ b/lustre/obdclass/dt_object.c @@ -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); diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index f9f5f1d..566c0ed 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -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 = { diff --git a/lustre/osd/osd_oi.c b/lustre/osd/osd_oi.c index d4e94f0..ce1ec78 100644 --- a/lustre/osd/osd_oi.c +++ b/lustre/osd/osd_oi.c @@ -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;