From 7d4e06043fe3760931f9a285391a951f3cee07c9 Mon Sep 17 00:00:00 2001 From: huanghua Date: Tue, 15 Aug 2006 10:27:11 +0000 Subject: [PATCH] restore xxx_attr_set() interface to have "const md_attr*" argument; --- lustre/cmm/cmm_object.c | 4 ++-- lustre/include/md_object.h | 7 ++----- lustre/mdd/mdd_handler.c | 16 +++++++++------- lustre/mdd/mdd_internal.h | 1 + lustre/tests/sanity.sh | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lustre/cmm/cmm_object.c b/lustre/cmm/cmm_object.c index 29a9ca0..a275d6f 100644 --- a/lustre/cmm/cmm_object.c +++ b/lustre/cmm/cmm_object.c @@ -231,7 +231,7 @@ static int cml_attr_get(const struct lu_context *ctx, struct md_object *mo, } static int cml_attr_set(const struct lu_context *ctx, struct md_object *mo, - struct md_attr *attr) + const struct md_attr *attr) { int rc; ENTRY; @@ -562,7 +562,7 @@ static int cmr_attr_get(const struct lu_context *ctx, struct md_object *mo, } static int cmr_attr_set(const struct lu_context *ctx, struct md_object *mo, - struct md_attr *attr) + const struct md_attr *attr) { RETURN(-EFAULT); } diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index da4e3aa..534985b 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -95,11 +95,8 @@ struct md_object_operations { int (*moo_attr_get)(const struct lu_context *ctxt, struct md_object *dt, struct md_attr *attr); - /* the attr may be ajusted/fixed in various situation in MDD; - * so it is no longer a const. - */ int (*moo_attr_set)(const struct lu_context *ctxt, struct md_object *dt, - struct md_attr *attr); + const struct md_attr *attr); int (*moo_xattr_get)(const struct lu_context *ctxt, struct md_object *obj, @@ -266,7 +263,7 @@ static inline int mo_readlink(const struct lu_context *cx, struct md_object *m, } static inline int mo_attr_set(const struct lu_context *cx, struct md_object *m, - struct md_attr *at) + const struct md_attr *at) { LASSERT(m->mo_ops->moo_attr_set); return m->mo_ops->moo_attr_set(cx, m, at); diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index b3f3ccd..20f876d 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -601,9 +601,8 @@ static int __mdd_xattr_set(const struct lu_context *ctxt, struct mdd_object *o, * and port to */ int mdd_fix_attr(const struct lu_context *ctxt, struct mdd_object *obj, - struct md_attr *ma) + const struct md_attr *ma, struct lu_attr *la) { - struct lu_attr *la = &ma->ma_attr; struct lu_attr *tmp_la = &mdd_ctx_info(ctxt)->mti_la; struct dt_object *next = mdd_object_child(obj); time_t now = CURRENT_SECONDS; @@ -697,13 +696,15 @@ int mdd_fix_attr(const struct lu_context *ctxt, struct mdd_object *obj, /* set attr and LOV EA at once, return updated attr */ static int mdd_attr_set(const struct lu_context *ctxt, - struct md_object *obj, struct md_attr *ma) + struct md_object *obj, + const struct md_attr *ma) { struct mdd_object *mdd_obj = md2mdd_obj(obj); struct mdd_device *mdd = mdo2mdd(obj); struct thandle *handle; struct lov_mds_md *lmm = NULL; int rc = 0, lmm_size = 0, max_size; + struct lu_attr *la_copy = &mdd_ctx_info(ctxt)->mti_la_for_fix; ENTRY; mdd_txn_param_build(ctxt, &MDD_TXN_ATTR_SET); @@ -728,13 +729,14 @@ static int mdd_attr_set(const struct lu_context *ctxt, if (ma->ma_attr.la_valid & (ATTR_MTIME | ATTR_CTIME)) CDEBUG(D_INODE, "setting mtime "LPU64", ctime "LPU64"\n", ma->ma_attr.la_mtime, ma->ma_attr.la_ctime); - - rc = mdd_fix_attr(ctxt, mdd_obj, ma); + + *la_copy = ma->ma_attr; + rc = mdd_fix_attr(ctxt, mdd_obj, ma, la_copy); if (rc) GOTO(cleanup, rc); - if (ma->ma_attr.la_valid) { /* setattr */ + if (la_copy->la_valid) { /* setattr */ mdd_lock(ctxt, mdd_obj, DT_WRITE_LOCK); - rc = mdd_attr_set_internal(ctxt, mdd_obj, &ma->ma_attr, handle); + rc = mdd_attr_set_internal(ctxt, mdd_obj, la_copy, handle); mdd_unlock(ctxt, mdd_obj, DT_WRITE_LOCK); /* journal chown/chgrp in llog, just like unlink */ diff --git a/lustre/mdd/mdd_internal.h b/lustre/mdd/mdd_internal.h index 35e8928..9de72d8 100644 --- a/lustre/mdd/mdd_internal.h +++ b/lustre/mdd/mdd_internal.h @@ -55,6 +55,7 @@ struct mdd_thread_info { struct txn_param mti_param; struct lu_fid mti_fid; struct lu_attr mti_la; + struct lu_attr mti_la_for_fix; struct lov_desc mti_ld; struct lov_mds_md mti_lmm; }; diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index fe09251..e7e217e 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -18,7 +18,7 @@ ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"42a 42b 42c 42d 45 68"} EXCEPT="$EXCEPT 24o" # Tests that always fail with mountconf -- FIXME # 48a moving the working dir succeeds -EXCEPT="$EXCEPT 48a" +EXCEPT="$EXCEPT 48 31" case `uname -r` in 2.4*) FSTYPE=${FSTYPE:-ext3}; ALWAYS_EXCEPT="$ALWAYS_EXCEPT 76" ;; -- 1.8.3.1