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
* 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
* 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
* 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: 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 \
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: 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 \
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>
(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>
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:
+}
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:
}
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__
{
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,
{
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,
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;
/* 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);
/*
* 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()).
*
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)
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);
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,
* 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);
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);
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;
// if (inode->i_op->setattr) {
// rc = inode->i_op->setattr(dentry, iattr);
-// } else
+// } else
{
rc = inode_change_ok(inode, &iattr);
if (!rc)
}
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 = {
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;