Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Tue, 9 Oct 2007 06:00:56 +0000 (06:00 +0000)
committeryangsheng <yangsheng>
Tue, 9 Oct 2007 06:00:56 +0000 (06:00 +0000)
b=13568
i=adilger
i=kalpak

Remove lock_24kernel() from lvfs subsystem.

lustre/ChangeLog
lustre/lvfs/fsfilt_ext3.c
lustre/lvfs/fsfilt_reiserfs.c
lustre/lvfs/lvfs_linux.c
lustre/lvfs/upcall_cache.c

index 4c84cec..a5465fb 100644 (file)
@@ -375,7 +375,8 @@ Details    : Remove 2.5.0 check from quota_check.c, quota_ctl.c,
              quota_interface.c in quota subsystem.
             Remove 2.4 kernel check from obd_mount.c, linux/linux-sysctl.c in
              obdclass subsystem.
-
+             Remove lock_24kernel from fsfilt_ext3.c fsfilt_reiserfs.c 
+             lvfs_linux.c upcall_cache.c in lvfs subsystem.
 
 
 --------------------------------------------------------------------------------
index cef899b..1e2b951 100644 (file)
@@ -91,9 +91,7 @@ static int fsfilt_ext3_set_label(struct super_block *sb, char *label)
         int err;
 
         journal = EXT3_SB(sb)->s_journal;
-        lock_24kernel();
         handle = journal_start(journal, 1);
-        unlock_24kernel();
         if (IS_ERR(handle)) {
                 CERROR("can't start transaction\n");
                 return(PTR_ERR(handle));
@@ -109,9 +107,7 @@ static int fsfilt_ext3_set_label(struct super_block *sb, char *label)
         err = ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
 
 out:
-        lock_24kernel();
         journal_stop(handle);
-        unlock_24kernel();
 
         return(err);
 }
@@ -251,9 +247,7 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private,
 
  journal_start:
         LASSERTF(nblocks > 0, "can't start %d credit transaction\n", nblocks);
-        lock_24kernel();
         handle = fsfilt_ext3_journal_start(inode, nblocks);
-        unlock_24kernel();
 
         if (!IS_ERR(handle))
                 LASSERT(current->journal_info == handle);
@@ -390,9 +384,7 @@ static void *fsfilt_ext3_brw_start(int objcount, struct fsfilt_objinfo *fso,
         }
 
         LASSERTF(needed > 0, "can't start %d credit transaction\n", needed);
-        lock_24kernel();
         handle = fsfilt_ext3_journal_start(fso->fso_dentry->d_inode, needed);
-        unlock_24kernel();
         if (IS_ERR(handle)) {
                 CERROR("can't get handle for %d credits: rc = %ld\n", needed,
                        PTR_ERR(handle));
@@ -432,9 +424,7 @@ static int fsfilt_ext3_commit(struct inode *inode, void *h, int force_sync)
         if (force_sync)
                 handle->h_sync = 1; /* recovery likes this */
 
-        lock_24kernel();
         rc = fsfilt_ext3_journal_stop(handle);
-        unlock_24kernel();
 
         return rc;
 }
