Whamcloud - gitweb
Branch: b_new_cmd
authorwangdi <wangdi>
Thu, 17 Aug 2006 15:11:07 +0000 (15:11 +0000)
committerwangdi <wangdi>
Thu, 17 Aug 2006 15:11:07 +0000 (15:11 +0000)
some fixes about get/set flags for test_52

lustre/llite/llite_lib.c
lustre/mdd/Makefile.in
lustre/mdd/mdd_handler.c
lustre/mdd/mdd_internal.h
lustre/osd/osd_handler.c

index 7083bc9..275c3e0 100644 (file)
@@ -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));
index a2a7249..a8f77ea 100644 (file)
@@ -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@
index 0f11256..7aceb56 100644 (file)
@@ -31,6 +31,7 @@
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include <linux/module.h>
+#include <linux/jbd.h>
 
 #include <obd.h>
 #include <obd_class.h>
@@ -38,6 +39,7 @@
 #include <obd_support.h>
 #include <lprocfs_status.h>
 
+#include <linux/ldiskfs_fs.h>
 #include <lu_object.h>
 #include <md_object.h>
 #include <dt_object.h>
@@ -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;
 }
 
index c98f3c0..3835dfd 100644 (file)
@@ -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 */
index 242a4f8..a0c29fa 100644 (file)
@@ -32,7 +32,6 @@
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include <linux/module.h>
-#include <linux/fs.h>
 
 /* LUSTRE_VERSION_CODE */
 #include <lustre_ver.h>
@@ -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;