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));
err = ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
out:
- lock_24kernel();
journal_stop(handle);
- unlock_24kernel();
return(err);
}
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);
}
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));
if (force_sync)
handle->h_sync = 1; /* recovery likes this */
- lock_24kernel();
rc = fsfilt_ext3_journal_stop(handle);
- unlock_24kernel();
return rc;
}
LASSERT(current->journal_info == handle);
- lock_24kernel();
transaction = handle->h_transaction;
journal = transaction->t_journal;
tid = transaction->t_tid;
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);
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",
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)
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;
}
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;
}
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);
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;
}
BUG_ON(nex.ee_block != cex->ec_block);
out:
- lock_24kernel();
fsfilt_ext3_journal_stop(handle);
- unlock_24kernel();
map:
if (err >= 0) {
/* map blocks */
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);
if (!err && force_sync)
handle->h_sync = 1; /* recovery likes this */
- lock_24kernel();
fsfilt_ext3_journal_stop(handle);
- unlock_24kernel();
return err;
}
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
}
}
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
}
}
#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)
{