@@ -450,7 +440,6 @@ static int fsfilt_ext3_commit_async(struct inode *inode, void *h,
 
         LASSERT(current->journal_info == handle);
 
-        lock_24kernel();
         transaction = handle->h_transaction;
         journal = transaction->t_journal;
         tid = transaction->t_tid;
@@ -459,18 +448,9 @@ static int fsfilt_ext3_commit_async(struct inode *inode, void *h,
         rc = fsfilt_ext3_journal_stop(handle);
         if (rc) {
                 CERROR("error while stopping transaction: %d\n", rc);
-                unlock_24kernel();
                 return rc;
         }
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-        rtid = log_start_commit(journal, transaction);
-        if (rtid != tid)
-                CERROR("strange race: %lu != %lu\n",
-                       (unsigned long) tid, (unsigned long) rtid);
-#else
         log_start_commit(journal, tid);
-#endif
-        unlock_24kernel();
 
         *wait_handle = (void *) tid;
         CDEBUG(D_INODE, "commit async: %lu\n", (unsigned long) tid);
@@ -582,11 +562,9 @@ static int fsfilt_ext3_set_md(struct inode *inode, void *handle,
 
         LASSERT(TRYLOCK_INODE_MUTEX(inode) == 0);
 
-        lock_24kernel();
         rc = ext3_xattr_set_handle(handle, inode, EXT3_XATTR_INDEX_TRUSTED,
                                    name, lmm, lmm_size, 0);
 
-        unlock_24kernel();
 
         if (rc)
                 CERROR("error adding MD data to inode %lu: rc = %d\n",
@@ -601,11 +579,9 @@ static int fsfilt_ext3_get_md(struct inode *inode, void *lmm, int lmm_size,
         int rc;
 
         LASSERT(TRYLOCK_INODE_MUTEX(inode) == 0);
-        lock_24kernel();
 
         rc = ext3_xattr_get(inode, EXT3_XATTR_INDEX_TRUSTED,
                             name, lmm, lmm_size);
-        unlock_24kernel();
 
         /* This gives us the MD size */
         if (lmm == NULL)
@@ -709,10 +685,8 @@ static int fsfilt_ext3_add_journal_cb(struct obd_device *obd, __u64 last_rcvd,
         fcb->cb_data = cb_data;
 
         CDEBUG(D_EXT2, "set callback for last_rcvd: "LPD64"\n", last_rcvd);
-        lock_24kernel();
         journal_callback_set(handle, fsfilt_ext3_cb_func,
                              (struct journal_callback *)fcb);
-        unlock_24kernel();
 
         return 0;
 }
@@ -837,9 +811,7 @@ static unsigned long new_blocks(handle_t *handle, struct ext3_extents_tree *tree
 
         goal = ext3_ext_find_goal(tree->inode, path, block, &aflags);
         aflags |= 2; /* block have been already reserved */
-        lock_24kernel();
         pblock = ext3_mb_new_blocks(handle, tree->inode, goal, count, aflags, err);
-        unlock_24kernel();
         return pblock;
 
 }
@@ -919,9 +891,7 @@ static int ext3_ext_new_extent_cb(struct ext3_extents_tree *tree,
         count = ext3_ext_calc_credits_for_insert(tree, path);
         ext3_up_truncate_sem(inode);
 
-        lock_24kernel();
         handle = fsfilt_ext3_journal_start(inode, count+EXT3_ALLOC_NEEDED+1);
-        unlock_24kernel();
         if (IS_ERR(handle)) {
                 ext3_down_truncate_sem(inode);
                 return PTR_ERR(handle);
@@ -930,9 +900,7 @@ static int ext3_ext_new_extent_cb(struct ext3_extents_tree *tree,
         ext3_down_truncate_sem(inode);
         if (tgen != EXT_GENERATION(tree)) {
                 /* the tree has changed. so path can be invalid at moment */
-                lock_24kernel();
                 fsfilt_ext3_journal_stop(handle);
-                unlock_24kernel();
                 return EXT_REPEAT;
         }
 
@@ -965,9 +933,7 @@ static int ext3_ext_new_extent_cb(struct ext3_extents_tree *tree,
         BUG_ON(nex.ee_block != cex->ec_block);
 
 out:
-        lock_24kernel();
         fsfilt_ext3_journal_stop(handle);
-        unlock_24kernel();
 map:
         if (err >= 0) {
                 /* map blocks */
@@ -1260,10 +1226,8 @@ static int fsfilt_ext3_write_record(struct file *file, void *buf, int bufsize,
         block_count = (*offs & (blocksize - 1)) + bufsize;
         block_count = (block_count + blocksize - 1) >> inode->i_blkbits;
 
-        lock_24kernel();
         handle = fsfilt_ext3_journal_start(inode,
                                block_count * FSFILT_DATA_TRANS_BLOCKS(inode->i_sb) + 2);
-        unlock_24kernel();
         if (IS_ERR(handle)) {
                 CERROR("can't start transaction for %d blocks (%d bytes)\n",
                        block_count * FSFILT_DATA_TRANS_BLOCKS(inode->i_sb) + 2, bufsize);
@@ -1275,9 +1239,7 @@ static int fsfilt_ext3_write_record(struct file *file, void *buf, int bufsize,
         if (!err && force_sync)
                 handle->h_sync = 1; /* recovery likes this */
 
-        lock_24kernel();
         fsfilt_ext3_journal_stop(handle);
-        unlock_24kernel();
 
         return err;
 }
index f03f853..168ad00 100644 (file)
 #include <linux/pagemap.h>
 #include <linux/quotaops.h>
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
 #include <linux/init.h>
 #include <asm/statfs.h>
-#endif
 #include <libcfs/kp30.h>
 #include <lustre_fsfilt.h>
 #include <obd.h>
index 442d3fb..7d26d82 100644 (file)
@@ -72,25 +72,10 @@ static void push_group_info(struct lvfs_run_ctxt *save,
                 save->ngroups = current_ngroups;
                 current_ngroups = 0;
         } else {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
                 task_lock(current);
                 save->group_info = current->group_info;
                 current->group_info = ginfo;
                 task_unlock(current);
-#else
-                LASSERT(ginfo->ngroups <= NGROUPS);
-                LASSERT(current->ngroups <= NGROUPS_SMALL);
-                /* save old */
-                save->group_info.ngroups = current->ngroups;
-                if (current->ngroups)
-                        memcpy(save->group_info.small_block, current->groups,
-                               current->ngroups * sizeof(gid_t));
-                /* push new */
-                current->ngroups = ginfo->ngroups;
-                if (ginfo->ngroups)
-                        memcpy(current->groups, ginfo->small_block,
-                               current->ngroups * sizeof(gid_t));
-#endif
         }
 }
 
@@ -100,16 +85,9 @@ static void pop_group_info(struct lvfs_run_ctxt *save,
         if (!ginfo) {
                 current_ngroups = save->ngroups;
         } else {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
                 task_lock(current);
                 current->group_info = save->group_info;
                 task_unlock(current);
-#else
-                current->ngroups = save->group_info.ngroups;
-                if (current->ngroups)
-                        memcpy(current->groups, save->group_info.small_block,
-                               current->ngroups * sizeof(gid_t));
-#endif
         }
 }
 
index 468d4af..eea4ae5 100644 (file)
 #include <obd_support.h>
 #include <lustre_lib.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4)
-struct group_info *groups_alloc(int ngroups)
-{
-        struct group_info *ginfo;
-
-        LASSERT(ngroups <= NGROUPS_SMALL);
-
-        OBD_ALLOC(ginfo, sizeof(*ginfo) + 1 * sizeof(gid_t *));
-        if (!ginfo)
-                return NULL;
-        ginfo->ngroups = ngroups;
-        ginfo->nblocks = 1;
-        ginfo->blocks[0] = ginfo->small_block;
-        atomic_set(&ginfo->usage, 1);
-
-        return ginfo;
-}
-
-void groups_free(struct group_info *ginfo)
-{
-        LASSERT(ginfo->ngroups <= NGROUPS_SMALL);
-        LASSERT(ginfo->nblocks == 1);
-        LASSERT(ginfo->blocks[0] == ginfo->small_block);
-
-        OBD_FREE(ginfo, sizeof(*ginfo) + 1 * sizeof(gid_t *));
-}
-#endif
-
 static struct upcall_cache_entry *alloc_entry(struct upcall_cache *cache,
                                               __u64 key, void *args)
 {