Whamcloud - gitweb
- changes for KML setting and variables in accordance with smfs plugin API
authortappro <tappro>
Mon, 23 May 2005 11:29:34 +0000 (11:29 +0000)
committertappro <tappro>
Mon, 23 May 2005 11:29:34 +0000 (11:29 +0000)
lustre/include/linux/lustre_smfs.h
lustre/lvfs/fsfilt_ext3.c
lustre/mds/mds_fs.c
lustre/obdfilter/filter.c

index 79ed3b4..1507af6 100644 (file)
@@ -76,14 +76,6 @@ struct mds_kml_pack_info {
         int mpi_size[4];
         int mpi_total_size;
 };
         int mpi_size[4];
         int mpi_total_size;
 };
-typedef int (*smfs_hook_func)(struct inode *inode, void *dentry,
-                             void *data1, void *data2, int op, void *handle);
-struct smfs_hook_ops {
-        struct list_head smh_list;
-        char *           smh_name;
-        smfs_hook_func   smh_post_op;
-        smfs_hook_func   smh_pre_op;
-};
 
 struct smfs_super_info {
         struct super_block       *smsi_sb;
 
 struct smfs_super_info {
         struct super_block       *smsi_sb;
@@ -167,6 +159,10 @@ struct fs_extent{
 #define SIZE2BLKS(size, inode) ((size + (I2CI(inode)->i_blksize)) >> (I2CI(inode)->i_blkbits))
 #define OFF2BLKS(off, inode) (off >> (I2CI(inode)->i_blkbits))
 
 #define SIZE2BLKS(size, inode) ((size + (I2CI(inode)->i_blksize)) >> (I2CI(inode)->i_blkbits))
 #define OFF2BLKS(off, inode) (off >> (I2CI(inode)->i_blkbits))
 
+/* SMFS external flags and methods */
+#define SM_ALL_PLG      0x80L
+#define SM_PRECREATE    0x100L
+
 #define SM_DO_REC               0x1
 #define SM_INIT_REC             0x2
 #define SM_CACHE_HOOK           0x4
 #define SM_DO_REC               0x1
 #define SM_INIT_REC             0x2
 #define SM_CACHE_HOOK           0x4
@@ -472,29 +468,6 @@ static inline void post_smfs_dentry(struct dentry *cache_dentry)
         
 }
 
         
 }
 
-/*FIXME there should be more conditions in this check*/
-static inline int smfs_do_rec(struct inode *inode)
-{
-        struct super_block *sb = inode->i_sb;
-        struct smfs_super_info *smfs_info = S2SMI(sb);
-
-        if (SMFS_DO_REC(smfs_info) && SMFS_INIT_REC(smfs_info) &&
-            SMFS_DO_INODE_REC(inode))
-                return 1;
-        return 0;
-}
-
-static inline int smfs_cache_hook(struct inode *inode)
-{
-        struct smfs_super_info  *smfs_info = I2CSB(inode);
-
-        if (SMFS_CACHE_HOOK(smfs_info) && SMFS_INIT_REC(smfs_info) &&
-            SMFS_INODE_CACHE_HOOK(inode))
-                return 1;
-        else
-                return 0;
-}
-
 static inline int smfs_do_cow(struct inode *inode)
 {
         struct super_block *sb = inode->i_sb;
 static inline int smfs_do_cow(struct inode *inode)
 {
         struct super_block *sb = inode->i_sb;
@@ -506,23 +479,9 @@ static inline int smfs_do_cow(struct inode *inode)
 }
 
 
 }
 
 
-/* XXX BUG 3188 -- must return to one set of opcodes */
-#define SMFS_TRANS_OP(inode, op)                \
-{                                               \
-        if (smfs_do_rec(inode))                 \
-                op = op | 0x10;                 \
-        if (smfs_cache_hook(inode))             \
-                op = op | 0x20;                 \
-}
-
-extern int smfs_start_rec(struct super_block *sb, struct vfsmount *mnt);
-extern int smfs_stop_rec(struct super_block *sb);
 extern int smfs_write_extents(struct inode *dir, struct dentry *dentry,
                               unsigned long from, unsigned long num);
 extern int smfs_write_extents(struct inode *dir, struct dentry *dentry,
                               unsigned long from, unsigned long num);
-extern int smfs_rec_setattr(struct inode *dir, struct dentry *dentry,
-                            struct iattr *attr);
 extern int smfs_rec_precreate(struct dentry *dentry, int *num, struct obdo *oa);
 extern int smfs_rec_precreate(struct dentry *dentry, int *num, struct obdo *oa);
-extern int smfs_rec_md(struct inode *inode, void * lmm, int lmm_size);
 extern int smfs_rec_unpack(struct smfs_proc_args *args, char *record,
                            char **pbuf, int *opcode);
 #endif /* _LUSTRE_SMFS_H */
 extern int smfs_rec_unpack(struct smfs_proc_args *args, char *record,
                            char **pbuf, int *opcode);
 #endif /* _LUSTRE_SMFS_H */
index 03c1e04..4bc107d 100644 (file)
@@ -100,26 +100,17 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private,
                 goto journal_start;
         }
 
                 goto journal_start;
         }
 
