Whamcloud - gitweb
- make default key timelife 3 days long
[fs/lustre-release.git] / lustre / include / linux / lustre_smfs.h
index afc3367..3ef1a4b 100644 (file)
@@ -32,6 +32,12 @@ struct snap_inode_info {
         int sn_index;           /*the inode snap_index*/
         ino_t sn_root_ino;        /*the root ino of this snap*/
 };
+
+struct audit_inode_info {
+        __u64 au_mask;
+        __u8  au_valid;
+};
+
 struct smfs_inode_info {
         /* this first part of struct should be the same as in mds_info_info */
         //struct lustre_id smi_id;
@@ -39,6 +45,7 @@ struct smfs_inode_info {
         /* smfs part. */
         struct inode *smi_inode;
         __u32  smi_flags;
+        struct audit_inode_info au_info;
        struct snap_inode_info sm_sninfo;
 };
 #if 0
@@ -94,13 +101,13 @@ struct smfs_super_info {
         char                     *smsi_ftype;       /* file system type */
        struct obd_export        *smsi_exp;         /* file system obd exp */
        struct snap_super_info   *smsi_snap_info;   /* snap table cow */
-        //smfs_pack_rec_func            smsi_pack_rec[PACK_MAX]; /* sm_pack_rec type ops */
-        struct rw_semaphore      plg_sem; /*rw semaphore to protect plg operations */
-        __u32                    plg_flags;        /* flags */
+
+        struct rw_semaphore      plg_sem;           /* rw semaphore to protect
+                                                     * plg operations */
+        __u32                    plg_flags;         /* flags */
         __u32                    smsi_flags;
         __u32                    smsi_ops_check;
         struct list_head         smsi_plg_list;
-        //kmem_cache_t *           smsi_inode_cachep;  /*inode_cachep*/
 };
 
 
@@ -381,6 +388,26 @@ static inline void duplicate_file(struct file *dst_file, struct file *src_file)
        #endif
        }
 }
+static inline void pre_smfs_file(struct file * file, loff_t *off,
+                                 loff_t **backfs_off)
+{
+               
+        if (off != &file->f_pos)
+                *backfs_off = off;
+        else
+                *backfs_off = &(F2CF(file)->f_pos);
+        
+        F2CF(file)->f_pos = file->f_pos;
+        pre_smfs_inode(file->f_dentry->d_inode, 
+                       I2CI(file->f_dentry->d_inode));
+}
+
+static inline void post_smfs_file(struct file *file)
+{
+        post_smfs_inode(file->f_dentry->d_inode,
+                        I2CI(file->f_dentry->d_inode));
+        duplicate_file(file, F2CF(file));
+}
 
 static inline void duplicate_sb(struct super_block *dst_sb,
                                 struct super_block *src_sb)
@@ -469,12 +496,13 @@ static inline struct dentry *pre_smfs_dentry(struct dentry *parent_dentry,
         if (!parent_dentry)
                 cache_dentry->d_parent = cache_dentry;
         
+        //defines d_delete op to force killing dentry
+        cache_dentry->d_op = &sm_dop;
+
         if (cache_inode) {
                 atomic_inc(&cache_inode->i_count); //d_instantiate suppose that
                 d_add(cache_dentry, cache_inode);
         }
-        //defines d_delete op to force killing dentry
-        cache_dentry->d_op = &sm_dop;
         
         RETURN(cache_dentry);
 }
@@ -496,7 +524,6 @@ static inline int smfs_do_cow(struct inode *inode)
         return 0;
 }
 
-
 extern int smfs_write_extents(struct inode *dir, struct dentry *dentry,
                               unsigned long from, unsigned long num);
 extern int smfs_rec_precreate(struct dentry *dentry, int *num, struct obdo *oa);