Whamcloud - gitweb
b 1585 Support immutable attributes to prevent accidental file deletion from the...
authoryoufeng <youfeng>
Tue, 30 Sep 2003 06:08:07 +0000 (06:08 +0000)
committeryoufeng <youfeng>
Tue, 30 Sep 2003 06:08:07 +0000 (06:08 +0000)
lustre/llite/llite_internal.h
lustre/mds/mds_lib.c
lustre/obdclass/obdo.c

index 34f9a4d..35d69be 100644 (file)
@@ -152,9 +152,11 @@ void ll_update_inode(struct inode *inode, struct mds_body *body,
 int it_disposition(struct lookup_intent *it, int flag);
 void it_set_disposition(struct lookup_intent *it, int flag);
 void ll_read_inode2(struct inode *inode, void *opaque);
+int ll_iocontrol(struct inode *inode, struct file *file,
+                 unsigned int cmd, unsigned long arg);
 void ll_umount_begin(struct super_block *sb);
 int ll_prep_inode(struct obd_export *exp, struct inode **inode, 
-                struct ptlrpc_request *req, int offset, struct super_block *sb);
+                  struct ptlrpc_request *req, int offset, struct super_block *sb);
 
 /* llite/symlink.c */
 extern struct inode_operations ll_fast_symlink_inode_operations;
index a9b6f3f..c5d4839 100644 (file)
@@ -59,8 +59,9 @@ void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode)
 /* Note that we can copy all of the fields, just some will not be "valid" */
 void mds_pack_inode2body(struct mds_body *b, struct inode *inode)
 {
-        b->valid |= OBD_MD_FLID | OBD_MD_FLCTIME | OBD_MD_FLUID | OBD_MD_FLGID |
-                OBD_MD_FLTYPE | OBD_MD_FLMODE | OBD_MD_FLNLINK | OBD_MD_FLGENER;
+        b->valid |= OBD_MD_FLID | OBD_MD_FLCTIME | OBD_MD_FLUID |
+                    OBD_MD_FLGID | OBD_MD_FLFLAGS | OBD_MD_FLTYPE |
+                    OBD_MD_FLMODE | OBD_MD_FLNLINK | OBD_MD_FLGENER;
 
         if (!S_ISREG(inode->i_mode))
                 b->valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | OBD_MD_FLATIME |
index d178a4f..63e4a13 100644 (file)
@@ -116,6 +116,10 @@ void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid)
                 attr->ia_gid = oa->o_gid;
                 attr->ia_valid |= ATTR_GID;
         }
+        if (valid & OBD_MD_FLFLAGS) {
+                attr->ia_attr_flags = oa->o_flags;
+                attr->ia_valid |= ATTR_ATTR_FLAG;
+        }
 }
 EXPORT_SYMBOL(iattr_from_obdo);