-        /* XXX BUG 3188 -- must return to one set of opcodes */
-        /* FIXME - cache hook */
-        if (op & 0x20) {
-                nblocks += EXT3_INDEX_EXTRA_TRANS_BLOCKS+EXT3_DATA_TRANS_BLOCKS;
-                op = op & ~0x20;
-        }
-
-        /* FIXME - kml */
-        if (op & 0x10) {
-                nblocks += EXT3_INDEX_EXTRA_TRANS_BLOCKS+EXT3_DATA_TRANS_BLOCKS;
-                op = op & ~0x10;
-        }
-
+       if (logs)
+               nblocks += (EXT3_INDEX_EXTRA_TRANS_BLOCKS +
+                            EXT3_SINGLEDATA_TRANS_BLOCKS) * logs;
+                
         switch(op) {
         case FSFILT_OP_RMDIR:
         case FSFILT_OP_UNLINK:
                 /* delete one file + create/update logs for each stripe */
                 nblocks += EXT3_DELETE_TRANS_BLOCKS;
         switch(op) {
         case FSFILT_OP_RMDIR:
         case FSFILT_OP_UNLINK:
                 /* delete one file + create/update logs for each stripe */
                 nblocks += EXT3_DELETE_TRANS_BLOCKS;
-                nblocks += (EXT3_INDEX_EXTRA_TRANS_BLOCKS +
-                            EXT3_SINGLEDATA_TRANS_BLOCKS) * logs;
+                /*nblocks += (EXT3_INDEX_EXTRA_TRANS_BLOCKS +
+                            EXT3_SINGLEDATA_TRANS_BLOCKS) * logs;*/
                 break;
         case FSFILT_OP_RENAME:
                 /* modify additional directory */
                 break;
         case FSFILT_OP_RENAME:
                 /* modify additional directory */
@@ -131,8 +122,8 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private,
                 /* no break */
         case FSFILT_OP_CREATE:
                 /* create/update logs for each stripe */
                 /* no break */
         case FSFILT_OP_CREATE:
                 /* create/update logs for each stripe */
-                nblocks += (EXT3_INDEX_EXTRA_TRANS_BLOCKS +
-                            EXT3_SINGLEDATA_TRANS_BLOCKS) * logs;
+                /*nblocks += (EXT3_INDEX_EXTRA_TRANS_BLOCKS +
+                            EXT3_SINGLEDATA_TRANS_BLOCKS) * logs;*/
                 /* no break */
         case FSFILT_OP_MKDIR:
         case FSFILT_OP_MKNOD:
                 /* no break */
         case FSFILT_OP_MKDIR:
         case FSFILT_OP_MKNOD:
index e083e55..0900cd8 100644 (file)
@@ -444,20 +444,7 @@ static int mds_fs_post_setup(struct obd_device *obd)
         }
         
         rc = fsfilt_post_setup(obd, dentry);
         }
         
         rc = fsfilt_post_setup(obd, dentry);
