From: wangdi Date: Thu, 17 Aug 2006 15:11:07 +0000 (+0000) Subject: Branch: b_new_cmd X-Git-Tag: v1_8_0_110~486^2~1148 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b70f94a8db1cee568690cd8efdfb7af061928cd5;p=fs%2Flustre-release.git Branch: b_new_cmd some fixes about get/set flags for test_52 --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 7083bc9..275c3e0 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1435,14 +1435,10 @@ int ll_iocontrol(struct inode *inode, struct file *file, } body = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*body)); - - if (body->flags & S_APPEND) - flags |= EXT3_APPEND_FL; - if (body->flags & S_IMMUTABLE) - flags |= EXT3_IMMUTABLE_FL; - if (body->flags & S_NOATIME) - flags |= EXT3_NOATIME_FL; - + + /*Now the ext3 will be packed directly back to client, + *no need convert here*/ + flags = body->flags; ptlrpc_req_finished (req); RETURN(put_user(flags, (int *)arg)); diff --git a/lustre/mdd/Makefile.in b/lustre/mdd/Makefile.in index a2a7249..a8f77ea 100644 --- a/lustre/mdd/Makefile.in +++ b/lustre/mdd/Makefile.in @@ -1,4 +1,6 @@ MODULES := mdd mdd-objs := mdd_handler.o mdd_lov.o +EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LUSTRE@ -I@LUSTRE@/ldiskfs + @INCLUDE_RULES@ diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index 0f11256..7aceb56 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -31,6 +31,7 @@ #define DEBUG_SUBSYSTEM S_MDS #include +#include #include #include @@ -38,6 +39,7 @@ #include #include +#include #include #include #include @@ -199,16 +201,16 @@ static inline int __mdd_la_get(const struct lu_context *ctxt, struct dt_object *next = mdd_object_child(obj); LASSERT(lu_object_exists(mdd2lu_obj(obj))); return next->do_ops->do_attr_get(ctxt, next, la); - } static void mdd_flags_xlate(struct mdd_object *obj, __u32 flags) { - obj->mod_flags = 0; - if (flags & S_APPEND) + obj->mod_flags &= ~(APPEND_OBJ|IMMUTE_OBJ); + + if (flags & LUSTRE_APPEND_FL) obj->mod_flags |= APPEND_OBJ; - if (flags & S_IMMUTABLE) + if (flags & LUSTRE_IMMUTABLE_FL) obj->mod_flags |= IMMUTE_OBJ; } diff --git a/lustre/mdd/mdd_internal.h b/lustre/mdd/mdd_internal.h index c98f3c0..3835dfd 100644 --- a/lustre/mdd/mdd_internal.h +++ b/lustre/mdd/mdd_internal.h @@ -47,6 +47,9 @@ enum mod_flags { IMMUTE_OBJ = 1 << 2 }; +#define LUSTRE_APPEND_FL LDISKFS_APPEND_FL +#define LUSTRE_IMMUTABLE_FL LDISKFS_IMMUTABLE_FL + struct mdd_object { struct md_object mod_obj; /* open count */ diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index 242a4f8..a0c29fa 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -32,7 +32,6 @@ #define DEBUG_SUBSYSTEM S_MDS #include -#include /* LUSTRE_VERSION_CODE */ #include @@ -629,7 +628,8 @@ static int osd_inode_setattr(const struct lu_context *ctx, struct inode *inode, const struct lu_attr *attr) { __u64 bits; - + int rc = 0; + bits = attr->la_valid; LASSERT(!(bits & LA_TYPE)); /* Huh? You want too much. */ @@ -669,7 +669,7 @@ static int osd_inode_setattr(const struct lu_context *ctx, (attr->la_flags & LDISKFS_FL_USER_MODIFIABLE); } mark_inode_dirty(inode); - return 0; + return rc; } /* @@ -1975,7 +1975,7 @@ static int osd_inode_getattr(const struct lu_context *ctx, attr->la_blocks = inode->i_blocks; attr->la_uid = inode->i_uid; attr->la_gid = inode->i_gid; - attr->la_flags = inode->i_flags; + attr->la_flags = LDISKFS_I(inode)->i_flags; attr->la_nlink = inode->i_nlink; attr->la_rdev = inode->i_rdev; attr->la_blksize = inode->i_blksize;