-        if (rc)
-                goto out_dentry;
-
-        LASSERT(dentry->d_inode != NULL);
-        
-        fsfilt_set_fs_flags(obd, dentry->d_inode, 
-                            SM_DO_REC | SM_DO_COW);
-        
-        fsfilt_set_fs_flags(obd, mds->mds_pending_dir->d_inode, 
-                            SM_DO_REC | SM_DO_COW);
-        
-        fsfilt_set_mds_flags(obd, mds->mds_sb);
 
 
-out_dentry:
         l_dput(dentry);
         RETURN(rc); 
 }
         l_dput(dentry);
         RETURN(rc); 
 }
index 218e188..3852fc7 100644 (file)
@@ -1383,7 +1383,7 @@ static int filter_post_fs_cleanup(struct obd_device *obd)
 
         RETURN(rc);
 }
 
         RETURN(rc);
 }
-
+#if 0
 static int filter_group_set_fs_flags(struct obd_device *obd, int group)
 {
         struct filter_obd *filter = &obd->u.filter;
 static int filter_group_set_fs_flags(struct obd_device *obd, int group)
 {
         struct filter_obd *filter = &obd->u.filter;
@@ -1403,29 +1403,14 @@ static int filter_group_set_fs_flags(struct obd_device *obd, int group)
         }
         RETURN(rc);
 }
         }
         RETURN(rc);
 }
+#endif
 static int filter_post_fs_setup(struct obd_device *obd)
 {
         struct filter_obd *filter = &obd->u.filter;
 static int filter_post_fs_setup(struct obd_device *obd)
 {
         struct filter_obd *filter = &obd->u.filter;
-        int rc = 0, j = 0;
-        struct llog_ctxt *ctxt = NULL;
-
-        rc = fsfilt_post_setup(obd, filter->fo_dentry_O);
-        if (rc)
-                RETURN(rc);
+        int rc = 0;
         
         
-        for (j = 0; j < filter->fo_group_count; j++) {
-                rc = filter_group_set_fs_flags(obd, j);
-                if (rc)
-                        return rc;
-        } 
+        rc = fsfilt_post_setup(obd, filter->fo_dentry_O);
 
 
-        fsfilt_get_reint_log_ctxt(obd, filter->fo_sb, &ctxt);
-        if (ctxt) {
-                ctxt->loc_obd = obd;
-                ctxt->loc_idx = LLOG_REINT_ORIG_CTXT;
-                obd->obd_llog_ctxt[LLOG_REINT_ORIG_CTXT] = ctxt;
-        }
-        fsfilt_set_ost_flags(obd, filter->fo_sb);
         return rc;
 }
 
         return rc;
 }
 
@@ -1741,12 +1726,13 @@ static int filter_connect(struct lustre_handle *conn, struct obd_device *obd,
                 CERROR("can't read group %u\n", group);
                 GOTO(cleanup, rc);
         }
                 CERROR("can't read group %u\n", group);
                 GOTO(cleanup, rc);
         }
+#if 0
         rc = filter_group_set_fs_flags(obd, group);
         if (rc != 0) {
                 CERROR("can't set kml flags %u\n", group);
                 GOTO(cleanup, rc);
         }
         rc = filter_group_set_fs_flags(obd, group);
         if (rc != 0) {
                 CERROR("can't set kml flags %u\n", group);
                 GOTO(cleanup, rc);
         }
-
+#endif
 cleanup:
         if (rc) {
                 if (fcd)
 cleanup:
         if (rc) {
                 if (fcd)
@@ -2394,8 +2380,8 @@ static int filter_precreate(struct obd_device *obd, struct obdo *oa,
                         GOTO(cleanup, rc = PTR_ERR(dparent));
                 cleanup_phase = 1;
 
                         GOTO(cleanup, rc = PTR_ERR(dparent));
                 cleanup_phase = 1;
 
-                /*only do precreate rec record. so clean kml flags here*/
-                fsfilt_clear_fs_flags(obd, dparent->d_inode, SM_DO_REC);
+                /* precreate objects are not logged */
+                fsfilt_set_fs_flags(obd, dparent->d_inode, SM_PRECREATE);
 
                 dchild = filter_id2dentry(obd, dparent, group, next_id);
                 if (IS_ERR(dchild))
 
                 dchild = filter_id2dentry(obd, dparent, group, next_id);
                 if (IS_ERR(dchild))