[Ocfs2-commits] mfasheh commits r2356 - trunk/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Jun 1 22:51:01 CDT 2005
Author: mfasheh
Signed-off-by: manish
Signed-off-by: jlbec
Date: 2005-06-01 22:50:59 -0500 (Wed, 01 Jun 2005)
New Revision: 2356
Modified:
trunk/fs/ocfs2/aio.c
trunk/fs/ocfs2/aio.h
trunk/fs/ocfs2/alloc.c
trunk/fs/ocfs2/alloc.h
trunk/fs/ocfs2/aops.c
trunk/fs/ocfs2/buffer_head_io.c
trunk/fs/ocfs2/buffer_head_io.h
trunk/fs/ocfs2/dcache.c
trunk/fs/ocfs2/dcache.h
trunk/fs/ocfs2/dir.c
trunk/fs/ocfs2/dir.h
trunk/fs/ocfs2/dlmglue.c
trunk/fs/ocfs2/dlmglue.h
trunk/fs/ocfs2/extent_map.c
trunk/fs/ocfs2/file.c
trunk/fs/ocfs2/file.h
trunk/fs/ocfs2/heartbeat.c
trunk/fs/ocfs2/heartbeat.h
trunk/fs/ocfs2/inode.c
trunk/fs/ocfs2/inode.h
trunk/fs/ocfs2/journal.c
trunk/fs/ocfs2/journal.h
trunk/fs/ocfs2/localalloc.c
trunk/fs/ocfs2/localalloc.h
trunk/fs/ocfs2/mmap.c
trunk/fs/ocfs2/mmap.h
trunk/fs/ocfs2/namei.c
trunk/fs/ocfs2/namei.h
trunk/fs/ocfs2/ocfs.h
trunk/fs/ocfs2/ocfs2_fs.h
trunk/fs/ocfs2/proc.c
trunk/fs/ocfs2/proc.h
trunk/fs/ocfs2/slot_map.c
trunk/fs/ocfs2/slot_map.h
trunk/fs/ocfs2/suballoc.c
trunk/fs/ocfs2/suballoc.h
trunk/fs/ocfs2/super.c
trunk/fs/ocfs2/super.h
trunk/fs/ocfs2/symlink.c
trunk/fs/ocfs2/symlink.h
trunk/fs/ocfs2/sysfile.c
trunk/fs/ocfs2/sysfile.h
trunk/fs/ocfs2/vote.c
trunk/fs/ocfs2/vote.h
Log:
* namespace cleanups
Signed-off-by: manish
Signed-off-by: jlbec
Modified: trunk/fs/ocfs2/aio.c
===================================================================
--- trunk/fs/ocfs2/aio.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/aio.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -50,7 +50,7 @@
struct ocfs2_kiocb_private {
struct list_head kp_teardown_item;
- ocfs_super *kp_osb;
+ ocfs2_super *kp_osb;
struct list_head kp_pending_item;
unsigned kp_have_alloc_sem:1,
kp_have_write_locks:1;
@@ -78,7 +78,7 @@
void okp_teardown_from_list(void *data)
{
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
unsigned long flags;
struct list_head *pos, *tmp;
struct ocfs2_kiocb_private *okp;
@@ -114,7 +114,7 @@
{
struct ocfs2_kiocb_private *okp = iocb->private;
unsigned long flags;
- ocfs_super *osb = okp->kp_osb;
+ ocfs2_super *osb = okp->kp_osb;
mlog(0, "iocb %p okp %p\n", iocb, okp);
@@ -145,7 +145,7 @@
spin_unlock_irqrestore(&osb->osb_okp_teardown_lock, flags);
}
-static int okp_pending_empty(ocfs_super *osb)
+static int okp_pending_empty(ocfs2_super *osb)
{
unsigned long flags;
int empty;
@@ -158,7 +158,7 @@
}
/* see ocfs2_ki_dtor */
-void ocfs2_wait_for_okp_destruction(ocfs_super *osb)
+void ocfs2_wait_for_okp_destruction(ocfs2_super *osb)
{
/* first wait for okps to enter the work queue */
wait_event(osb->osb_okp_pending_wq, okp_pending_empty(osb));
@@ -187,7 +187,7 @@
struct inode *inode = iocb->ki_filp->f_dentry->d_inode;
struct ocfs2_kiocb_private *okp;
unsigned long flags;
- ocfs_super *osb;
+ ocfs2_super *osb;
okp = kcalloc(1, sizeof(*okp), GFP_KERNEL);
if (okp == NULL) {
@@ -318,10 +318,10 @@
}
if (!okp->kp_have_write_locks) {
- ret = ocfs_write_lock_maybe_extend(filp, buf, count,
- &iocb->ki_pos,
- &okp->kp_info,
- &okp->kp_ctxt);
+ ret = ocfs2_write_lock_maybe_extend(filp, buf, count,
+ &iocb->ki_pos,
+ &okp->kp_info,
+ &okp->kp_ctxt);
okp->kp_have_write_locks = 1;
if (okp->kp_info.wl_extended) {
/*
Modified: trunk/fs/ocfs2/aio.h
===================================================================
--- trunk/fs/ocfs2/aio.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/aio.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -32,6 +32,6 @@
loff_t pos);
void okp_teardown_from_list(void *data);
-void ocfs2_wait_for_okp_destruction(ocfs_super *osb);
+void ocfs2_wait_for_okp_destruction(ocfs2_super *osb);
#endif /* OCFS2_AIO_H */
Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/alloc.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -46,52 +46,54 @@
#include "buffer_head_io.h"
-static int ocfs_extent_contig(struct inode *inode, ocfs2_extent_rec *ext,
- u64 blkno);
+static int ocfs2_extent_contig(struct inode *inode,
+ ocfs2_extent_rec *ext,
+ u64 blkno);
-static int ocfs_create_new_meta_bhs(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *inode,
- int wanted,
- ocfs2_alloc_context *meta_ac,
- struct buffer_head *bhs[]);
+static int ocfs2_create_new_meta_bhs(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ int wanted,
+ ocfs2_alloc_context *meta_ac,
+ struct buffer_head *bhs[]);
-static int ocfs2_add_branch(ocfs_super *osb,
- ocfs_journal_handle *handle,
+static int ocfs2_add_branch(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
struct buffer_head *eb_bh,
struct buffer_head *last_eb_bh,
ocfs2_alloc_context *meta_ac);
-static int ocfs2_shift_tree_depth(ocfs_super *osb,
- ocfs_journal_handle *handle,
+static int ocfs2_shift_tree_depth(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
ocfs2_alloc_context *meta_ac,
struct buffer_head **ret_new_eb_bh);
-static int ocfs2_do_insert_extent(ocfs_super *osb,
- ocfs_journal_handle *handle,
+static int ocfs2_do_insert_extent(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 blkno,
u32 new_clusters);
-static int ocfs2_find_branch_target(ocfs_super *osb,
+static int ocfs2_find_branch_target(ocfs2_super *osb,
struct inode *inode,
struct buffer_head *fe_bh,
struct buffer_head **target_bh);
-static int ocfs_find_new_last_ext_blk(ocfs_super *osb,
- struct inode *inode,
- ocfs2_dinode *fe,
- unsigned int new_i_clusters,
- struct buffer_head *old_last_eb,
- struct buffer_head **new_last_eb);
+static int ocfs2_find_new_last_ext_blk(ocfs2_super *osb,
+ struct inode *inode,
+ ocfs2_dinode *fe,
+ unsigned int new_i_clusters,
+ struct buffer_head *old_last_eb,
+ struct buffer_head **new_last_eb);
-static int ocfs_extent_contig(struct inode *inode, ocfs2_extent_rec *ext,
- u64 blkno)
+static int ocfs2_extent_contig(struct inode *inode,
+ ocfs2_extent_rec *ext,
+ u64 blkno)
{
return blkno == (ext->e_blkno +
ocfs2_clusters_to_blocks(inode->i_sb,
@@ -101,9 +103,9 @@
/*
* How many free extents have we got before we need more meta data?
*/
-int ocfs_num_free_extents(ocfs_super *osb,
- struct inode *inode,
- ocfs2_dinode *fe)
+int ocfs2_num_free_extents(ocfs2_super *osb,
+ struct inode *inode,
+ ocfs2_dinode *fe)
{
int retval;
ocfs2_extent_list *el;
@@ -115,8 +117,8 @@
OCFS2_BUG_ON_INVALID_DINODE(fe);
if (fe->i_last_eb_blk) {
- retval = ocfs_read_block(osb, fe->i_last_eb_blk, &eb_bh,
- OCFS_BH_CACHED, inode);
+ retval = ocfs2_read_block(osb, fe->i_last_eb_blk, &eb_bh,
+ OCFS2_BH_CACHED, inode);
if (retval < 0) {
mlog_errno(retval);
goto bail;
@@ -126,7 +128,7 @@
} else
el = &fe->id2.i_list;
- OCFS_ASSERT(el->l_tree_depth == 0);
+ OCFS2_ASSERT(el->l_tree_depth == 0);
retval = el->l_count - el->l_next_free_rec;
bail:
@@ -137,17 +139,17 @@
return retval;
}
-/* expects array to already be malloced
+/* expects array to already be allocated
*
* sets h_signature, h_blkno, h_suballoc_bit, h_suballoc_slot, and
* l_count for you
*/
-static int ocfs_create_new_meta_bhs(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *inode,
- int wanted,
- ocfs2_alloc_context *meta_ac,
- struct buffer_head *bhs[])
+static int ocfs2_create_new_meta_bhs(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ int wanted,
+ ocfs2_alloc_context *meta_ac,
+ struct buffer_head *bhs[])
{
int count, status, i;
u16 suballoc_bit_start;
@@ -159,13 +161,13 @@
count = 0;
while (count < wanted) {
- status = ocfs_claim_metadata(osb,
- handle,
- meta_ac,
- wanted - count,
- &suballoc_bit_start,
- &num_got,
- &first_blkno);
+ status = ocfs2_claim_metadata(osb,
+ handle,
+ meta_ac,
+ wanted - count,
+ &suballoc_bit_start,
+ &num_got,
+ &first_blkno);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -181,8 +183,8 @@
set_buffer_uptodate(bhs[i]);
ocfs2_set_bh_seqnum(inode, bhs[i]);
- status = ocfs_journal_access(handle, inode, bhs[i],
- OCFS_JOURNAL_ACCESS_CREATE);
+ status = ocfs2_journal_access(handle, inode, bhs[i],
+ OCFS2_JOURNAL_ACCESS_CREATE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -195,7 +197,7 @@
eb->h_blkno = cpu_to_le64(first_blkno);
eb->h_fs_generation = cpu_to_le32(osb->fs_generation);
-#ifndef OCFS_USE_ALL_METADATA_SUBALLOCATORS
+#ifndef OCFS2_USE_ALL_METADATA_SUBALLOCATORS
/* we always use slot zero's suballocator */
eb->h_suballoc_slot = 0;
#else
@@ -209,7 +211,7 @@
/* We'll also be dirtied by the caller, so
* this isn't absolutely necessary. */
- status = ocfs_journal_dirty(handle, bhs[i]);
+ status = ocfs2_journal_dirty(handle, bhs[i]);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -233,8 +235,6 @@
}
/*
- * ocfs2_add_branch()
- *
* Add an entire tree branch to our inode. eb_bh is the extent block
* to start at, if we don't want to start the branch at the dinode
* structure.
@@ -245,8 +245,8 @@
* the new branch will be 'empty' in the sense that every block will
* contain a single record with e_clusters == 0.
*/
-static int ocfs2_add_branch(ocfs_super *osb,
- ocfs_journal_handle *handle,
+static int ocfs2_add_branch(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
struct buffer_head *eb_bh,
@@ -264,7 +264,7 @@
mlog_entry_void();
- OCFS_ASSERT(last_eb_bh);
+ OCFS2_ASSERT(last_eb_bh);
fe = (ocfs2_dinode *) fe_bh->b_data;
@@ -275,7 +275,7 @@
el = &fe->id2.i_list;
/* we never add a branch to a leaf. */
- OCFS_ASSERT(el->l_tree_depth);
+ OCFS2_ASSERT(el->l_tree_depth);
new_blocks = el->l_tree_depth;
@@ -289,8 +289,8 @@
}
memset(new_eb_bhs, 0, size);
- status = ocfs_create_new_meta_bhs(osb, handle, inode, new_blocks,
- meta_ac, new_eb_bhs);
+ status = ocfs2_create_new_meta_bhs(osb, handle, inode, new_blocks,
+ meta_ac, new_eb_bhs);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -310,8 +310,8 @@
OCFS2_BUG_ON_INVALID_EXTENT_BLOCK(eb);
eb_el = &eb->h_list;
- status = ocfs_journal_access(handle, inode, bh,
- OCFS_JOURNAL_ACCESS_CREATE);
+ status = ocfs2_journal_access(handle, inode, bh,
+ OCFS2_JOURNAL_ACCESS_CREATE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -326,7 +326,7 @@
if (!eb_el->l_tree_depth)
new_last_eb_blk = le64_to_cpu(eb->h_blkno);
- status = ocfs_journal_dirty(handle, bh);
+ status = ocfs2_journal_dirty(handle, bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -341,21 +341,21 @@
* journal_dirty erroring as it won't unless we've aborted the
* handle (in which case we would never be here) so reserving
* the write with journal_access is all we need to do. */
- status = ocfs_journal_access(handle, inode, last_eb_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, last_eb_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_journal_access(handle, inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
}
if (eb_bh) {
- status = ocfs_journal_access(handle, inode, eb_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, eb_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -377,14 +377,14 @@
eb = (ocfs2_extent_block *) last_eb_bh->b_data;
eb->h_next_leaf_blk = new_last_eb_blk;
- status = ocfs_journal_dirty(handle, last_eb_bh);
+ status = ocfs2_journal_dirty(handle, last_eb_bh);
if (status < 0)
mlog_errno(status);
- status = ocfs_journal_dirty(handle, fe_bh);
+ status = ocfs2_journal_dirty(handle, fe_bh);
if (status < 0)
mlog_errno(status);
if (eb_bh) {
- status = ocfs_journal_dirty(handle, eb_bh);
+ status = ocfs2_journal_dirty(handle, eb_bh);
if (status < 0)
mlog_errno(status);
}
@@ -403,14 +403,12 @@
}
/*
- * ocfs2_shift_tree_depth()
- *
* adds another level to the allocation tree.
* returns back the new extent block so you can add a branch to it
* after this call.
*/
-static int ocfs2_shift_tree_depth(ocfs_super *osb,
- ocfs_journal_handle *handle,
+static int ocfs2_shift_tree_depth(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
ocfs2_alloc_context *meta_ac,
@@ -425,8 +423,8 @@
mlog_entry_void();
- status = ocfs_create_new_meta_bhs(osb, handle, inode, 1, meta_ac,
- &new_eb_bh);
+ status = ocfs2_create_new_meta_bhs(osb, handle, inode, 1, meta_ac,
+ &new_eb_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -438,8 +436,8 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
fe_el = &fe->id2.i_list;
- status = ocfs_journal_access(handle, inode, new_eb_bh,
- OCFS_JOURNAL_ACCESS_CREATE);
+ status = ocfs2_journal_access(handle, inode, new_eb_bh,
+ OCFS2_JOURNAL_ACCESS_CREATE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -454,14 +452,14 @@
eb_el->l_recs[i].e_blkno = fe_el->l_recs[i].e_blkno;
}
- status = ocfs_journal_dirty(handle, new_eb_bh);
+ status = ocfs2_journal_dirty(handle, new_eb_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_journal_access(handle, inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -484,7 +482,7 @@
if (fe_el->l_tree_depth == 1)
fe->i_last_eb_blk = eb->h_blkno;
- status = ocfs_journal_dirty(handle, fe_bh);
+ status = ocfs2_journal_dirty(handle, fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -502,14 +500,12 @@
}
/*
- * ocfs2_do_insert_extent()
- *
* Expects the tree to already have room in the rightmost leaf for the
* extent. Updates all the extent blocks (and the dinode) on the way
* down.
*/
-static int ocfs2_do_insert_extent(ocfs_super *osb,
- ocfs_journal_handle *handle,
+static int ocfs2_do_insert_extent(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 start_blk,
@@ -524,8 +520,8 @@
mlog_entry_void();
- status = ocfs_journal_access(handle, inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -542,7 +538,7 @@
* journal write to them before making any changes. */
num_bhs = fe->id2.i_list.l_tree_depth;
eb_bhs = kmalloc(sizeof(struct buffer_head *) * num_bhs,
- GFP_KERNEL);
+ GFP_KERNEL);
if (!eb_bhs) {
status = -ENOMEM;
mlog_errno(status);
@@ -552,12 +548,12 @@
i = 0;
while(el->l_tree_depth) {
- OCFS_ASSERT_RO(el->l_next_free_rec);
+ OCFS2_ASSERT_RO(el->l_next_free_rec);
next_blkno = el->l_recs[el->l_next_free_rec-1].e_blkno;
- OCFS_ASSERT(i < num_bhs);
- status = ocfs_read_block(osb, next_blkno, &eb_bhs[i],
- OCFS_BH_CACHED, inode);
+ OCFS2_ASSERT(i < num_bhs);
+ status = ocfs2_read_block(osb, next_blkno, &eb_bhs[i],
+ OCFS2_BH_CACHED, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -565,8 +561,8 @@
eb = (ocfs2_extent_block *) eb_bhs[i]->b_data;
OCFS2_BUG_ON_INVALID_EXTENT_BLOCK(eb);
- status = ocfs_journal_access(handle, inode, eb_bhs[i],
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, eb_bhs[i],
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -577,14 +573,14 @@
/* When we leave this loop, eb_bhs[num_bhs - 1] will
* hold the bottom-most leaf extent block. */
}
- OCFS_ASSERT(!el->l_tree_depth);
+ OCFS2_ASSERT(!el->l_tree_depth);
el = &fe->id2.i_list;
/* If we have tree depth, then the fe update is
* trivial, and we want to switch el out for the
* bottom-most leaf in order to update it with the
* actual extent data below. */
- OCFS_ASSERT_RO(el->l_next_free_rec);
+ OCFS2_ASSERT_RO(el->l_next_free_rec);
el->l_recs[el->l_next_free_rec - 1].e_clusters += new_clusters;
/* (num_bhs - 1) to avoid the leaf */
for(i = 0; i < (num_bhs - 1); i++) {
@@ -594,36 +590,36 @@
/* finally, make our actual change to the
* intermediate extent blocks. */
el->l_recs[el->l_next_free_rec - 1].e_clusters
- += new_clusters;
+ += new_clusters;
- status = ocfs_journal_dirty(handle, eb_bhs[i]);
+ status = ocfs2_journal_dirty(handle, eb_bhs[i]);
if (status < 0)
mlog_errno(status);
}
- OCFS_ASSERT(i == (num_bhs - 1));
+ OCFS2_ASSERT(i == (num_bhs - 1));
/* note that the leaf block wasn't touched in
* the loop above */
eb = (ocfs2_extent_block *) eb_bhs[num_bhs - 1]->b_data;
el = &eb->h_list;
- OCFS_ASSERT(!el->l_tree_depth);
+ OCFS2_ASSERT(!el->l_tree_depth);
}
/* yay, we can finally add the actual extent now! */
i = el->l_next_free_rec - 1;
- if (el->l_next_free_rec && ocfs_extent_contig(inode,
- &el->l_recs[i],
- start_blk)) {
+ if (el->l_next_free_rec && ocfs2_extent_contig(inode,
+ &el->l_recs[i],
+ start_blk)) {
el->l_recs[i].e_clusters += new_clusters;
} else if (el->l_next_free_rec && !el->l_recs[i].e_clusters) {
/* having an empty extent at eof is legal. */
- OCFS_ASSERT_RO(el->l_recs[i].e_cpos == fe->i_clusters);
+ OCFS2_ASSERT_RO(el->l_recs[i].e_cpos == fe->i_clusters);
el->l_recs[i].e_blkno = start_blk;
el->l_recs[i].e_clusters = new_clusters;
} else {
/* No contiguous record, or no empty record at eof, so
* we add a new one. */
- OCFS_ASSERT(el->l_next_free_rec < el->l_count);
+ OCFS2_ASSERT(el->l_next_free_rec < el->l_count);
i = el->l_next_free_rec;
el->l_recs[i].e_blkno = start_blk;
@@ -643,11 +639,11 @@
ocfs2_extent_map_drop(inode, fe->i_clusters);
}
- status = ocfs_journal_dirty(handle, fe_bh);
+ status = ocfs2_journal_dirty(handle, fe_bh);
if (status < 0)
mlog_errno(status);
if (fe->id2.i_list.l_tree_depth) {
- status = ocfs_journal_dirty(handle, eb_bhs[num_bhs - 1]);
+ status = ocfs2_journal_dirty(handle, eb_bhs[num_bhs - 1]);
if (status < 0)
mlog_errno(status);
}
@@ -666,8 +662,6 @@
}
/*
- * ocfs2_find_branch_target()
- *
* Should only be called when there is no space left in any of the
* leaf nodes. What we want to do is find the lowest tree depth
* non-leaf extent block with room for new records. There are three
@@ -684,7 +678,7 @@
*
* return status < 0 indicates an error.
*/
-static int ocfs2_find_branch_target(ocfs_super *osb,
+static int ocfs2_find_branch_target(ocfs2_super *osb,
struct inode *inode,
struct buffer_head *fe_bh,
struct buffer_head **target_bh)
@@ -705,18 +699,18 @@
el = &fe->id2.i_list;
while(el->l_tree_depth > 1) {
- OCFS_ASSERT_RO(el->l_next_free_rec);
+ OCFS2_ASSERT_RO(el->l_next_free_rec);
i = el->l_next_free_rec - 1;
blkno = el->l_recs[i].e_blkno;
- OCFS_ASSERT_RO(blkno);
+ OCFS2_ASSERT_RO(blkno);
if (bh) {
brelse(bh);
bh = NULL;
}
- status = ocfs_read_block(osb, blkno, &bh, OCFS_BH_CACHED,
- inode);
+ status = ocfs2_read_block(osb, blkno, &bh, OCFS2_BH_CACHED,
+ inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -750,8 +744,8 @@
}
/* the caller needs to update fe->i_clusters */
-int ocfs2_insert_extent(ocfs_super *osb,
- ocfs_journal_handle *handle,
+int ocfs2_insert_extent(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 start_blk,
@@ -776,8 +770,8 @@
if (el->l_tree_depth) {
/* jump to end of tree */
- status = ocfs_read_block(osb, fe->i_last_eb_blk, &last_eb_bh,
- OCFS_BH_CACHED, inode);
+ status = ocfs2_read_block(osb, fe->i_last_eb_blk, &last_eb_bh,
+ OCFS2_BH_CACHED, inode);
if (status < 0) {
mlog_exit(status);
goto bail;
@@ -791,7 +785,7 @@
if (!el->l_next_free_rec
|| (el->l_next_free_rec < el->l_count)
|| !el->l_recs[i].e_clusters
- || ocfs_extent_contig(inode, &el->l_recs[i], start_blk))
+ || ocfs2_extent_contig(inode, &el->l_recs[i], start_blk))
goto out_add;
mlog(0, "ocfs2_allocate_extent: couldn't do a simple add, traversing "
@@ -857,7 +851,7 @@
return status;
}
-static inline int ocfs2_truncate_log_needs_flush(ocfs_super *osb)
+static inline int ocfs2_truncate_log_needs_flush(ocfs2_super *osb)
{
struct buffer_head *tl_bh = osb->osb_tl_bh;
ocfs2_dinode *di;
@@ -889,8 +883,8 @@
return current_tail == new_start;
}
-static int ocfs2_truncate_log_append(ocfs_super *osb,
- ocfs_journal_handle *handle,
+static int ocfs2_truncate_log_append(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
u64 start_blk,
unsigned int num_clusters)
{
@@ -927,8 +921,8 @@
goto bail;
}
- status = ocfs_journal_access(handle, tl_inode, tl_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, tl_inode, tl_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -950,7 +944,7 @@
}
tl->tl_recs[index].t_clusters = cpu_to_le32(num_clusters);
- status = ocfs_journal_dirty(handle, tl_bh);
+ status = ocfs2_journal_dirty(handle, tl_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -961,8 +955,8 @@
return status;
}
-static int ocfs2_replay_truncate_records(ocfs_super *osb,
- ocfs_journal_handle *handle,
+static int ocfs2_replay_truncate_records(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *data_alloc_inode,
struct buffer_head *data_alloc_bh)
{
@@ -984,8 +978,8 @@
while (i >= 0) {
/* Caller has given us at least enough credits to
* update the truncate log dinode */
- status = ocfs_journal_access(handle, tl_inode, tl_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, tl_inode, tl_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -993,7 +987,7 @@
tl->tl_used = cpu_to_le16(i);
- status = ocfs_journal_dirty(handle, tl_bh);
+ status = ocfs2_journal_dirty(handle, tl_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1002,8 +996,8 @@
/* TODO: Perhaps we can calculate the bulk of the
* credits up front rather than extending like
* this. */
- status = ocfs_extend_trans(handle,
- OCFS_TRUNCATE_LOG_FLUSH_ONE_REC);
+ status = ocfs2_extend_trans(handle,
+ OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1020,9 +1014,9 @@
mlog(0, "free record %d, start = %u, clusters = %u\n",
i, le32_to_cpu(rec.t_start), num_clusters);
- status = ocfs_free_clusters(handle, data_alloc_inode,
- data_alloc_bh, start_blk,
- num_clusters);
+ status = ocfs2_free_clusters(handle, data_alloc_inode,
+ data_alloc_bh, start_blk,
+ num_clusters);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1037,11 +1031,11 @@
}
/* Expects you to already be holding tl_inode->i_sem */
-static int __ocfs2_flush_truncate_log(ocfs_super *osb)
+static int __ocfs2_flush_truncate_log(ocfs2_super *osb)
{
int status;
unsigned int num_to_flush;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
struct inode *tl_inode = osb->osb_tl_inode;
struct inode *data_alloc_inode = NULL;
struct buffer_head *tl_bh = osb->osb_tl_bh;
@@ -1065,28 +1059,30 @@
goto bail;
}
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- data_alloc_inode = ocfs_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE, -1);
+ data_alloc_inode = ocfs2_get_system_file_inode(osb,
+ GLOBAL_BITMAP_SYSTEM_INODE,
+ -1);
if (!data_alloc_inode) {
status = -EINVAL;
mlog(ML_ERROR, "Could not get bitmap inode!\n");
goto bail;
}
- ocfs_handle_add_inode(handle, data_alloc_inode);
+ ocfs2_handle_add_inode(handle, data_alloc_inode);
status = ocfs2_meta_lock(data_alloc_inode, handle, &data_alloc_bh, 1);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- handle = ocfs_start_trans(osb, handle, OCFS_TRUNCATE_LOG_UPDATE);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_TRUNCATE_LOG_UPDATE);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
@@ -1102,7 +1098,7 @@
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (data_alloc_inode)
iput(data_alloc_inode);
@@ -1114,7 +1110,7 @@
return status;
}
-int ocfs2_flush_truncate_log(ocfs_super *osb)
+int ocfs2_flush_truncate_log(ocfs2_super *osb)
{
int status;
struct inode *tl_inode = osb->osb_tl_inode;
@@ -1129,7 +1125,7 @@
static void ocfs2_truncate_log_worker(void *data)
{
int status;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
mlog_entry_void();
@@ -1141,7 +1137,7 @@
}
#define OCFS2_TRUNCATE_LOG_FLUSH_INTERVAL (2 * HZ)
-void ocfs2_schedule_truncate_log_flush(ocfs_super *osb,
+void ocfs2_schedule_truncate_log_flush(ocfs2_super *osb,
int cancel)
{
if (osb->osb_tl_inode) {
@@ -1155,7 +1151,7 @@
}
}
-static int ocfs2_get_truncate_log_info(ocfs_super *osb,
+static int ocfs2_get_truncate_log_info(ocfs2_super *osb,
int slot_num,
struct inode **tl_inode,
struct buffer_head **tl_bh)
@@ -1164,7 +1160,7 @@
struct inode *inode = NULL;
struct buffer_head *bh = NULL;
- inode = ocfs_get_system_file_inode(osb,
+ inode = ocfs2_get_system_file_inode(osb,
TRUNCATE_LOG_SYSTEM_INODE,
slot_num);
if (!inode) {
@@ -1173,8 +1169,8 @@
goto bail;
}
- status = ocfs_read_block(osb, OCFS2_I(inode)->ip_blkno, &bh,
- OCFS_BH_CACHED, inode);
+ status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &bh,
+ OCFS2_BH_CACHED, inode);
if (status < 0) {
iput(inode);
mlog_errno(status);
@@ -1192,7 +1188,7 @@
* truncate log and pass back a copy for processing later. if the
* truncate log does not require processing, a *tl_copy is set to
* NULL. */
-int ocfs2_begin_truncate_log_recovery(ocfs_super *osb,
+int ocfs2_begin_truncate_log_recovery(ocfs2_super *osb,
int slot_num,
ocfs2_dinode **tl_copy)
{
@@ -1235,7 +1231,7 @@
* tl_used. */
tl->tl_used = 0;
- status = ocfs_write_block(osb, tl_bh, tl_inode);
+ status = ocfs2_write_block(osb, tl_bh, tl_inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1257,14 +1253,14 @@
return status;
}
-int ocfs2_complete_truncate_log_recovery(ocfs_super *osb,
+int ocfs2_complete_truncate_log_recovery(ocfs2_super *osb,
ocfs2_dinode *tl_copy)
{
int status = 0;
int i;
unsigned int clusters, num_recs, start_cluster;
u64 start_blk;
- ocfs_journal_handle *handle;
+ ocfs2_journal_handle *handle;
struct inode *tl_inode = osb->osb_tl_inode;
ocfs2_truncate_log *tl;
@@ -1290,8 +1286,8 @@
}
}
- handle = ocfs_start_trans(osb, NULL,
- OCFS_TRUNCATE_LOG_UPDATE);
+ handle = ocfs2_start_trans(osb, NULL,
+ OCFS2_TRUNCATE_LOG_UPDATE);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
@@ -1304,7 +1300,7 @@
status = ocfs2_truncate_log_append(osb, handle,
start_blk, clusters);
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (status < 0) {
mlog_errno(status);
goto bail_up;
@@ -1318,7 +1314,7 @@
return status;
}
-void ocfs2_truncate_log_shutdown(ocfs_super *osb)
+void ocfs2_truncate_log_shutdown(ocfs2_super *osb)
{
int status;
struct inode *tl_inode = osb->osb_tl_inode;
@@ -1340,7 +1336,7 @@
mlog_exit_void();
}
-int ocfs2_truncate_log_init(ocfs_super *osb)
+int ocfs2_truncate_log_init(ocfs2_super *osb)
{
int status;
struct inode *tl_inode = NULL;
@@ -1370,7 +1366,7 @@
* block will be deleted, and if it will, what the new last extent
* block will be so we can update his h_next_leaf_blk field, as well
* as the dinodes i_last_eb_blk */
-static int ocfs_find_new_last_ext_blk(ocfs_super *osb,
+static int ocfs2_find_new_last_ext_blk(ocfs2_super *osb,
struct inode *inode,
ocfs2_dinode *fe,
unsigned int new_i_clusters,
@@ -1398,7 +1394,7 @@
eb = (ocfs2_extent_block *) old_last_eb->b_data;
el = &(eb->h_list);
- OCFS_ASSERT(el->l_next_free_rec);
+ OCFS2_ASSERT(el->l_next_free_rec);
/* Make sure that this guy will actually be empty after we
* clear away the data. */
@@ -1417,14 +1413,14 @@
break;
}
}
- OCFS_ASSERT(i >= 0);
+ OCFS2_ASSERT(i >= 0);
if (bh) {
brelse(bh);
bh = NULL;
}
- status = ocfs_read_block(osb, block, &bh, OCFS_BH_CACHED,
+ status = ocfs2_read_block(osb, block, &bh, OCFS2_BH_CACHED,
inode);
if (status < 0) {
mlog_errno(status);
@@ -1445,12 +1441,12 @@
return status;
}
-static int ocfs_do_truncate(ocfs_super *osb,
+static int ocfs2_do_truncate(ocfs2_super *osb,
unsigned int clusters_to_del,
struct inode *inode,
struct buffer_head *fe_bh,
struct buffer_head *old_last_eb_bh,
- ocfs_journal_handle *handle,
+ ocfs2_journal_handle *handle,
ocfs2_truncate_context *tc)
{
int status, i, depth;
@@ -1465,12 +1461,12 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
- status = ocfs_find_new_last_ext_blk(osb,
- inode,
- fe,
- fe->i_clusters - clusters_to_del,
- old_last_eb_bh,
- &last_eb_bh);
+ status = ocfs2_find_new_last_ext_blk(osb,
+ inode,
+ fe,
+ fe->i_clusters - clusters_to_del,
+ old_last_eb_bh,
+ &last_eb_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1478,8 +1474,8 @@
if (last_eb_bh)
last_eb = (ocfs2_extent_block *) last_eb_bh->b_data;
- status = ocfs_journal_access(handle, inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1495,7 +1491,7 @@
i = el->l_next_free_rec - 1;
- OCFS_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
+ OCFS2_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
el->l_recs[i].e_clusters -= clusters_to_del;
/* tree depth zero, we can just delete the clusters, otherwise
* we need to record the offset of the next level extent block
@@ -1514,7 +1510,7 @@
* the extent block in 'next_eb' */
el->l_recs[i].e_cpos = 0;
el->l_recs[i].e_blkno = 0;
- OCFS_ASSERT(el->l_next_free_rec);
+ OCFS2_ASSERT(el->l_next_free_rec);
el->l_next_free_rec--;
}
@@ -1526,7 +1522,7 @@
} else if (last_eb)
fe->i_last_eb_blk = last_eb->h_blkno;
- status = ocfs_journal_dirty(handle, fe_bh);
+ status = ocfs2_journal_dirty(handle, fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1536,14 +1532,14 @@
/* If there will be a new last extent block, then by
* definition, there cannot be any leaves to the right of
* him. */
- status = ocfs_journal_access(handle, inode, last_eb_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, last_eb_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
}
last_eb->h_next_leaf_blk = 0;
- status = ocfs_journal_dirty(handle, last_eb_bh);
+ status = ocfs2_journal_dirty(handle, last_eb_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1554,8 +1550,8 @@
while (depth) {
mlog(0, "traveling tree (depth = %d, next_eb = %"MLFu64")\n",
depth, next_eb);
- status = ocfs_read_block(osb, next_eb, &eb_bh,
- OCFS_BH_CACHED, inode);
+ status = ocfs2_read_block(osb, next_eb, &eb_bh,
+ OCFS2_BH_CACHED, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1564,15 +1560,15 @@
OCFS2_BUG_ON_INVALID_EXTENT_BLOCK(eb);
el = &(eb->h_list);
- status = ocfs_journal_access(handle, inode, eb_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, eb_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- OCFS_ASSERT(el->l_next_free_rec);
- OCFS_ASSERT(depth == (el->l_tree_depth + 1));
+ OCFS2_ASSERT(el->l_next_free_rec);
+ OCFS2_ASSERT(depth == (el->l_tree_depth + 1));
i = el->l_next_free_rec - 1;
@@ -1582,7 +1578,7 @@
el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
el->l_recs[i].e_blkno, el->l_next_free_rec);
- OCFS_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
+ OCFS2_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
el->l_recs[i].e_clusters -= clusters_to_del;
next_eb = el->l_recs[i].e_blkno;
@@ -1594,7 +1590,7 @@
if (!el->l_recs[i].e_clusters) {
el->l_recs[i].e_cpos = 0;
el->l_recs[i].e_blkno = 0;
- OCFS_ASSERT(el->l_next_free_rec);
+ OCFS2_ASSERT(el->l_next_free_rec);
el->l_next_free_rec--;
}
mlog(0, "extent block %"MLFu64", after: record %d: "
@@ -1603,7 +1599,7 @@
el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
el->l_recs[i].e_blkno, el->l_next_free_rec);
- status = ocfs_journal_dirty(handle, eb_bh);
+ status = ocfs2_journal_dirty(handle, eb_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1611,10 +1607,10 @@
if (!el->l_next_free_rec) {
mlog(0, "deleting this extent block.\n");
- OCFS_ASSERT(!eb->h_suballoc_slot);
- OCFS_ASSERT(!el->l_recs[0].e_clusters);
- OCFS_ASSERT(!el->l_recs[0].e_cpos);
- OCFS_ASSERT(!el->l_recs[0].e_blkno);
+ OCFS2_ASSERT(!eb->h_suballoc_slot);
+ OCFS2_ASSERT(!el->l_recs[0].e_clusters);
+ OCFS2_ASSERT(!el->l_recs[0].e_cpos);
+ OCFS2_ASSERT(!el->l_recs[0].e_blkno);
status = ocfs2_free_extent_block(handle,
tc->tc_ext_alloc_inode,
tc->tc_ext_alloc_bh,
@@ -1654,10 +1650,10 @@
*
* WARNING: This will kfree the truncate context
*/
-int ocfs_commit_truncate(ocfs_super *osb,
- struct inode *inode,
- struct buffer_head *fe_bh,
- ocfs2_truncate_context *tc)
+int ocfs2_commit_truncate(ocfs2_super *osb,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ ocfs2_truncate_context *tc)
{
int status, i, credits, tl_sem = 0;
unsigned int clusters_to_del, target_i_clusters;
@@ -1666,7 +1662,7 @@
ocfs2_extent_block *eb;
ocfs2_extent_list *el;
struct buffer_head *last_eb_bh;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
struct inode *tl_inode = osb->osb_tl_inode;
mlog_entry_void();
@@ -1676,7 +1672,7 @@
target_i_clusters = ocfs2_clusters_for_bytes(osb->sb,
i_size_read(inode));
- /* the extent map gets truncated in ocfs_do_truncate */
+ /* the extent map gets truncated in ocfs2_do_truncate */
ocfs2_meta_lvb_set_trunc_clusters(inode, target_i_clusters);
last_eb_bh = tc->tc_last_eb_bh;
@@ -1691,7 +1687,7 @@
el = &fe->id2.i_list;
last_eb = fe->i_last_eb_blk;
start:
- mlog(0, "ocfs_commit_truncate: fe->i_clusters = %u, "
+ mlog(0, "ocfs2_commit_truncate: fe->i_clusters = %u, "
"last_eb = %"MLFu64", fe->i_last_eb_blk = %"MLFu64", "
"fe->id2.i_list.l_tree_depth = %u last_eb_bh = %p\n",
fe->i_clusters, last_eb, fe->i_last_eb_blk,
@@ -1699,7 +1695,7 @@
if (last_eb != fe->i_last_eb_blk) {
mlog(0, "last_eb changed!\n");
- OCFS_ASSERT(fe->id2.i_list.l_tree_depth);
+ OCFS2_ASSERT(fe->id2.i_list.l_tree_depth);
last_eb = fe->i_last_eb_blk;
/* i_last_eb_blk may have changed, read it if
* necessary. We don't have to worry about the
@@ -1711,9 +1707,9 @@
last_eb_bh = NULL;
}
- status = ocfs_read_block(osb, last_eb,
- &last_eb_bh, OCFS_BH_CACHED,
- inode);
+ status = ocfs2_read_block(osb, last_eb,
+ &last_eb_bh, OCFS2_BH_CACHED,
+ inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1747,9 +1743,9 @@
}
}
- credits = ocfs_calc_tree_trunc_credits(osb->sb, clusters_to_del,
- fe, el);
- handle = ocfs_start_trans(osb, NULL, credits);
+ credits = ocfs2_calc_tree_trunc_credits(osb->sb, clusters_to_del,
+ fe, el);
+ handle = ocfs2_start_trans(osb, NULL, credits);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
@@ -1760,17 +1756,17 @@
* to the handle, so we update the last transaction
* info manually. */
if (tc->tc_ext_alloc_inode)
- ocfs_set_inode_lock_trans(osb->journal,
- tc->tc_ext_alloc_inode);
- ocfs_set_inode_lock_trans(osb->journal, inode);
+ ocfs2_set_inode_lock_trans(osb->journal,
+ tc->tc_ext_alloc_inode);
+ ocfs2_set_inode_lock_trans(osb->journal, inode);
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
- status = ocfs_mark_inode_dirty(handle, inode, fe_bh);
+ status = ocfs2_mark_inode_dirty(handle, inode, fe_bh);
if (status < 0)
mlog_errno(status);
- status = ocfs_do_truncate(osb, clusters_to_del, inode, fe_bh,
- last_eb_bh, handle, tc);
+ status = ocfs2_do_truncate(osb, clusters_to_del, inode, fe_bh,
+ last_eb_bh, handle, tc);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1779,10 +1775,10 @@
up(&tl_inode->i_sem);
tl_sem = 0;
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
handle = NULL;
- OCFS_ASSERT(fe->i_clusters >= target_i_clusters);
+ OCFS2_ASSERT(fe->i_clusters >= target_i_clusters);
if (fe->i_clusters > target_i_clusters)
goto start;
bail:
@@ -1794,13 +1790,13 @@
up(&tl_inode->i_sem);
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (last_eb_bh)
brelse(last_eb_bh);
/* This will drop the ext_alloc cluster lock for us */
- ocfs_free_truncate_context(tc);
+ ocfs2_free_truncate_context(tc);
mlog_exit(status);
return status;
@@ -1812,10 +1808,10 @@
* inodes need to be locked and will put them on the returned truncate
* context.
*/
-int ocfs_prepare_truncate(ocfs_super *osb,
- struct inode *inode,
- struct buffer_head *fe_bh,
- ocfs2_truncate_context **tc)
+int ocfs2_prepare_truncate(ocfs2_super *osb,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ ocfs2_truncate_context **tc)
{
int status, metadata_delete;
unsigned int new_i_clusters;
@@ -1837,7 +1833,7 @@
mlog(0, "fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
"%"MLFu64"\n", fe->i_clusters, new_i_clusters, fe->i_size);
- OCFS_ASSERT(fe->i_clusters > new_i_clusters);
+ OCFS2_ASSERT(fe->i_clusters > new_i_clusters);
*tc = kmalloc(sizeof(ocfs2_truncate_context), GFP_KERNEL);
if (!(*tc)) {
@@ -1852,8 +1848,8 @@
/* If we have a tree, then the truncate may result in
* metadata deletes. Figure this out from the
* rightmost leaf block.*/
- status = ocfs_read_block(osb, fe->i_last_eb_blk,
- &last_eb_bh, OCFS_BH_CACHED, inode);
+ status = ocfs2_read_block(osb, fe->i_last_eb_blk,
+ &last_eb_bh, OCFS2_BH_CACHED, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1870,7 +1866,7 @@
if (metadata_delete) {
mlog(0, "Will have to delete metadata for this trunc. "
"locking allocator.\n");
- ext_alloc_inode = ocfs_get_system_file_inode(osb, EXTENT_ALLOC_SYSTEM_INODE, 0);
+ ext_alloc_inode = ocfs2_get_system_file_inode(osb, EXTENT_ALLOC_SYSTEM_INODE, 0);
if (!ext_alloc_inode) {
status = -ENOMEM;
mlog_errno(status);
@@ -1881,9 +1877,9 @@
(*tc)->tc_ext_alloc_inode = ext_alloc_inode;
status = ocfs2_meta_lock(ext_alloc_inode,
- NULL,
- &ext_alloc_bh,
- 1);
+ NULL,
+ &ext_alloc_bh,
+ 1);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1896,14 +1892,14 @@
bail:
if (status < 0) {
if (*tc)
- ocfs_free_truncate_context(*tc);
+ ocfs2_free_truncate_context(*tc);
*tc = NULL;
}
mlog_exit_void();
return status;
}
-void ocfs_free_truncate_context(ocfs2_truncate_context *tc)
+void ocfs2_free_truncate_context(ocfs2_truncate_context *tc)
{
if (tc->tc_ext_alloc_inode) {
if (tc->tc_ext_alloc_locked)
Modified: trunk/fs/ocfs2/alloc.h
===================================================================
--- trunk/fs/ocfs2/alloc.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/alloc.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -27,16 +27,16 @@
#define OCFS2_ALLOC_H
struct _ocfs2_alloc_context;
-int ocfs2_insert_extent(ocfs_super *osb,
- ocfs_journal_handle *handle,
+int ocfs2_insert_extent(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
struct inode *inode,
struct buffer_head *fe_bh,
u64 blkno,
u32 new_clusters,
struct _ocfs2_alloc_context *meta_ac);
-int ocfs_num_free_extents(ocfs_super *osb,
- struct inode *inode,
- ocfs2_dinode *fe);
+int ocfs2_num_free_extents(ocfs2_super *osb,
+ struct inode *inode,
+ ocfs2_dinode *fe);
/* how many new metadata chunks would an allocation need at maximum? */
static inline int ocfs2_extend_meta_needed(ocfs2_dinode *fe)
{
@@ -51,34 +51,34 @@
return fe->id2.i_list.l_tree_depth + 2;
}
-int ocfs2_truncate_log_init(ocfs_super *osb);
-void ocfs2_truncate_log_shutdown(ocfs_super *osb);
-void ocfs2_schedule_truncate_log_flush(ocfs_super *osb,
+int ocfs2_truncate_log_init(ocfs2_super *osb);
+void ocfs2_truncate_log_shutdown(ocfs2_super *osb);
+void ocfs2_schedule_truncate_log_flush(ocfs2_super *osb,
int cancel);
-int ocfs2_flush_truncate_log(ocfs_super *osb);
-int ocfs2_begin_truncate_log_recovery(ocfs_super *osb,
+int ocfs2_flush_truncate_log(ocfs2_super *osb);
+int ocfs2_begin_truncate_log_recovery(ocfs2_super *osb,
int slot_num,
ocfs2_dinode **tl_copy);
-int ocfs2_complete_truncate_log_recovery(ocfs_super *osb,
+int ocfs2_complete_truncate_log_recovery(ocfs2_super *osb,
ocfs2_dinode *tl_copy);
typedef struct _ocfs2_truncate_context {
struct inode *tc_ext_alloc_inode;
struct buffer_head *tc_ext_alloc_bh;
int tc_ext_alloc_locked; /* is it cluster locked? */
- /* these get destroyed once it's passed to ocfs_commit_truncate. */
+ /* these get destroyed once it's passed to ocfs2_commit_truncate. */
struct buffer_head *tc_last_eb_bh;
} ocfs2_truncate_context;
-void ocfs_free_truncate_context(ocfs2_truncate_context *tc);
+void ocfs2_free_truncate_context(ocfs2_truncate_context *tc);
-int ocfs_prepare_truncate(ocfs_super *osb,
- struct inode *inode,
- struct buffer_head *fe_bh,
- ocfs2_truncate_context **tc);
-int ocfs_commit_truncate(ocfs_super *osb,
- struct inode *inode,
- struct buffer_head *fe_bh,
- ocfs2_truncate_context *tc);
+int ocfs2_prepare_truncate(ocfs2_super *osb,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ ocfs2_truncate_context **tc);
+int ocfs2_commit_truncate(ocfs2_super *osb,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ ocfs2_truncate_context *tc);
#endif /* OCFS2_ALLOC_H */
Modified: trunk/fs/ocfs2/aops.c
===================================================================
--- trunk/fs/ocfs2/aops.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/aops.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -41,21 +41,21 @@
#include "buffer_head_io.h"
-static int ocfs_symlink_get_block(struct inode *inode, sector_t iblock,
- struct buffer_head *bh_result, int create)
+static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
+ struct buffer_head *bh_result, int create)
{
int err = -EIO;
int status;
ocfs2_dinode *fe = NULL;
struct buffer_head *bh = NULL;
struct buffer_head *buffer_cache_bh = NULL;
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
void *kaddr;
mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
(unsigned long long)iblock, bh_result, create);
- OCFS_ASSERT(!ocfs2_inode_is_fast_symlink(inode));
+ OCFS2_ASSERT(!ocfs2_inode_is_fast_symlink(inode));
if ((iblock << inode->i_sb->s_blocksize_bits) > PATH_MAX + 1) {
mlog(ML_ERROR, "block offset > PATH_MAX: %llu",
@@ -63,9 +63,9 @@
goto bail;
}
- status = ocfs_read_block(OCFS2_SB(inode->i_sb),
- OCFS2_I(inode)->ip_blkno,
- &bh, OCFS_BH_CACHED, inode);
+ status = ocfs2_read_block(OCFS2_SB(inode->i_sb),
+ OCFS2_I(inode)->ip_blkno,
+ &bh, OCFS2_BH_CACHED, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -87,7 +87,7 @@
/* We don't use the page cache to create symlink data, so if
* need be, copy it over from the buffer cache. */
- if (!buffer_uptodate(bh_result) && ocfs_inode_is_new(inode)) {
+ if (!buffer_uptodate(bh_result) && ocfs2_inode_is_new(inode)) {
buffer_cache_bh = sb_getblk(osb->sb,
fe->id2.i_list.l_recs[0].e_blkno + iblock);
if (!buffer_cache_bh) {
@@ -100,7 +100,7 @@
* the bh, even if it commits while we're doing the
* copy, the data is still good. */
if (buffer_jbd(buffer_cache_bh)
- && ocfs_inode_is_new(inode)) {
+ && ocfs2_inode_is_new(inode)) {
kaddr = kmap_atomic(bh_result->b_page, KM_USER0);
if (!kaddr) {
mlog(ML_ERROR, "couldn't kmap!\n");
@@ -128,8 +128,8 @@
return err;
}
-static int ocfs_get_block(struct inode *inode, sector_t iblock,
- struct buffer_head *bh_result, int create)
+static int ocfs2_get_block(struct inode *inode, sector_t iblock,
+ struct buffer_head *bh_result, int create)
{
int err = -EIO;
u64 vbo = 0;
@@ -145,7 +145,7 @@
if (S_ISLNK(inode->i_mode)) {
/* this always does I/O for some reason. */
- err = ocfs_symlink_get_block(inode, iblock, bh_result, create);
+ err = ocfs2_symlink_get_block(inode, iblock, bh_result, create);
goto bail;
}
@@ -163,12 +163,12 @@
spin_unlock(&OCFS2_I(inode)->ip_lock);
err = ocfs2_extent_map_get_blocks(inode, iblock, 1, &p_blkno,
- NULL);
+ NULL);
if (err) {
mlog(ML_ERROR, "Error %d from get_blocks(0x%p, %llu, 1, "
- "%"MLFu64", NULL)\n",
- err, inode, (unsigned long long)iblock, p_blkno);
+ "%"MLFu64", NULL)\n", err, inode,
+ (unsigned long long)iblock, p_blkno);
goto bail;
}
@@ -179,9 +179,8 @@
if (bh_result->b_blocknr == 0) {
err = -EIO;
mlog(ML_ERROR, "iblock = %llu p_blkno = %"MLFu64" "
- "blkno=(%"MLFu64")\n",
- (unsigned long long)iblock, p_blkno,
- OCFS2_I(inode)->ip_blkno);
+ "blkno=(%"MLFu64")\n", (unsigned long long)iblock,
+ p_blkno, OCFS2_I(inode)->ip_blkno);
}
if (vbo < OCFS2_I(inode)->ip_mmu_private)
@@ -190,10 +189,8 @@
goto bail;
if (vbo != OCFS2_I(inode)->ip_mmu_private) {
mlog(ML_ERROR, "Uh-oh, vbo = %"MLFi64", i_size = %lld, "
- "mmu = %lld, inode = %"MLFu64"\n",
- vbo,
- i_size_read(inode),
- OCFS2_I(inode)->ip_mmu_private,
+ "mmu = %lld, inode = %"MLFu64"\n", vbo,
+ i_size_read(inode), OCFS2_I(inode)->ip_mmu_private,
OCFS2_I(inode)->ip_blkno);
BUG();
err = -EIO;
@@ -211,44 +208,40 @@
return err;
}
-static int ocfs_readpage(struct file *file, struct page *page)
+static int ocfs2_readpage(struct file *file, struct page *page)
{
int ret;
mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0));
- ret = block_read_full_page(page, ocfs_get_block);
+ ret = block_read_full_page(page, ocfs2_get_block);
mlog_exit(ret);
return ret;
}
-static int ocfs_writepage(struct page *page, struct writeback_control *wbc)
+static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)
{
int ret;
mlog_entry("(0x%p)\n", page);
- ret = block_write_full_page(page, ocfs_get_block, wbc);
+ ret = block_write_full_page(page, ocfs2_get_block, wbc);
mlog_exit(ret);
return ret;
}
-/*
- * ocfs_prepare_write()
- *
- */
-static int ocfs_prepare_write(struct file *file, struct page *page,
+static int ocfs2_prepare_write(struct file *file, struct page *page,
unsigned from, unsigned to)
{
int ret;
mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
- ret = cont_prepare_write(page, from, to, ocfs_get_block,
+ ret = cont_prepare_write(page, from, to, ocfs2_get_block,
&(OCFS2_I(page->mapping->host)->ip_mmu_private));
mlog_exit(ret);
@@ -256,12 +249,8 @@
return ret;
}
-/*
- * ocfs_commit_write()
- *
- */
-static int ocfs_commit_write(struct file *file, struct page *page,
- unsigned from, unsigned to)
+static int ocfs2_commit_write(struct file *file, struct page *page,
+ unsigned from, unsigned to)
{
int ret;
@@ -274,7 +263,7 @@
return ret;
}
-static sector_t ocfs_bmap(struct address_space *mapping, sector_t block)
+static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
{
sector_t status;
u64 p_blkno = 0;
@@ -297,7 +286,7 @@
err = ocfs2_extent_map_get_blocks(inode, block, 1, &p_blkno,
NULL);
-
+
if (!INODE_JOURNAL(inode)) {
up_read(&OCFS2_I(inode)->ip_alloc_sem);
ocfs2_meta_unlock(inode, 0);
@@ -330,13 +319,13 @@
* This function is called directly from get_more_blocks in direct-io.c.
*
* We should probably have this data in the oin for the inode.
- * Otherwise, we might want to look at ocfs_rw_direct,
- * ocfs2_extent_map_get_blocks, and ocfs_get_block
+ * Otherwise, we might want to look at ocfs2_rw_direct,
+ * ocfs2_extent_map_get_blocks, and ocfs2_get_block
*
* called like this: dio->get_blocks(dio->inode, fs_startblk,
* fs_count, map_bh, dio->rw == WRITE);
*/
-static int ocfs_direct_IO_get_blocks(struct inode *inode, sector_t iblock,
+static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock,
unsigned long max_blocks,
struct buffer_head *bh_result, int create)
{
@@ -372,7 +361,7 @@
/* This figures out the size of the next contiguous block, and
* our logical offset */
ret = ocfs2_extent_map_get_blocks(inode, iblock, 1, &p_blkno,
- &contig_blocks);
+ &contig_blocks);
if (ret) {
mlog(ML_ERROR, "get_blocks() failed iblock=%llu\n",
(unsigned long long)iblock);
@@ -391,21 +380,11 @@
return ret;
}
-/*
- * ocfs_direct_IO()
- * used to be:
- * static int ocfs_direct_IO (int rw,
- * struct inode *inode,
- * struct kiobuf *iobuf, unsigned long blocknr, int blocksize)
- *
- * now:
- static int ocfs_direct_IO(int rw, struct kiocb *iocb,
- const struct iovec *iov, loff_t offset,
- unsigned long nr_segs)
- * int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
- * loff_t offset, unsigned long nr_segs);
- */
-static ssize_t ocfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs)
+static ssize_t ocfs2_direct_IO(int rw,
+ struct kiocb *iocb,
+ const struct iovec *iov,
+ loff_t offset,
+ unsigned long nr_segs)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
@@ -416,20 +395,19 @@
/* blockdev_direct_IO checks alignment for us, using */
ret = blockdev_direct_IO_no_locking(rw, iocb, inode,
inode->i_sb->s_bdev, iov, offset,
- nr_segs, ocfs_direct_IO_get_blocks,
+ nr_segs, ocfs2_direct_IO_get_blocks,
NULL);
-
+
mlog_exit(ret);
return ret;
-} /* ocfs_direct_IO */
+}
-
-struct address_space_operations ocfs_aops = {
- .readpage = ocfs_readpage,
- .writepage = ocfs_writepage,
- .prepare_write = ocfs_prepare_write,
- .commit_write = ocfs_commit_write,
- .bmap = ocfs_bmap,
+struct address_space_operations ocfs2_aops = {
+ .readpage = ocfs2_readpage,
+ .writepage = ocfs2_writepage,
+ .prepare_write = ocfs2_prepare_write,
+ .commit_write = ocfs2_commit_write,
+ .bmap = ocfs2_bmap,
.sync_page = block_sync_page,
- .direct_IO = ocfs_direct_IO
+ .direct_IO = ocfs2_direct_IO
};
Modified: trunk/fs/ocfs2/buffer_head_io.c
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/buffer_head_io.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -39,8 +39,8 @@
#include "buffer_head_io.h"
-void ocfs_end_buffer_io_sync(struct buffer_head *bh,
- int uptodate)
+void ocfs2_end_buffer_io_sync(struct buffer_head *bh,
+ int uptodate)
{
if (!uptodate)
mlog_errno(-EIO);
@@ -52,8 +52,8 @@
unlock_buffer(bh);
}
-int ocfs_write_blocks(ocfs_super *osb, struct buffer_head *bhs[],
- int nr, struct inode *inode)
+int ocfs2_write_blocks(ocfs2_super *osb, struct buffer_head *bhs[],
+ int nr, struct inode *inode)
{
int status = 0;
int i;
@@ -105,7 +105,7 @@
/* remove from dirty list before I/O. */
clear_buffer_dirty(bh);
- bh->b_end_io = ocfs_end_buffer_io_sync;
+ bh->b_end_io = ocfs2_end_buffer_io_sync;
submit_bh(WRITE, bh);
}
@@ -128,13 +128,9 @@
return status;
}
-/*
- * ocfs_read_blocks()
- *
- */
-int ocfs_read_blocks(ocfs_super *osb, u64 block, int nr,
- struct buffer_head *bhs[], int flags,
- struct inode *inode)
+int ocfs2_read_blocks(ocfs2_super *osb, u64 block, int nr,
+ struct buffer_head *bhs[], int flags,
+ struct inode *inode)
{
int status = 0;
struct super_block *sb;
@@ -181,7 +177,7 @@
bh = bhs[i];
ignore_cache = 0;
- if (flags & OCFS_BH_CACHED && inode &&
+ if (flags & OCFS2_BH_CACHED && inode &&
!ocfs2_test_bh_seqnum(inode, bh)) {
mlog(ML_SEQNUM, "(read) bh (%llu) seqnum (%lu) does "
"not match inode (%u)\n",
@@ -191,18 +187,18 @@
ignore_cache = 1;
}
- if ((flags & OCFS_BH_CACHED) && (!buffer_uptodate(bh)))
+ if ((flags & OCFS2_BH_CACHED) && (!buffer_uptodate(bh)))
ignore_cache = 1;
if (buffer_jbd(bh)) {
- if (!(flags & OCFS_BH_CACHED) || ignore_cache)
+ if (!(flags & OCFS2_BH_CACHED) || ignore_cache)
mlog(ML_BH_IO, "trying to sync read a jbd "
"managed bh (blocknr = %llu)\n",
(unsigned long long)bh->b_blocknr);
continue;
}
- if (!(flags & OCFS_BH_CACHED) || ignore_cache) {
+ if (!(flags & OCFS2_BH_CACHED) || ignore_cache) {
if (buffer_dirty(bh)) {
/* This should probably be a BUG, or
* at least return an error. */
@@ -225,8 +221,8 @@
#endif
}
clear_buffer_uptodate(bh);
- bh->b_end_io = ocfs_end_buffer_io_sync;
- if (flags & OCFS_BH_READAHEAD)
+ bh->b_end_io = ocfs2_end_buffer_io_sync;
+ if (flags & OCFS2_BH_READAHEAD)
submit_bh(READA, bh);
else
submit_bh(READ, bh);
@@ -256,7 +252,7 @@
up(&OCFS2_I(inode)->ip_io_sem);
mlog(ML_BH_IO, "block=(%"MLFu64"), nr=(%d), cached=%s\n", block, nr,
- (!(flags & OCFS_BH_CACHED) || ignore_cache) ? "no" : "yes");
+ (!(flags & OCFS2_BH_CACHED) || ignore_cache) ? "no" : "yes");
bail:
Modified: trunk/fs/ocfs2/buffer_head_io.h
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/buffer_head_io.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -1,7 +1,7 @@
/* -*- mode: c; c-basic-offset: 8; -*-
* vim: noexpandtab sw=8 ts=8 sts=0:
*
- * ocfs_buffer_head.h
+ * ocfs2_buffer_head.h
*
* Buffer cache handling functions defined
*
@@ -28,33 +28,33 @@
#include <linux/buffer_head.h>
-void ocfs_end_buffer_io_sync(struct buffer_head *bh,
+void ocfs2_end_buffer_io_sync(struct buffer_head *bh,
int uptodate);
/* Yosh made me do it. */
-static inline int ocfs_write_block (ocfs_super *osb,
- struct buffer_head *bh,
- struct inode *inode);
-static inline int ocfs_read_block (ocfs_super *osb,
- u64 off,
- struct buffer_head **bh,
- int flags,
- struct inode *inode);
+static inline int ocfs2_write_block(ocfs2_super *osb,
+ struct buffer_head *bh,
+ struct inode *inode);
+static inline int ocfs2_read_block(ocfs2_super *osb,
+ u64 off,
+ struct buffer_head **bh,
+ int flags,
+ struct inode *inode);
-int ocfs_write_blocks (ocfs_super *osb,
+int ocfs2_write_blocks(ocfs2_super *osb,
struct buffer_head *bh[],
int nr,
struct inode *inode);
-int ocfs_read_blocks (ocfs_super *osb,
- u64 block,
- int nr,
- struct buffer_head *bhs[],
- int flags,
- struct inode *inode);
+int ocfs2_read_blocks(ocfs2_super *osb,
+ u64 block,
+ int nr,
+ struct buffer_head *bhs[],
+ int flags,
+ struct inode *inode);
-#define OCFS_BH_CACHED 1
-#define OCFS_BH_READAHEAD 8 /* use this to pass READA down to submit_bh */
+#define OCFS2_BH_CACHED 1
+#define OCFS2_BH_READAHEAD 8 /* use this to pass READA down to submit_bh */
#define STATE_BH_BITS 8
#define USED_BH_BITS 23 /* Number of BH bits used up through JBD */
@@ -96,19 +96,19 @@
return ret;
}
-static inline int ocfs_write_block(ocfs_super * osb, struct buffer_head *bh,
- struct inode *inode)
+static inline int ocfs2_write_block(ocfs2_super * osb, struct buffer_head *bh,
+ struct inode *inode)
{
int status;
- status = ocfs_write_blocks(osb, &bh, 1, inode);
+ status = ocfs2_write_blocks(osb, &bh, 1, inode);
return status;
}
-static inline int ocfs_read_block(ocfs_super * osb, u64 off,
- struct buffer_head **bh, int flags,
- struct inode *inode)
+static inline int ocfs2_read_block(ocfs2_super * osb, u64 off,
+ struct buffer_head **bh, int flags,
+ struct inode *inode)
{
int status = 0;
@@ -118,8 +118,8 @@
goto bail;
}
- status = ocfs_read_blocks(osb, off, 1, bh,
- flags, inode);
+ status = ocfs2_read_blocks(osb, off, 1, bh,
+ flags, inode);
bail:
return status;
Modified: trunk/fs/ocfs2/dcache.c
===================================================================
--- trunk/fs/ocfs2/dcache.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/dcache.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -38,11 +38,12 @@
#include "file.h"
#include "inode.h"
-static int ocfs_dentry_revalidate(struct dentry *dentry, struct nameidata *nd)
+static int ocfs2_dentry_revalidate(struct dentry *dentry,
+ struct nameidata *nd)
{
struct inode *inode = dentry->d_inode;
int ret = 0; /* if all else fails, just return false */
- ocfs_super *osb;
+ ocfs2_super *osb;
mlog_entry("(0x%p, '%.*s')\n", dentry,
dentry->d_name.len, dentry->d_name.name);
@@ -52,7 +53,7 @@
osb = OCFS2_SB(inode->i_sb);
- OCFS_ASSERT(osb);
+ OCFS2_ASSERT(osb);
if (inode == osb->root_inode) {
ret = 1;
@@ -84,6 +85,6 @@
return ret;
}
-struct dentry_operations ocfs_dentry_ops = {
- .d_revalidate = ocfs_dentry_revalidate,
+struct dentry_operations ocfs2_dentry_ops = {
+ .d_revalidate = ocfs2_dentry_revalidate,
};
Modified: trunk/fs/ocfs2/dcache.h
===================================================================
--- trunk/fs/ocfs2/dcache.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/dcache.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,6 +26,6 @@
#ifndef OCFS2_DCACHE_H
#define OCFS2_DCACHE_H
-extern struct dentry_operations ocfs_dentry_ops;
+extern struct dentry_operations ocfs2_dentry_ops;
#endif /* OCFS2_DCACHE_H */
Modified: trunk/fs/ocfs2/dir.c
===================================================================
--- trunk/fs/ocfs2/dir.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/dir.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -59,19 +59,19 @@
#include "buffer_head_io.h"
-static unsigned char ocfs_filetype_table[] = {
+static unsigned char ocfs2_filetype_table[] = {
DT_UNKNOWN, DT_REG, DT_DIR, DT_CHR, DT_BLK, DT_FIFO, DT_SOCK, DT_LNK
};
-static int ocfs_extend_dir(ocfs_super *osb,
+static int ocfs2_extend_dir(ocfs2_super *osb,
struct inode *dir,
struct buffer_head *parent_fe_bh,
struct buffer_head **new_de_bh);
/*
- * ocfs_readdir()
+ * ocfs2_readdir()
*
*/
-int ocfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
+int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
{
int error = 0;
unsigned long offset, blk;
@@ -101,7 +101,7 @@
while (!error && !stored && filp->f_pos < i_size_read(inode)) {
blk = (filp->f_pos) >> sb->s_blocksize_bits;
- bh = ocfs_bread(inode, blk, &err, 0);
+ bh = ocfs2_bread(inode, blk, &err, 0);
if (!bh) {
mlog(ML_ERROR, "directory #%"MLFu64" contains a hole "
"at offset %lld\n",
@@ -117,7 +117,7 @@
if (!offset) {
for (i = 16 >> (sb->s_blocksize_bits - 9), num = 0;
i > 0; i--) {
- tmp = ocfs_bread(inode, ++blk, &err, 1);
+ tmp = ocfs2_bread(inode, ++blk, &err, 1);
if (tmp)
brelse(tmp);
}
@@ -151,7 +151,7 @@
while (!error && filp->f_pos < i_size_read(inode)
&& offset < sb->s_blocksize) {
de = (struct ocfs2_dir_entry *) (bh->b_data + offset);
- if (!ocfs_check_dir_entry(inode, de, bh, offset)) {
+ if (!ocfs2_check_dir_entry(inode, de, bh, offset)) {
/* On error, skip the f_pos to the
next block. */
filp->f_pos = (filp->f_pos |
@@ -172,7 +172,7 @@
unsigned char d_type = DT_UNKNOWN;
if (de->file_type < OCFS2_FT_MAX)
- d_type = ocfs_filetype_table[de->file_type];
+ d_type = ocfs2_filetype_table[de->file_type];
error = filldir(dirent, de->name,
de->name_len,
filp->f_pos,
@@ -200,16 +200,14 @@
return stored;
}
-
-/* ocfs_find_files_on_disk()
- * NOTE: this should always be called with parent dir i_sem taken!
+/*
+ * NOTE: this should always be called with parent dir i_sem taken.
*/
-/* parent off changed to file entry offset of parent! */
-int ocfs_find_files_on_disk(ocfs_super *osb, const char *name,
- int namelen, u64 *blkno,
- struct inode *inode, int take_lock,
- struct buffer_head **dirent_bh,
- struct ocfs2_dir_entry **dirent)
+int ocfs2_find_files_on_disk(ocfs2_super *osb, const char *name,
+ int namelen, u64 *blkno,
+ struct inode *inode, int take_lock,
+ struct buffer_head **dirent_bh,
+ struct ocfs2_dir_entry **dirent)
{
int status = -ENOENT;
int lock_acq = 0;
@@ -229,7 +227,7 @@
lock_acq = 1;
}
- *dirent_bh = ocfs_find_entry(name, namelen, inode, dirent);
+ *dirent_bh = ocfs2_find_entry(name, namelen, inode, dirent);
if (!*dirent_bh || !*dirent) {
status = -ENOENT;
goto leave;
@@ -253,13 +251,12 @@
mlog_exit(status);
return status;
-} /* ocfs_find_files_on_disk */
+}
-
/*
* routine to check that the specified directory is empty (for rmdir)
*/
-int ocfs_empty_dir(struct inode *inode)
+int ocfs2_empty_dir(struct inode *inode)
{
unsigned long offset;
struct buffer_head * bh;
@@ -270,7 +267,7 @@
sb = inode->i_sb;
if ((i_size_read(inode) <
(OCFS2_DIR_REC_LEN(1) + OCFS2_DIR_REC_LEN(2))) ||
- !(bh = ocfs_bread(inode, 0, &err, 0))) {
+ !(bh = ocfs2_bread(inode, 0, &err, 0))) {
mlog(ML_ERROR, "bad directory (dir #%"MLFu64") - "
"no data block\n",
OCFS2_I(inode)->ip_blkno);
@@ -295,8 +292,8 @@
while (offset < i_size_read(inode) ) {
if (!bh || (void *)de >= (void *)(bh->b_data + sb->s_blocksize)) {
brelse(bh);
- bh = ocfs_bread(inode,
- offset >> sb->s_blocksize_bits, &err, 0);
+ bh = ocfs2_bread(inode,
+ offset >> sb->s_blocksize_bits, &err, 0);
if (!bh) {
mlog(ML_ERROR, "directory #%"MLFu64" contains "
"a hole at offset %lu\n",
@@ -306,7 +303,7 @@
}
de = (struct ocfs2_dir_entry *) bh->b_data;
}
- if (!ocfs_check_dir_entry(inode, de, bh, offset)) {
+ if (!ocfs2_check_dir_entry(inode, de, bh, offset)) {
brelse(bh);
return 1;
}
@@ -316,20 +313,20 @@
}
offset += le16_to_cpu(de->rec_len);
de = (struct ocfs2_dir_entry *)
- ((char *)de + le16_to_cpu(de->rec_len));
+ ((char *)de + le16_to_cpu(de->rec_len));
}
brelse(bh);
return 1;
}
/* returns a bh of the 1st new block in the allocation. */
-int ocfs_do_extend_dir(struct super_block *sb,
- ocfs_journal_handle *handle,
- struct inode *dir,
- struct buffer_head *parent_fe_bh,
- ocfs2_alloc_context *data_ac,
- ocfs2_alloc_context *meta_ac,
- struct buffer_head **new_bh)
+int ocfs2_do_extend_dir(struct super_block *sb,
+ ocfs2_journal_handle *handle,
+ struct inode *dir,
+ struct buffer_head *parent_fe_bh,
+ ocfs2_alloc_context *data_ac,
+ ocfs2_alloc_context *meta_ac,
+ struct buffer_head **new_bh)
{
int status;
int extend;
@@ -340,10 +337,10 @@
spin_unlock(&OCFS2_I(dir)->ip_lock);
if (extend) {
- status = ocfs_extend_allocation(OCFS2_SB(sb), dir, 1,
- parent_fe_bh, handle,
- data_ac, meta_ac, NULL);
- OCFS_ASSERT(status != -EAGAIN);
+ status = ocfs2_extend_allocation(OCFS2_SB(sb), dir, 1,
+ parent_fe_bh, handle,
+ data_ac, meta_ac, NULL);
+ OCFS2_ASSERT(status != -EAGAIN);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -371,10 +368,10 @@
}
/* assumes you already have a cluster lock on the directory. */
-static int ocfs_extend_dir(ocfs_super *osb,
- struct inode *dir,
- struct buffer_head *parent_fe_bh,
- struct buffer_head **new_de_bh)
+static int ocfs2_extend_dir(ocfs2_super *osb,
+ struct inode *dir,
+ struct buffer_head *parent_fe_bh,
+ struct buffer_head **new_de_bh)
{
int status = 0;
int credits, num_free_extents;
@@ -382,7 +379,7 @@
ocfs2_dinode *fe = (ocfs2_dinode *) parent_fe_bh->b_data;
ocfs2_alloc_context *data_ac = NULL;
ocfs2_alloc_context *meta_ac = NULL;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
struct buffer_head *new_bh = NULL;
struct ocfs2_dir_entry * de;
struct super_block *sb = osb->sb;
@@ -393,7 +390,7 @@
mlog(0, "extending dir %"MLFu64" (i_size = %lld)\n",
OCFS2_I(dir)->ip_blkno, dir_i_size);
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -404,7 +401,7 @@
spin_lock(&OCFS2_I(dir)->ip_lock);
if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) {
spin_unlock(&OCFS2_I(dir)->ip_lock);
- num_free_extents = ocfs_num_free_extents(osb, dir, fe);
+ num_free_extents = ocfs2_num_free_extents(osb, dir, fe);
if (num_free_extents < 0) {
status = num_free_extents;
mlog_errno(status);
@@ -412,8 +409,8 @@
}
if (!num_free_extents) {
- status = ocfs_reserve_new_metadata(osb, handle,
- fe, &meta_ac);
+ status = ocfs2_reserve_new_metadata(osb, handle,
+ fe, &meta_ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -421,28 +418,28 @@
}
}
- status = ocfs_reserve_clusters(osb, handle, 1, &data_ac);
+ status = ocfs2_reserve_clusters(osb, handle, 1, &data_ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
goto bail;
}
- credits = ocfs_calc_extend_credits(sb, fe, 1);
+ credits = ocfs2_calc_extend_credits(sb, fe, 1);
} else {
spin_unlock(&OCFS2_I(dir)->ip_lock);
- credits = OCFS_SIMPLE_DIR_EXTEND_CREDITS;
+ credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS;
}
- handle = ocfs_start_trans(osb, handle, credits);
+ handle = ocfs2_start_trans(osb, handle, credits);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- status = ocfs_do_extend_dir(osb->sb, handle, dir, parent_fe_bh,
- data_ac, meta_ac, &new_bh);
+ status = ocfs2_do_extend_dir(osb->sb, handle, dir, parent_fe_bh,
+ data_ac, meta_ac, &new_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -450,8 +447,8 @@
set_buffer_uptodate(new_bh);
ocfs2_set_bh_seqnum(dir, new_bh);
- status = ocfs_journal_access(handle, dir, new_bh,
- OCFS_JOURNAL_ACCESS_CREATE);
+ status = ocfs2_journal_access(handle, dir, new_bh,
+ OCFS2_JOURNAL_ACCESS_CREATE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -460,7 +457,7 @@
de = (struct ocfs2_dir_entry *) new_bh->b_data;
de->inode = 0;
de->rec_len = le16_to_cpu(sb->s_blocksize);
- status = ocfs_journal_dirty(handle, new_bh);
+ status = ocfs2_journal_dirty(handle, new_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -469,7 +466,7 @@
dir_i_size += dir->i_sb->s_blocksize;
i_size_write(dir, dir_i_size);
dir->i_blocks = ocfs2_align_bytes_to_sectors(dir_i_size);
- status = ocfs_mark_inode_dirty(handle, dir, parent_fe_bh);
+ status = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -479,30 +476,30 @@
get_bh(*new_de_bh);
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (data_ac)
- ocfs_free_alloc_context(data_ac);
+ ocfs2_free_alloc_context(data_ac);
if (meta_ac)
- ocfs_free_alloc_context(meta_ac);
+ ocfs2_free_alloc_context(meta_ac);
if (new_bh)
brelse(new_bh);
mlog_exit(status);
return status;
-} /* ocfs_extend_dir */
+}
/*
* Search the dir for a good spot, extending it if necessary. The
* block containing an appropriate record is returned in ret_de_bh.
*/
-int ocfs_prepare_dir_for_insert(ocfs_super *osb,
- struct inode *dir,
- struct buffer_head *parent_fe_bh,
- const char *name,
- int namelen,
- struct buffer_head **ret_de_bh)
+int ocfs2_prepare_dir_for_insert(ocfs2_super *osb,
+ struct inode *dir,
+ struct buffer_head *parent_fe_bh,
+ const char *name,
+ int namelen,
+ struct buffer_head **ret_de_bh)
{
unsigned long offset;
struct buffer_head * bh = NULL;
@@ -517,9 +514,9 @@
mlog(0, "getting ready to insert namelen %d into dir %"MLFu64"\n",
namelen, OCFS2_I(dir)->ip_blkno);
- OCFS_ASSERT(S_ISDIR(dir->i_mode));
+ OCFS2_ASSERT(S_ISDIR(dir->i_mode));
fe = (ocfs2_dinode *) parent_fe_bh->b_data;
- OCFS_ASSERT(fe->i_size == i_size_read(dir));
+ OCFS2_ASSERT(fe->i_size == i_size_read(dir));
sb = dir->i_sb;
@@ -529,7 +526,7 @@
goto bail;
}
- bh = ocfs_bread(dir, 0, &status, 0);
+ bh = ocfs2_bread(dir, 0, &status, 0);
if (!bh) {
mlog_errno(status);
goto bail;
@@ -544,23 +541,23 @@
bh = NULL;
if (i_size_read(dir) <= offset) {
- status = ocfs_extend_dir(osb,
- dir,
- parent_fe_bh,
- &bh);
+ status = ocfs2_extend_dir(osb,
+ dir,
+ parent_fe_bh,
+ &bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- OCFS_ASSERT(bh);
+ OCFS2_ASSERT(bh);
*ret_de_bh = bh;
get_bh(*ret_de_bh);
goto bail;
}
- bh = ocfs_bread(dir,
- offset >> sb->s_blocksize_bits,
- &status,
- 0);
+ bh = ocfs2_bread(dir,
+ offset >> sb->s_blocksize_bits,
+ &status,
+ 0);
if (!bh) {
mlog_errno(status);
goto bail;
@@ -568,11 +565,11 @@
/* move to next block */
de = (struct ocfs2_dir_entry *) bh->b_data;
}
- if (!ocfs_check_dir_entry(dir, de, bh, offset)) {
+ if (!ocfs2_check_dir_entry(dir, de, bh, offset)) {
status = -ENOENT;
goto bail;
}
- if (ocfs_match(namelen, name, de)) {
+ if (ocfs2_match(namelen, name, de)) {
status = -EEXIST;
goto bail;
}
Modified: trunk/fs/ocfs2/dir.h
===================================================================
--- trunk/fs/ocfs2/dir.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/dir.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,25 +26,25 @@
#ifndef OCFS2_DIR_H
#define OCFS2_DIR_H
-int ocfs_empty_dir(struct inode *inode); /* FIXME: to namei.c */
-int ocfs_find_files_on_disk(ocfs_super *osb, const char *name,
- int namelen, u64 *blkno,
- struct inode *inode, int take_lock,
- struct buffer_head **dirent_bh,
- struct ocfs2_dir_entry **dirent);
-int ocfs_readdir(struct file *filp, void *dirent, filldir_t filldir);
-int ocfs_prepare_dir_for_insert(ocfs_super *osb,
- struct inode *dir,
- struct buffer_head *parent_fe_bh,
- const char *name,
- int namelen,
- struct buffer_head **ret_de_bh);
+int ocfs2_empty_dir(struct inode *inode); /* FIXME: to namei.c */
+int ocfs2_find_files_on_disk(ocfs2_super *osb, const char *name,
+ int namelen, u64 *blkno,
+ struct inode *inode, int take_lock,
+ struct buffer_head **dirent_bh,
+ struct ocfs2_dir_entry **dirent);
+int ocfs2_readdir(struct file *filp, void *dirent, filldir_t filldir);
+int ocfs2_prepare_dir_for_insert(ocfs2_super *osb,
+ struct inode *dir,
+ struct buffer_head *parent_fe_bh,
+ const char *name,
+ int namelen,
+ struct buffer_head **ret_de_bh);
struct _ocfs2_alloc_context;
-int ocfs_do_extend_dir(struct super_block *sb,
- ocfs_journal_handle *handle,
- struct inode *dir,
- struct buffer_head *parent_fe_bh,
- struct _ocfs2_alloc_context *data_ac,
- struct _ocfs2_alloc_context *meta_ac,
- struct buffer_head **new_bh);
+int ocfs2_do_extend_dir(struct super_block *sb,
+ ocfs2_journal_handle *handle,
+ struct inode *dir,
+ struct buffer_head *parent_fe_bh,
+ struct _ocfs2_alloc_context *data_ac,
+ struct _ocfs2_alloc_context *meta_ac,
+ struct buffer_head **new_bh);
#endif /* OCFS2_DIR_H */
Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/dlmglue.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -66,10 +66,10 @@
static spinlock_t clean_buffer_lock = SPIN_LOCK_UNLOCKED;
-static char ocfs2_lock_type_char[OCFS_NUM_LOCK_TYPES] = {
- [OCFS_TYPE_META] = 'M',
- [OCFS_TYPE_DATA] = 'D',
- [OCFS_TYPE_SUPER] = 'S'
+static char ocfs2_lock_type_char[OCFS2_NUM_LOCK_TYPES] = {
+ [OCFS2_TYPE_META] = 'M',
+ [OCFS2_TYPE_DATA] = 'D',
+ [OCFS2_TYPE_SUPER] = 'S'
};
static int ocfs2_build_lock_name(enum ocfs2_lock_type type,
@@ -95,7 +95,7 @@
static int ocfs2_unblock_super(ocfs2_lock_res *lockres,
int *requeue);
typedef void (ocfs2_convert_worker_t)(ocfs2_lock_res *, int);
-static int ocfs2_generic_unblock_lock(ocfs_super *osb,
+static int ocfs2_generic_unblock_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int *requeue,
ocfs2_convert_worker_t *worker);
@@ -133,42 +133,42 @@
static inline int ocfs2_is_inode_lock(ocfs2_lock_res *lockres)
{
- return lockres->l_type == OCFS_TYPE_META ||
- lockres->l_type == OCFS_TYPE_DATA;
+ return lockres->l_type == OCFS2_TYPE_META ||
+ lockres->l_type == OCFS2_TYPE_DATA;
}
static inline int ocfs2_is_super_lock(ocfs2_lock_res *lockres)
{
- return lockres->l_type == OCFS_TYPE_SUPER;
+ return lockres->l_type == OCFS2_TYPE_SUPER;
}
-static inline ocfs_super *ocfs2_lock_res_super(ocfs2_lock_res *lockres)
+static inline ocfs2_super *ocfs2_lock_res_super(ocfs2_lock_res *lockres)
{
- OCFS_ASSERT(ocfs2_is_super_lock(lockres));
+ OCFS2_ASSERT(ocfs2_is_super_lock(lockres));
- return (ocfs_super *) lockres->l_priv;
+ return (ocfs2_super *) lockres->l_priv;
}
static inline struct inode *ocfs2_lock_res_inode(ocfs2_lock_res *lockres)
{
- OCFS_ASSERT(ocfs2_is_inode_lock(lockres));
+ OCFS2_ASSERT(ocfs2_is_inode_lock(lockres));
return (struct inode *) lockres->l_priv;
}
-static int ocfs2_lock_create(ocfs_super *osb,
+static int ocfs2_lock_create(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int level,
int flags);
static inline int ocfs2_may_continue_on_blocked_lock(ocfs2_lock_res *lockres,
int wanted);
-static int ocfs2_cluster_lock(ocfs_super *osb,
+static int ocfs2_cluster_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int level,
int lkm_flags,
ocfs2_lock_callback cb,
unsigned long cb_data);
-static void ocfs2_cluster_unlock(ocfs_super *osb,
+static void ocfs2_cluster_unlock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int level);
static inline void ocfs2_generic_handle_downconvert_action(ocfs2_lock_res *lockres);
@@ -177,9 +177,9 @@
static int ocfs2_generic_handle_bast(ocfs2_lock_res *lockres, int level);
static inline void ocfs2_handle_meta_convert_action(struct inode *inode,
ocfs2_lock_res *lockres);
-static void ocfs2_inc_inode_seq(ocfs_super *osb,
+static void ocfs2_inc_inode_seq(ocfs2_super *osb,
struct inode *inode);
-static void ocfs2_schedule_blocked_lock(ocfs_super *osb,
+static void ocfs2_schedule_blocked_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres);
static void ocfs2_schedule_blocked_inode_lock(struct inode *inode,
ocfs2_lock_res *lockres);
@@ -190,7 +190,7 @@
"resource %s: %s\n", dlm_errname(_stat), _func, \
_lockres->l_name, dlm_errmsg(_stat)); \
} while (0)
-static void ocfs2_vote_on_unlock(ocfs_super *osb,
+static void ocfs2_vote_on_unlock(ocfs2_super *osb,
ocfs2_lock_res *lockres);
/* Called after we refresh our inode, only has any effect if we have
* an EX lock. This populates the LVB with the initial values for our
@@ -202,13 +202,13 @@
int new_level);
static int ocfs2_meta_lock_update(struct inode *inode,
struct buffer_head **bh);
-static void ocfs2_drop_super_lock(ocfs_super *osb);
+static void ocfs2_drop_super_lock(ocfs2_super *osb);
static inline int ocfs2_highest_compat_lock_level(int level);
-static int __ocfs2_downconvert_lock(ocfs_super *osb,
+static int __ocfs2_downconvert_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int new_level,
int lvb);
-static int __ocfs2_cancel_convert(ocfs_super *osb,
+static int __ocfs2_cancel_convert(ocfs2_super *osb,
ocfs2_lock_res *lockres);
static inline int ocfs2_can_downconvert_meta_lock(struct inode *inode,
ocfs2_lock_res *lockres,
@@ -261,10 +261,10 @@
mlog_entry_void();
- OCFS_ASSERT(lockres->l_type == OCFS_TYPE_META);
+ OCFS2_ASSERT(lockres->l_type == OCFS2_TYPE_META);
spin_lock(&lockres->l_lock);
- OCFS_ASSERT(lockres->l_level > LKM_NLMODE);
+ OCFS2_ASSERT(lockres->l_level > LKM_NLMODE);
lvb = (ocfs2_meta_lvb *) lockres->l_lksb.lvb;
if (trunc_clusters)
@@ -285,7 +285,7 @@
mlog_entry_void();
- BUG_ON(type >= OCFS_NUM_LOCK_TYPES);
+ BUG_ON(type >= OCFS2_NUM_LOCK_TYPES);
name = kmalloc(OCFS2_LOCK_ID_MAX_LEN, GFP_KERNEL);
if (!name) {
@@ -345,8 +345,8 @@
mlog_entry_void();
- OCFS_ASSERT(type == OCFS_TYPE_META ||
- type == OCFS_TYPE_DATA);
+ OCFS2_ASSERT(type == OCFS2_TYPE_META ||
+ type == OCFS2_TYPE_DATA);
status = ocfs2_build_lock_name(type,
OCFS2_I(inode)->ip_blkno,
@@ -357,7 +357,7 @@
goto bail;
}
- if (type == OCFS_TYPE_META)
+ if (type == OCFS2_TYPE_META)
ops = &ocfs2_inode_meta_lops;
else
ops = &ocfs2_inode_data_lops;
@@ -370,9 +370,9 @@
}
int ocfs2_super_lock_res_init(ocfs2_lock_res *res,
- ocfs_super *osb)
+ ocfs2_super *osb)
{
- enum ocfs2_lock_type type = OCFS_TYPE_SUPER;
+ enum ocfs2_lock_type type = OCFS2_TYPE_SUPER;
int status;
mlog_entry_void();
@@ -437,7 +437,7 @@
{
mlog_entry_void();
- OCFS_ASSERT(lockres);
+ OCFS2_ASSERT(lockres);
switch(level) {
case LKM_EXMODE:
@@ -458,15 +458,15 @@
{
mlog_entry_void();
- OCFS_ASSERT(lockres);
+ OCFS2_ASSERT(lockres);
switch(level) {
case LKM_EXMODE:
- OCFS_ASSERT(lockres->l_ex_holders);
+ OCFS2_ASSERT(lockres->l_ex_holders);
lockres->l_ex_holders--;
break;
case LKM_PRMODE:
- OCFS_ASSERT(lockres->l_ro_holders);
+ OCFS2_ASSERT(lockres->l_ro_holders);
lockres->l_ro_holders--;
break;
default:
@@ -526,10 +526,10 @@
{
mlog_entry_void();
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_ATTACHED);
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
- OCFS_ASSERT(lockres->l_blocking > LKM_NLMODE);
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_ATTACHED);
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
+ OCFS2_ASSERT(lockres->l_blocking > LKM_NLMODE);
lockres->l_level = lockres->l_requested;
if (lockres->l_level <=
@@ -548,7 +548,7 @@
atomic_read(&OCFS2_SB(inode->i_sb)->clean_buffer_seq));
}
-static void ocfs2_inc_inode_seq(ocfs_super *osb,
+static void ocfs2_inc_inode_seq(ocfs2_super *osb,
struct inode *inode)
{
mlog_entry_void();
@@ -577,8 +577,8 @@
{
mlog_entry_void();
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_ATTACHED);
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_ATTACHED);
/* Convert from RO to EX doesn't really need anything as our
* information is already up to data. Convert from NL to
@@ -595,7 +595,7 @@
static inline void ocfs2_handle_meta_convert_action(struct inode *inode,
ocfs2_lock_res *lockres)
{
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
mlog_entry_void();
@@ -611,8 +611,8 @@
{
mlog_entry_void();
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
- OCFS_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
+ OCFS2_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
if (lockres->l_requested > LKM_NLMODE &&
!(lockres->l_flags & OCFS2_LOCK_LOCAL))
@@ -629,7 +629,7 @@
{
ocfs2_lock_res *lockres = opaque;
struct inode *inode;
- ocfs_super *osb;
+ ocfs2_super *osb;
dlm_lockstatus *lksb;
mlog_entry_void();
@@ -639,9 +639,9 @@
mlog(0, "AST fired for inode %"MLFu64", l_action = %u, type = %s\n",
OCFS2_I(inode)->ip_blkno, lockres->l_action,
- (lockres->l_type == OCFS_TYPE_META) ? "Meta" : "Data");
+ (lockres->l_type == OCFS2_TYPE_META) ? "Meta" : "Data");
- OCFS_ASSERT(ocfs2_is_inode_lock(lockres));
+ OCFS2_ASSERT(ocfs2_is_inode_lock(lockres));
spin_lock(&lockres->l_lock);
@@ -658,7 +658,7 @@
switch(lockres->l_action) {
case OCFS2_AST_ATTACH:
- if (lockres->l_type == OCFS_TYPE_META &&
+ if (lockres->l_type == OCFS2_TYPE_META &&
lockres->l_requested > LKM_NLMODE &&
!(lockres->l_flags & OCFS2_LOCK_LOCAL))
ocfs2_inc_inode_seq(osb, inode);
@@ -667,7 +667,7 @@
lockres_clear_flags(lockres, OCFS2_LOCK_LOCAL);
break;
case OCFS2_AST_CONVERT:
- if (lockres->l_type == OCFS_TYPE_META)
+ if (lockres->l_type == OCFS2_TYPE_META)
ocfs2_handle_meta_convert_action(inode, lockres);
else
ocfs2_generic_handle_convert_action(lockres);
@@ -680,7 +680,7 @@
}
/* data locking ignores refresh flag for now. */
- if (lockres->l_type == OCFS_TYPE_DATA)
+ if (lockres->l_type == OCFS2_TYPE_DATA)
lockres_clear_flags(lockres, OCFS2_LOCK_NEEDS_REFRESH);
/* set it to something invalid so if we get called again we
@@ -721,12 +721,12 @@
{
ocfs2_lock_res *lockres = opaque;
struct inode *inode;
- ocfs_super *osb;
+ ocfs2_super *osb;
int needs_downconvert;
mlog_entry_void();
- OCFS_ASSERT(ocfs2_is_inode_lock(lockres));
+ OCFS2_ASSERT(ocfs2_is_inode_lock(lockres));
inode = ocfs2_lock_res_inode(lockres);
osb = OCFS2_SB(inode->i_sb);
@@ -734,9 +734,9 @@
mlog(0, "BAST fired for inode %"MLFu64", blocking = %d, level = %d "
"type = %s\n", OCFS2_I(inode)->ip_blkno, level,
lockres->l_level,
- (lockres->l_type == OCFS_TYPE_META) ? "Meta" : "Data");
+ (lockres->l_type == OCFS2_TYPE_META) ? "Meta" : "Data");
- OCFS_ASSERT(level > LKM_NLMODE);
+ OCFS2_ASSERT(level > LKM_NLMODE);
spin_lock(&lockres->l_lock);
@@ -762,7 +762,7 @@
mlog(0, "Superblock AST fired\n");
- OCFS_ASSERT(ocfs2_is_super_lock(lockres));
+ OCFS2_ASSERT(ocfs2_is_super_lock(lockres));
spin_lock(&lockres->l_lock);
lksb = &(lockres->l_lksb);
@@ -797,7 +797,7 @@
static void ocfs2_super_bast_func(void *opaque, int level)
{
ocfs2_lock_res *lockres = opaque;
- ocfs_super *osb;
+ ocfs2_super *osb;
int needs_downconvert;
mlog_entry_void();
@@ -837,7 +837,7 @@
* OCFS2_LOCK_BUSY), we'll bail out returning 0. It's up to the caller
* to do the right thing in that case.
*/
-static int ocfs2_lock_create(ocfs_super *osb,
+static int ocfs2_lock_create(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int level,
int flags)
@@ -936,7 +936,7 @@
static inline int ocfs2_may_continue_on_blocked_lock(ocfs2_lock_res *lockres,
int wanted)
{
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
return wanted <= ocfs2_highest_compat_lock_level(lockres->l_blocking);
}
@@ -956,7 +956,7 @@
complete(&sc->sc_complete);
}
-static int ocfs2_cluster_lock(ocfs_super *osb,
+static int ocfs2_cluster_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int level,
int lkm_flags,
@@ -1036,8 +1036,8 @@
lockres_or_flags(lockres, OCFS2_LOCK_BUSY);
spin_unlock(&lockres->l_lock);
- OCFS_ASSERT(level != LKM_IVMODE);
- OCFS_ASSERT(level != LKM_NLMODE);
+ OCFS2_ASSERT(level != LKM_IVMODE);
+ OCFS2_ASSERT(level != LKM_NLMODE);
mlog(0, "lock %s, convert from %d to level = %d\n",
lockres->l_name, lockres->l_level, level);
@@ -1096,7 +1096,7 @@
return ret;
}
-static void ocfs2_cluster_unlock(ocfs_super *osb,
+static void ocfs2_cluster_unlock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int level)
{
@@ -1117,11 +1117,11 @@
int ocfs2_create_new_inode_locks(struct inode *inode)
{
int status;
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
ocfs2_lock_res *lockres;
- OCFS_ASSERT(inode);
- OCFS_ASSERT(ocfs_inode_is_new(inode));
+ OCFS2_ASSERT(inode);
+ OCFS2_ASSERT(ocfs2_inode_is_new(inode));
mlog_entry_void();
@@ -1138,7 +1138,7 @@
lockres = &OCFS2_I(inode)->ip_meta_lockres;
spin_lock(&lockres->l_lock);
- OCFS_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
+ OCFS2_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
lockres_or_flags(lockres, OCFS2_LOCK_LOCAL);
spin_unlock(&lockres->l_lock);
@@ -1151,7 +1151,7 @@
lockres = &OCFS2_I(inode)->ip_data_lockres;
spin_lock(&lockres->l_lock);
- OCFS_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
+ OCFS2_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
lockres_or_flags(lockres, OCFS2_LOCK_LOCAL);
spin_unlock(&lockres->l_lock);
@@ -1173,7 +1173,7 @@
int status, level;
ocfs2_lock_res *lockres;
- OCFS_ASSERT(inode);
+ OCFS2_ASSERT(inode);
mlog_entry_void();
@@ -1194,7 +1194,7 @@
return status;
}
-static void ocfs2_vote_on_unlock(ocfs_super *osb,
+static void ocfs2_vote_on_unlock(ocfs2_super *osb,
ocfs2_lock_res *lockres)
{
int kick = 0;
@@ -1485,10 +1485,10 @@
ocfs2_refresh_inode_from_lvb(inode);
} else {
/* Boo, we have to go to disk. */
- /* read bh, cast, ocfs_refresh_inode */
- status = ocfs_read_block(OCFS2_SB(inode->i_sb),
- OCFS2_I(inode)->ip_blkno, bh,
- OCFS_BH_CACHED, inode);
+ /* read bh, cast, ocfs2_refresh_inode */
+ status = ocfs2_read_block(OCFS2_SB(inode->i_sb),
+ OCFS2_I(inode)->ip_blkno, bh,
+ OCFS2_BH_CACHED, inode);
if (status < 0) {
mlog_errno(status);
goto bail_refresh;
@@ -1510,7 +1510,7 @@
"flags: 0x%x\n", OCFS2_I(inode)->ip_blkno,
fe->i_dtime, fe->i_flags);
- ocfs_refresh_inode(inode, fe);
+ ocfs2_refresh_inode(inode, fe);
}
mlog(0, "inode %"MLFu64", I can only trust %u clusters\n",
@@ -1546,11 +1546,11 @@
return 0;
}
- status = ocfs_read_block(OCFS2_SB(inode->i_sb),
- OCFS2_I(inode)->ip_blkno,
- ret_bh,
- OCFS_BH_CACHED,
- inode);
+ status = ocfs2_read_block(OCFS2_SB(inode->i_sb),
+ OCFS2_I(inode)->ip_blkno,
+ ret_bh,
+ OCFS2_BH_CACHED,
+ inode);
if (status < 0)
mlog_errno(status);
@@ -1562,7 +1562,7 @@
* the result of the lock will be communicated via the callback.
*/
int ocfs2_meta_lock_full(struct inode *inode,
- ocfs_journal_handle *handle,
+ ocfs2_journal_handle *handle,
struct buffer_head **ret_bh,
int ex,
int flags,
@@ -1571,10 +1571,10 @@
{
int status, level, dlm_flags;
ocfs2_lock_res *lockres;
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct buffer_head *local_bh = NULL;
- OCFS_ASSERT(inode);
+ OCFS2_ASSERT(inode);
mlog_entry_void();
@@ -1586,8 +1586,8 @@
if (!(flags & OCFS2_META_LOCK_RECOVERY))
status = wait_event_interruptible(osb->recovery_event,
- ocfs_node_map_is_empty(osb,
- &osb->recovery_map));
+ ocfs2_node_map_is_empty(osb,
+ &osb->recovery_map));
if (status < 0) {
mlog_errno(status);
return status;
@@ -1613,8 +1613,8 @@
* abort the operation. */
if (!(flags & OCFS2_META_LOCK_RECOVERY))
wait_event(osb->recovery_event,
- ocfs_node_map_is_empty(osb,
- &osb->recovery_map));
+ ocfs2_node_map_is_empty(osb,
+ &osb->recovery_map));
/* This is fun. The caller may want a bh back, or it may
* not. ocfs2_meta_lock_update definitely wants one in, but
@@ -1636,7 +1636,7 @@
}
if (handle) {
- status = ocfs_handle_add_lock(handle, inode);
+ status = ocfs2_handle_add_lock(handle, inode);
if (status < 0)
mlog_errno(status);
}
@@ -1671,7 +1671,7 @@
mlog_exit_void();
}
-int ocfs2_super_lock(ocfs_super *osb,
+int ocfs2_super_lock(ocfs2_super *osb,
int ex)
{
int status;
@@ -1699,8 +1699,8 @@
}
if (status) {
bh = si->si_bh;
- status = ocfs_read_block(osb, bh->b_blocknr, &bh, 0,
- si->si_inode);
+ status = ocfs2_read_block(osb, bh->b_blocknr, &bh, 0,
+ si->si_inode);
if (status == 0)
ocfs2_update_slot_info(si);
@@ -1714,7 +1714,7 @@
return status;
}
-void ocfs2_super_unlock(ocfs_super *osb,
+void ocfs2_super_unlock(ocfs2_super *osb,
int ex)
{
int level = ex ? LKM_EXMODE : LKM_PRMODE;
@@ -1723,7 +1723,7 @@
ocfs2_cluster_unlock(osb, lockres, level);
}
-int ocfs2_dlm_init(ocfs_super *osb)
+int ocfs2_dlm_init(ocfs2_super *osb)
{
int status;
u32 dlm_key;
@@ -1765,7 +1765,7 @@
return status;
}
-void ocfs2_dlm_shutdown(ocfs_super *osb)
+void ocfs2_dlm_shutdown(ocfs2_super *osb)
{
mlog_entry_void();
@@ -1819,7 +1819,7 @@
/* BEWARE: called with lockres lock, and always drops it. Caller
* should not be calling us with a busy lock... */
-static int __ocfs2_drop_lock(ocfs_super *osb,
+static int __ocfs2_drop_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres)
{
int ret = 0;
@@ -1840,7 +1840,7 @@
/* make sure we never get here while waiting for an ast to
* fire. */
- OCFS_ASSERT(lockres->l_action == OCFS2_AST_INVALID);
+ OCFS2_ASSERT(lockres->l_action == OCFS2_AST_INVALID);
/* is this necessary? */
lockres_or_flags(lockres, OCFS2_LOCK_BUSY);
@@ -1875,7 +1875,7 @@
void *drop_data;
};
-static int ocfs2_drop_lock(ocfs_super *osb,
+static int ocfs2_drop_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
struct drop_lock_cb *dcb)
{
@@ -1909,7 +1909,7 @@
return __ocfs2_drop_lock(osb, lockres);
}
-static void ocfs2_drop_super_lock(ocfs_super *osb)
+static void ocfs2_drop_super_lock(ocfs2_super *osb)
{
int status;
@@ -1964,7 +1964,7 @@
}
/* called with the spinlock held, and WILL drop it. */
-static int __ocfs2_downconvert_lock(ocfs_super *osb,
+static int __ocfs2_downconvert_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int new_level,
int lvb)
@@ -1974,7 +1974,7 @@
mlog_entry_void();
- OCFS_ASSERT(lockres->l_blocking > LKM_NLMODE);
+ OCFS2_ASSERT(lockres->l_blocking > LKM_NLMODE);
if (lockres->l_level <= new_level) {
mlog(ML_ERROR, "lockres->l_level (%u) <= new_level (%u)\n",
@@ -2015,7 +2015,7 @@
}
/* called with the spinlock held, and WILL drop it. */
-static int __ocfs2_cancel_convert(ocfs_super *osb,
+static int __ocfs2_cancel_convert(ocfs2_super *osb,
ocfs2_lock_res *lockres)
{
int ret;
@@ -2026,7 +2026,7 @@
mlog(0, "lock %s\n", lockres->l_name);
/* were we in a convert when we got the bast fire? */
- OCFS_ASSERT(lockres->l_action == OCFS2_AST_CONVERT ||
+ OCFS2_ASSERT(lockres->l_action == OCFS2_AST_CONVERT ||
lockres->l_action == OCFS2_AST_DOWNCONVERT);
/* set things up for the unlockast to know to just
* clear out the ast_action and unset busy, etc. */
@@ -2069,7 +2069,7 @@
mlog_entry_void();
- OCFS_ASSERT(new_level == LKM_NLMODE || new_level == LKM_PRMODE);
+ OCFS2_ASSERT(new_level == LKM_NLMODE || new_level == LKM_PRMODE);
if (lockres->l_flags & OCFS2_LOCK_REFRESHING) {
ret = 0;
@@ -2077,10 +2077,10 @@
"off!\n", lockres->l_name);
} else if (new_level == LKM_PRMODE)
ret = !lockres->l_ex_holders &&
- ocfs_inode_fully_checkpointed(inode);
+ ocfs2_inode_fully_checkpointed(inode);
else /* Must be NLMODE we're converting to. */
ret = !lockres->l_ro_holders && !lockres->l_ex_holders &&
- ocfs_inode_fully_checkpointed(inode);
+ ocfs2_inode_fully_checkpointed(inode);
mlog_exit(ret);
return ret;
@@ -2100,12 +2100,12 @@
spin_lock(&lockres->l_lock);
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
mlog(0, "l_level=%d, l_blocking=%d\n", lockres->l_level,
lockres->l_blocking);
- OCFS_ASSERT(lockres->l_level == LKM_EXMODE ||
+ OCFS2_ASSERT(lockres->l_level == LKM_EXMODE ||
lockres->l_level == LKM_PRMODE);
if (lockres->l_flags & OCFS2_LOCK_BUSY) {
@@ -2154,8 +2154,8 @@
set_lvb);
goto leave;
}
- if (!ocfs_inode_fully_checkpointed(inode))
- ocfs_start_checkpoint(OCFS2_SB(inode->i_sb));
+ if (!ocfs2_inode_fully_checkpointed(inode))
+ ocfs2_start_checkpoint(OCFS2_SB(inode->i_sb));
*requeue = 1;
spin_unlock(&lockres->l_lock);
@@ -2165,7 +2165,7 @@
return ret;
}
-static int ocfs2_generic_unblock_lock(ocfs_super *osb,
+static int ocfs2_generic_unblock_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres,
int *requeue,
ocfs2_convert_worker_t *worker)
@@ -2178,7 +2178,7 @@
spin_lock(&lockres->l_lock);
- OCFS_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
+ OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
recheck:
if (lockres->l_flags & OCFS2_LOCK_BUSY) {
@@ -2286,7 +2286,7 @@
{
int status;
struct inode *inode;
- ocfs_super *osb;
+ ocfs2_super *osb;
mlog_entry_void();
@@ -2354,7 +2354,7 @@
int *requeue)
{
int status;
- ocfs_super *osb;
+ ocfs2_super *osb;
mlog_entry_void();
@@ -2371,7 +2371,7 @@
return status;
}
-void ocfs2_process_blocked_lock(ocfs_super *osb,
+void ocfs2_process_blocked_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres)
{
int status;
@@ -2379,9 +2379,9 @@
mlog_entry_void();
- OCFS_ASSERT(lockres);
- OCFS_ASSERT(lockres->l_ops);
- OCFS_ASSERT(lockres->l_ops->unblock);
+ OCFS2_ASSERT(lockres);
+ OCFS2_ASSERT(lockres->l_ops);
+ OCFS2_ASSERT(lockres->l_ops->unblock);
mlog(0, "lockres %s blocked.\n", lockres->l_name);
@@ -2398,7 +2398,7 @@
mlog_exit_void();
}
-static void ocfs2_schedule_blocked_lock(ocfs_super *osb,
+static void ocfs2_schedule_blocked_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres)
{
mlog_entry_void();
@@ -2438,7 +2438,7 @@
ocfs2_meta_lvb *lvb;
spin_lock(&lockres->l_lock);
- OCFS_ASSERT(lockres->l_level == LKM_EXMODE);
+ OCFS2_ASSERT(lockres->l_level == LKM_EXMODE);
lvb = (ocfs2_meta_lvb *) lockres->l_lksb.lvb;
if (be32_to_cpu(lvb->lvb_trunc_clusters) > trunc_clusters)
Modified: trunk/fs/ocfs2/dlmglue.h
===================================================================
--- trunk/fs/ocfs2/dlmglue.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/dlmglue.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -78,14 +78,14 @@
u32 lvb_reserved[3];
} ocfs2_meta_lvb;
-int ocfs2_dlm_init(ocfs_super *osb);
-void ocfs2_dlm_shutdown(ocfs_super *osb);
+int ocfs2_dlm_init(ocfs2_super *osb);
+void ocfs2_dlm_shutdown(ocfs2_super *osb);
void ocfs2_lock_res_init_once(ocfs2_lock_res *res);
int ocfs2_inode_lock_res_init(ocfs2_lock_res *res,
enum ocfs2_lock_type type,
struct inode *inode);
int ocfs2_super_lock_res_init(ocfs2_lock_res *res,
- ocfs_super *osb);
+ ocfs2_super *osb);
void ocfs2_lock_res_free(ocfs2_lock_res *res);
int ocfs2_create_new_inode_locks(struct inode *inode);
int ocfs2_drop_inode_locks(struct inode *inode);
@@ -98,7 +98,7 @@
/* Instruct the dlm not to queue ourselves on the other node. */
#define OCFS2_META_LOCK_NOQUEUE (0x02)
int ocfs2_meta_lock_full(struct inode *inode,
- ocfs_journal_handle *handle,
+ ocfs2_journal_handle *handle,
struct buffer_head **ret_bh,
int ex,
int flags,
@@ -109,12 +109,12 @@
#define ocfs2_meta_lock(i, h, b, e) ocfs2_meta_lock_full(i, h, b, e, 0, NULL, 0)
void ocfs2_meta_unlock(struct inode *inode,
int ex);
-int ocfs2_super_lock(ocfs_super *osb,
+int ocfs2_super_lock(ocfs2_super *osb,
int ex);
-void ocfs2_super_unlock(ocfs_super *osb,
+void ocfs2_super_unlock(ocfs2_super *osb,
int ex);
/* for the vote thread */
-void ocfs2_process_blocked_lock(ocfs_super *osb,
+void ocfs2_process_blocked_lock(ocfs2_super *osb,
ocfs2_lock_res *lockres);
void ocfs2_meta_lvb_set_trunc_clusters(struct inode *inode,
Modified: trunk/fs/ocfs2/extent_map.c
===================================================================
--- trunk/fs/ocfs2/extent_map.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/extent_map.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -70,20 +70,19 @@
struct rb_node ***ret_p,
struct rb_node **ret_parent);
static int ocfs2_extent_map_insert_entry(struct ocfs2_extent_map *em,
- struct ocfs2_extent_map_entry *ent);
+ struct ocfs2_extent_map_entry *ent);
static int ocfs2_extent_map_find_leaf(struct inode *inode,
u32 cpos, u32 clusters,
ocfs2_extent_list *el);
static int ocfs2_extent_map_lookup_read(struct inode *inode,
- u32 cpos, u32 clusters,
- struct ocfs2_extent_map_entry **ret_ent);
+ u32 cpos, u32 clusters,
+ struct ocfs2_extent_map_entry **ret_ent);
static int ocfs2_extent_map_try_insert(struct inode *inode,
- ocfs2_extent_rec *rec,
- int tree_depth,
- struct ocfs2_em_insert_context *ctxt);
+ ocfs2_extent_rec *rec,
+ int tree_depth,
+ struct ocfs2_em_insert_context *ctxt);
-
/*
* Find an entry in the tree that intersects the region passed in.
* Note that this will find straddled intervals, it is up to the
@@ -218,9 +217,9 @@
brelse(eb_bh);
eb_bh = NULL;
}
- ret = ocfs_read_block(OCFS2_SB(inode->i_sb),
- blkno, &eb_bh, OCFS_BH_CACHED,
- inode);
+ ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
+ blkno, &eb_bh, OCFS2_BH_CACHED,
+ inode);
if (ret)
goto out_free;
eb = (ocfs2_extent_block *)eb_bh->b_data;
@@ -254,8 +253,9 @@
* be new regions or more granular regions (both allowed by insert).
*/
static int ocfs2_extent_map_lookup_read(struct inode *inode,
- u32 cpos, u32 clusters,
- struct ocfs2_extent_map_entry **ret_ent)
+ u32 cpos,
+ u32 clusters,
+ struct ocfs2_extent_map_entry **ret_ent)
{
int ret;
u64 blkno;
@@ -277,8 +277,8 @@
blkno = ent->e_rec.e_blkno;
spin_unlock(&OCFS2_I(inode)->ip_lock);
- ret = ocfs_read_block(OCFS2_SB(inode->i_sb), blkno, &bh,
- OCFS_BH_CACHED, inode);
+ ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno, &bh,
+ OCFS2_BH_CACHED, inode);
if (ret) {
if (bh)
brelse(bh);
@@ -290,9 +290,9 @@
} else {
spin_unlock(&OCFS2_I(inode)->ip_lock);
- ret = ocfs_read_block(OCFS2_SB(inode->i_sb),
- OCFS2_I(inode)->ip_blkno, &bh,
- OCFS_BH_CACHED, inode);
+ ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
+ OCFS2_I(inode)->ip_blkno, &bh,
+ OCFS2_BH_CACHED, inode);
if (ret) {
if (bh)
brelse(bh);
@@ -543,8 +543,8 @@
struct ocfs2_extent_map_entry *ent;
ocfs2_extent_rec *old;
- OCFS_ASSERT(new_clusters);
- OCFS_ASSERT(rec->e_clusters >= new_clusters);
+ OCFS2_ASSERT(new_clusters);
+ OCFS2_ASSERT(rec->e_clusters >= new_clusters);
if (em->em_clusters < OCFS2_I(inode)->ip_clusters) {
/*
@@ -576,12 +576,12 @@
NULL, NULL);
if (ent) {
old = &ent->e_rec;
- OCFS_ASSERT((rec->e_cpos + rec->e_clusters) ==
+ OCFS2_ASSERT((rec->e_cpos + rec->e_clusters) ==
(old->e_cpos + old->e_clusters +
new_clusters));
if (!ent->e_tree_depth) {
- OCFS_ASSERT(old->e_cpos == rec->e_cpos);
- OCFS_ASSERT(old->e_blkno ==
+ OCFS2_ASSERT(old->e_cpos == rec->e_cpos);
+ OCFS2_ASSERT(old->e_blkno ==
rec->e_blkno);
ret = 0;
}
@@ -830,7 +830,6 @@
}
}
-
/*
* Remove all entries past new_clusters, inclusive of an entry that
* contains new_clusters. This is effectively a cache forget.
@@ -891,7 +890,6 @@
return 0;
}
-
int __init init_ocfs2_extent_maps(void)
{
ocfs2_em_ent_cachep =
Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/file.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -51,12 +51,12 @@
#include "buffer_head_io.h"
static int ocfs2_zero_extend(struct inode *inode);
-static int ocfs_orphan_for_truncate(ocfs_super *osb,
- struct inode *inode,
- struct buffer_head *fe_bh,
- u64 new_i_size);
+static int ocfs2_orphan_for_truncate(ocfs2_super *osb,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ u64 new_i_size);
-int ocfs_sync_inode(struct inode *inode)
+int ocfs2_sync_inode(struct inode *inode)
{
filemap_fdatawrite(inode->i_mapping);
return sync_mapping_buffers(inode->i_mapping);
@@ -80,11 +80,7 @@
return ret;
}
-/*
- * ocfs_file_open()
- *
- */
-static int ocfs_file_open(struct inode *inode, struct file *file)
+static int ocfs2_file_open(struct inode *inode, struct file *file)
{
int status;
int mode = file->f_flags;
@@ -112,9 +108,9 @@
leave:
mlog_exit(status);
return status;
-} /* ocfs_file_open */
+}
-static int ocfs_file_release(struct inode *inode, struct file *file)
+static int ocfs2_file_release(struct inode *inode, struct file *file)
{
struct ocfs2_inode_info *oi = OCFS2_I(inode);
@@ -132,22 +128,19 @@
return 0;
}
-/*
- * ocfs_sync_file()
- *
- */
-static int ocfs_sync_file(struct file *file, struct dentry *dentry,
- int datasync)
+static int ocfs2_sync_file(struct file *file,
+ struct dentry *dentry,
+ int datasync)
{
int err = 0;
journal_t *journal;
struct inode *inode = dentry->d_inode;
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", file, dentry, datasync,
dentry->d_name.len, dentry->d_name.name);
- err = ocfs_sync_inode(dentry->d_inode);
+ err = ocfs2_sync_inode(dentry->d_inode);
if (err)
goto bail;
@@ -158,7 +151,7 @@
mlog_exit(err);
return (err < 0) ? -EIO : 0;
-} /* ocfs_sync_file */
+}
static void ocfs2_update_inode_size(struct inode *inode,
u64 new_size)
@@ -167,7 +160,8 @@
inode->i_blocks = ocfs2_align_bytes_to_sectors(new_size);
}
-void ocfs2_file_finish_extension(struct inode *inode, loff_t newsize,
+void ocfs2_file_finish_extension(struct inode *inode,
+ loff_t newsize,
unsigned should_zero)
{
mlog(0, "inode %"MLFu64", newsize = %lld, should_zero = %u\n",
@@ -193,18 +187,15 @@
}
}
-/*
- * ocfs_file_write()
- */
-static ssize_t ocfs_file_write(struct file *filp,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
+static ssize_t ocfs2_file_write(struct file *filp,
+ const char __user *buf,
+ size_t count,
+ loff_t *ppos)
{
struct iovec local_iov = { .iov_base = (void __user *)buf,
.iov_len = count };
int ret = 0;
- ocfs_super *osb = NULL;
+ ocfs2_super *osb = NULL;
struct dentry *dentry = filp->f_dentry;
struct inode *inode = dentry->d_inode;
struct ocfs2_write_lock_info info = {0, };
@@ -232,8 +223,8 @@
osb = OCFS2_SB(inode->i_sb);
- ret = ocfs_write_lock_maybe_extend(filp, buf, count, ppos, &info,
- &ctxt);
+ ret = ocfs2_write_lock_maybe_extend(filp, buf, count, ppos, &info,
+ &ctxt);
if (ret)
goto bail;
@@ -268,16 +259,13 @@
return ret;
}
-/*
- * ocfs_file_read()
- */
-static ssize_t ocfs_file_read(struct file *filp,
- char __user *buf,
- size_t count,
- loff_t *ppos)
+static ssize_t ocfs2_file_read(struct file *filp,
+ char __user *buf,
+ size_t count,
+ loff_t *ppos)
{
int ret = 0;
- ocfs_super *osb = NULL;
+ ocfs2_super *osb = NULL;
struct dentry *dentry = filp->f_dentry;
struct inode *inode = dentry->d_inode;
ocfs2_backing_inode *target_binode;
@@ -340,29 +328,29 @@
mlog_exit(ret);
return ret;
-} /* ocfs_file_read */
+}
-struct file_operations ocfs_fops = {
- .read = ocfs_file_read,
- .write = ocfs_file_write,
- .mmap = ocfs2_mmap,
- .fsync = ocfs_sync_file,
- .release = ocfs_file_release,
- .open = ocfs_file_open,
- .aio_read = ocfs2_file_aio_read,
- .aio_write = ocfs2_file_aio_write,
+struct file_operations ocfs2_fops = {
+ .read = ocfs2_file_read,
+ .write = ocfs2_file_write,
+ .mmap = ocfs2_mmap,
+ .fsync = ocfs2_sync_file,
+ .release = ocfs2_file_release,
+ .open = ocfs2_file_open,
+ .aio_read = ocfs2_file_aio_read,
+ .aio_write = ocfs2_file_aio_write,
};
-struct file_operations ocfs_dops = {
- .read = generic_read_dir,
- .readdir = ocfs_readdir,
- .fsync = ocfs_sync_file,
+struct file_operations ocfs2_dops = {
+ .read = generic_read_dir,
+ .readdir = ocfs2_readdir,
+ .fsync = ocfs2_sync_file,
};
-int ocfs_set_inode_size(ocfs_journal_handle *handle,
- struct inode *inode,
- struct buffer_head *fe_bh,
- u64 new_i_size)
+int ocfs2_set_inode_size(ocfs2_journal_handle *handle,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ u64 new_i_size)
{
int status, grow;
@@ -373,7 +361,7 @@
inode->i_blocks = ocfs2_align_bytes_to_sectors(new_i_size);
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
- status = ocfs_mark_inode_dirty(handle, inode, fe_bh);
+ status = ocfs2_mark_inode_dirty(handle, inode, fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -390,50 +378,46 @@
return status;
}
-static int ocfs_orphan_for_truncate(ocfs_super *osb,
- struct inode *inode,
- struct buffer_head *fe_bh,
- u64 new_i_size)
+static int ocfs2_orphan_for_truncate(ocfs2_super *osb,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ u64 new_i_size)
{
int status;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
mlog_entry_void();
/* TODO: This needs to actually orphen the inode in this
* transaction. */
- handle = ocfs_start_trans(osb, handle, OCFS_INODE_UPDATE_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_INODE_UPDATE_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- status = ocfs_set_inode_size(handle, inode, fe_bh, new_i_size);
+ status = ocfs2_set_inode_size(handle, inode, fe_bh, new_i_size);
if (status < 0) {
mlog_errno(status);
goto bail;
}
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
mlog_exit(status);
return status;
}
-/*
- * ocfs_truncate_file()
- *
- */
-static int ocfs_truncate_file(ocfs_super *osb,
- u64 new_i_size,
- struct inode *inode)
+static int ocfs2_truncate_file(ocfs2_super *osb,
+ u64 new_i_size,
+ struct inode *inode)
{
int status = 0;
ocfs2_dinode *fe = NULL;
struct buffer_head *fe_bh = NULL;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
ocfs2_truncate_context *tc = NULL;
mlog_entry("(inode = %"MLFu64", new_i_size = %"MLFu64"\n",
@@ -441,8 +425,8 @@
truncate_inode_pages(inode->i_mapping, new_i_size);
- status = ocfs_read_block(osb, OCFS2_I(inode)->ip_blkno, &fe_bh,
- OCFS_BH_CACHED, inode);
+ status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &fe_bh,
+ OCFS2_BH_CACHED, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -450,11 +434,11 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS_ASSERT(fe->i_size == i_size_read(inode));
+ OCFS2_ASSERT(fe->i_size == i_size_read(inode));
if (new_i_size > fe->i_size) {
mlog(0, "asked to truncate file with size (%"MLFu64") "
- "to size (%"MLFu64")!\n",
+ "to size (%"MLFu64")!\n",
fe->i_size, new_i_size);
status = -EINVAL;
mlog_errno(status);
@@ -475,8 +459,8 @@
fe->i_clusters);
/* No allocation change is required, so lets fast path
* this truncate. */
- handle = ocfs_start_trans(osb, NULL,
- OCFS_INODE_UPDATE_CREDITS);
+ handle = ocfs2_start_trans(osb, NULL,
+ OCFS2_INODE_UPDATE_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -485,9 +469,10 @@
/* Since we got our cluster lock from caller and we
* don't add it to the handle: */
- ocfs_set_inode_lock_trans(osb->journal, inode);
+ ocfs2_set_inode_lock_trans(osb->journal, inode);
- status = ocfs_set_inode_size(handle, inode, fe_bh, new_i_size);
+ status = ocfs2_set_inode_size(handle, inode, fe_bh,
+ new_i_size);
if (status < 0)
mlog_errno(status);
goto bail;
@@ -505,19 +490,19 @@
* change. Orphan the inode so that recovery can complete the
* truncate if necessary. This does the task of marking
* i_size. */
- status = ocfs_orphan_for_truncate(osb, inode, fe_bh, new_i_size);
+ status = ocfs2_orphan_for_truncate(osb, inode, fe_bh, new_i_size);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_prepare_truncate(osb, inode, fe_bh, &tc);
+ status = ocfs2_prepare_truncate(osb, inode, fe_bh, &tc);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_commit_truncate(osb, inode, fe_bh, tc);
+ status = ocfs2_commit_truncate(osb, inode, fe_bh, tc);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -526,14 +511,14 @@
/* TODO: orphan dir cleanup here. */
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (fe_bh)
brelse(fe_bh);
mlog_exit(status);
return status;
-} /* ocfs_truncate_file */
+}
static int ocfs2_zero_extend(struct inode *inode)
{
@@ -581,14 +566,14 @@
* metadata reservations in the contexts. I'll return -EAGAIN, if we
* run out of transaction credits, so the caller can restart us.
*/
-int ocfs_extend_allocation(ocfs_super *osb,
- struct inode *inode,
- u32 clusters_to_add,
- struct buffer_head *fe_bh,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *data_ac,
- ocfs2_alloc_context *meta_ac,
- enum ocfs2_alloc_restarted *reason)
+int ocfs2_extend_allocation(ocfs2_super *osb,
+ struct inode *inode,
+ u32 clusters_to_add,
+ struct buffer_head *fe_bh,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *data_ac,
+ ocfs2_alloc_context *meta_ac,
+ enum ocfs2_alloc_restarted *reason)
{
int status = 0;
int free_extents;
@@ -596,9 +581,9 @@
u32 bit_off, num_bits;
u64 block;
- OCFS_ASSERT(clusters_to_add);
+ OCFS2_ASSERT(clusters_to_add);
- free_extents = ocfs_num_free_extents(osb, inode, fe);
+ free_extents = ocfs2_num_free_extents(osb, inode, fe);
if (free_extents < 0) {
status = free_extents;
mlog_errno(status);
@@ -617,7 +602,7 @@
*reason = RESTART_META;
goto leave;
} else if ((!free_extents)
- && (ocfs_alloc_context_bits_left(meta_ac)
+ && (ocfs2_alloc_context_bits_left(meta_ac)
< ocfs2_extend_meta_needed(fe))) {
mlog(0, "filesystem is really fragmented...\n");
status = -EAGAIN;
@@ -626,19 +611,19 @@
goto leave;
}
- status = ocfs_claim_clusters(osb, handle, data_ac, 1,
- &bit_off, &num_bits);
+ status = ocfs2_claim_clusters(osb, handle, data_ac, 1,
+ &bit_off, &num_bits);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
goto leave;
}
- OCFS_ASSERT(num_bits <= clusters_to_add);
+ OCFS2_ASSERT(num_bits <= clusters_to_add);
/* reserve our write early -- insert_extent may update the inode */
- status = ocfs_journal_access(handle, inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -648,7 +633,7 @@
mlog(0, "Allocating %u clusters at block %u for inode %"MLFu64"\n",
num_bits, bit_off, OCFS2_I(inode)->ip_blkno);
status = ocfs2_insert_extent(osb, handle, inode, fe_bh, block,
- num_bits, meta_ac);
+ num_bits, meta_ac);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -659,7 +644,7 @@
OCFS2_I(inode)->ip_clusters = fe->i_clusters;
spin_unlock(&OCFS2_I(inode)->ip_lock);
- status = ocfs_journal_dirty(handle, fe_bh);
+ status = ocfs2_journal_dirty(handle, fe_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -680,8 +665,7 @@
return status;
}
-/* ocfs_extend_file()
- *
+/*
* Ok, this function is heavy on the goto's - we need to clean it up a
* bit.
*
@@ -689,10 +673,10 @@
* dinode->i_size, NOT how much allocated was actually added to the
* file. It will always be correct, even when we return an error.
*/
-int ocfs_extend_file(ocfs_super *osb,
- struct inode *inode,
- u64 new_i_size,
- u64 *bytes_extended)
+int ocfs2_extend_file(ocfs2_super *osb,
+ struct inode *inode,
+ u64 new_i_size,
+ u64 *bytes_extended)
{
int status = 0;
int restart_func = 0;
@@ -702,7 +686,7 @@
u64 new_fe_size;
struct buffer_head *bh = NULL;
ocfs2_dinode *fe;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
ocfs2_alloc_context *data_ac = NULL;
ocfs2_alloc_context *meta_ac = NULL;
enum ocfs2_alloc_restarted why;
@@ -716,15 +700,15 @@
goto leave;
restart_all:
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
goto leave;
}
- status = ocfs_read_block(osb, OCFS2_I(inode)->ip_blkno, &bh,
- OCFS_BH_CACHED, inode);
+ status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &bh,
+ OCFS2_BH_CACHED, inode);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -732,8 +716,8 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS_ASSERT(i_size_read(inode) == (fe->i_size - *bytes_extended));
- OCFS_ASSERT(new_i_size >= i_size_read(inode));
+ OCFS2_ASSERT(i_size_read(inode) == (fe->i_size - *bytes_extended));
+ OCFS2_ASSERT(new_i_size >= i_size_read(inode));
if (i_size_read(inode) == new_i_size)
goto leave;
@@ -749,9 +733,9 @@
if (!clusters_to_add)
goto do_start_trans;
- num_free_extents = ocfs_num_free_extents(osb,
- inode,
- fe);
+ num_free_extents = ocfs2_num_free_extents(osb,
+ inode,
+ fe);
if (num_free_extents < 0) {
status = num_free_extents;
mlog_errno(status);
@@ -759,10 +743,10 @@
}
if (!num_free_extents) {
- status = ocfs_reserve_new_metadata(osb,
- handle,
- fe,
- &meta_ac);
+ status = ocfs2_reserve_new_metadata(osb,
+ handle,
+ fe,
+ &meta_ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -770,10 +754,10 @@
}
}
- status = ocfs_reserve_clusters(osb,
- handle,
- clusters_to_add,
- &data_ac);
+ status = ocfs2_reserve_clusters(osb,
+ handle,
+ clusters_to_add,
+ &data_ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -787,8 +771,8 @@
down_write(&OCFS2_I(inode)->ip_alloc_sem);
drop_alloc_sem = 1;
do_start_trans:
- credits = ocfs_calc_extend_credits(osb->sb, fe, clusters_to_add);
- handle = ocfs_start_trans(osb, handle, credits);
+ credits = ocfs2_calc_extend_credits(osb->sb, fe, clusters_to_add);
+ handle = ocfs2_start_trans(osb, handle, credits);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -797,13 +781,13 @@
/* Since we got our cluster lock from caller and we don't add
* it to the handle: */
- ocfs_set_inode_lock_trans(osb->journal, inode);
+ ocfs2_set_inode_lock_trans(osb->journal, inode);
restarted_transaction:
/* reserve a write to the file entry early on - that we if we
* run out of credits in the allocation path, we can still
* update i_size. */
- status = ocfs_journal_access(handle, inode, bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -812,14 +796,14 @@
if (!clusters_to_add)
goto no_alloc;
- status = ocfs_extend_allocation(osb,
- inode,
- clusters_to_add,
- bh,
- handle,
- data_ac,
- meta_ac,
- &why);
+ status = ocfs2_extend_allocation(osb,
+ inode,
+ clusters_to_add,
+ bh,
+ handle,
+ data_ac,
+ meta_ac,
+ &why);
if ((status < 0) && (status != -EAGAIN)) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -834,8 +818,8 @@
mlog(0, "restarting function.\n");
restart_func = 1;
} else {
- OCFS_ASSERT(why == RESTART_TRANS);
-
+ OCFS2_ASSERT(why == RESTART_TRANS);
+
new_fe_size = ocfs2_clusters_to_bytes(osb->sb,
fe->i_clusters);
*bytes_extended += new_fe_size - fe->i_size;
@@ -846,7 +830,7 @@
fe->i_mtime = CURRENT_TIME.tv_sec;
fe->i_mtime_nsec = cpu_to_le32(CURRENT_TIME.tv_nsec);
- status = ocfs_journal_dirty(handle, bh);
+ status = ocfs2_journal_dirty(handle, bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -858,10 +842,10 @@
- fe->i_clusters;
mlog(0, "restarting transaction.\n");
/* TODO: This can be more intelligent. */
- credits = ocfs_calc_extend_credits(osb->sb,
- fe,
- clusters_to_add);
- status = ocfs_extend_trans(handle, credits);
+ credits = ocfs2_calc_extend_credits(osb->sb,
+ fe,
+ clusters_to_add);
+ status = ocfs2_extend_trans(handle, credits);
if (status < 0) {
/* handle still has to be committed at
* this point. */
@@ -893,7 +877,7 @@
fe->i_ctime = fe->i_mtime = CURRENT_TIME.tv_sec;
fe->i_ctime_nsec = fe->i_mtime_nsec = cpu_to_le32(CURRENT_TIME.tv_nsec);
- status = ocfs_journal_dirty(handle, bh);
+ status = ocfs2_journal_dirty(handle, bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -905,15 +889,15 @@
drop_alloc_sem = 0;
}
if (handle) {
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
handle = NULL;
}
if (data_ac) {
- ocfs_free_alloc_context(data_ac);
+ ocfs2_free_alloc_context(data_ac);
data_ac = NULL;
}
if (meta_ac) {
- ocfs_free_alloc_context(meta_ac);
+ ocfs2_free_alloc_context(meta_ac);
meta_ac = NULL;
}
if (bh) {
@@ -927,22 +911,18 @@
mlog_exit(status);
return status;
-} /* ocfs_extend_file */
+}
-/*
- * ocfs_setattr()
- *
- */
-int ocfs_setattr(struct dentry *dentry, struct iattr *attr)
+int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
{
int status = 0;
int unlock = 0;
u64 newsize, bytes_added;
struct inode *inode = dentry->d_inode;
struct super_block *sb = inode->i_sb;
- ocfs_super *osb = OCFS2_SB(sb);
+ ocfs2_super *osb = OCFS2_SB(sb);
struct buffer_head *bh = NULL;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
mlog_entry("(0x%p, '%.*s')\n", dentry,
dentry->d_name.len, dentry->d_name.name);
@@ -983,10 +963,10 @@
bytes_added = 0;
if (i_size_read(inode) > newsize)
- status = ocfs_truncate_file(osb, newsize, inode);
+ status = ocfs2_truncate_file(osb, newsize, inode);
else
- status = ocfs_extend_file(osb, inode, newsize,
- &bytes_added);
+ status = ocfs2_extend_file(osb, inode, newsize,
+ &bytes_added);
if (status < 0 && (!bytes_added)) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -1022,7 +1002,7 @@
}
}
- handle = ocfs_start_trans(osb, NULL, OCFS_INODE_UPDATE_CREDITS);
+ handle = ocfs2_start_trans(osb, NULL, OCFS2_INODE_UPDATE_CREDITS);
if (handle == NULL) {
mlog_errno(status);
goto bail;
@@ -1031,7 +1011,7 @@
/* Ok, this is the last transaction we'll do for a setattr so
* just add our lock to the handle and let commit_trans deal
* with it. */
- status = ocfs_handle_add_lock(handle, inode);
+ status = ocfs2_handle_add_lock(handle, inode);
if (status < 0)
mlog_errno(status);
unlock = 0;
@@ -1042,7 +1022,7 @@
goto bail;
}
- status = ocfs_mark_inode_dirty(handle, inode, bh);
+ status = ocfs2_mark_inode_dirty(handle, inode, bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1050,7 +1030,7 @@
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (unlock)
ocfs2_meta_unlock(inode, 1);
if (bh)
@@ -1058,22 +1038,20 @@
mlog_exit(status);
return status;
-} /* ocfs_setattr */
+}
-/*
- * ocfs_getattr()
- *
- */
-int ocfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
+int ocfs2_getattr(struct vfsmount *mnt,
+ struct dentry *dentry,
+ struct kstat *stat)
{
struct inode *inode = dentry->d_inode;
struct super_block *sb = dentry->d_inode->i_sb;
- ocfs_super *osb = sb->s_fs_info;
+ ocfs2_super *osb = sb->s_fs_info;
int err;
mlog_entry_void();
- err = ocfs_inode_revalidate(dentry);
+ err = ocfs2_inode_revalidate(dentry);
if (err) {
if (err != -ENOENT)
mlog_errno(err);
@@ -1091,7 +1069,7 @@
return err;
}
-struct inode_operations ocfs_file_iops = {
- .setattr = ocfs_setattr,
- .getattr = ocfs_getattr,
+struct inode_operations ocfs2_file_iops = {
+ .setattr = ocfs2_setattr,
+ .getattr = ocfs2_getattr,
};
Modified: trunk/fs/ocfs2/file.h
===================================================================
--- trunk/fs/ocfs2/file.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/file.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,36 +26,36 @@
#ifndef OCFS2_FILE_H
#define OCFS2_FILE_H
-extern struct file_operations ocfs_fops;
-extern struct file_operations ocfs_dops;
-extern struct inode_operations ocfs_file_iops;
+extern struct file_operations ocfs2_fops;
+extern struct file_operations ocfs2_dops;
+extern struct inode_operations ocfs2_file_iops;
struct _ocfs2_alloc_context;
enum ocfs2_alloc_restarted {
RESTART_TRANS = 0,
RESTART_META
};
-int ocfs_extend_allocation(ocfs_super *osb,
- struct inode *inode,
- u32 clusters_to_add,
- struct buffer_head *fe_bh,
- ocfs_journal_handle *handle,
- struct _ocfs2_alloc_context *data_ac,
- struct _ocfs2_alloc_context *meta_ac,
- enum ocfs2_alloc_restarted *reason);
-int ocfs_setattr(struct dentry *dentry, struct iattr *attr);
-int ocfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
- struct kstat *stat);
-int ocfs_sync_inode(struct inode *inode);
-int ocfs_extend_file(ocfs_super *osb,
- struct inode *inode,
- u64 new_i_size,
- u64 *bytes_extended);
+int ocfs2_extend_allocation(ocfs2_super *osb,
+ struct inode *inode,
+ u32 clusters_to_add,
+ struct buffer_head *fe_bh,
+ ocfs2_journal_handle *handle,
+ struct _ocfs2_alloc_context *data_ac,
+ struct _ocfs2_alloc_context *meta_ac,
+ enum ocfs2_alloc_restarted *reason);
+int ocfs2_setattr(struct dentry *dentry, struct iattr *attr);
+int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry,
+ struct kstat *stat);
+int ocfs2_sync_inode(struct inode *inode);
+int ocfs2_extend_file(ocfs2_super *osb,
+ struct inode *inode,
+ u64 new_i_size,
+ u64 *bytes_extended);
-int ocfs_set_inode_size(ocfs_journal_handle *handle,
- struct inode *inode,
- struct buffer_head *fe_bh,
- u64 new_i_size);
+int ocfs2_set_inode_size(ocfs2_journal_handle *handle,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ u64 new_i_size);
void ocfs2_file_finish_extension(struct inode *inode, loff_t newsize,
unsigned should_zero);
Modified: trunk/fs/ocfs2/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/heartbeat.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/heartbeat.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -50,42 +50,43 @@
#define OCFS2_HB_NODE_DOWN_PRI (0x0000002)
#define OCFS2_HB_NODE_UP_PRI OCFS2_HB_NODE_DOWN_PRI
-static inline void __ocfs_node_map_set_bit(ocfs_node_map *map,
- int bit);
-static inline void __ocfs_node_map_clear_bit(ocfs_node_map *map,
- int bit);
-static inline int __ocfs_node_map_is_empty(ocfs_node_map *map);
-static void __ocfs_node_map_dup(ocfs_node_map *target,
- ocfs_node_map *from);
-static void __ocfs_node_map_set(ocfs_node_map *target, ocfs_node_map *from);
+static inline void __ocfs2_node_map_set_bit(ocfs2_node_map *map,
+ int bit);
+static inline void __ocfs2_node_map_clear_bit(ocfs2_node_map *map,
+ int bit);
+static inline int __ocfs2_node_map_is_empty(ocfs2_node_map *map);
+static void __ocfs2_node_map_dup(ocfs2_node_map *target,
+ ocfs2_node_map *from);
+static void __ocfs2_node_map_set(ocfs2_node_map *target,
+ ocfs2_node_map *from);
-void ocfs2_init_node_maps(ocfs_super *osb)
+void ocfs2_init_node_maps(ocfs2_super *osb)
{
spin_lock_init(&osb->node_map_lock);
- ocfs_node_map_init(&osb->mounted_map);
- ocfs_node_map_init(&osb->recovery_map);
- ocfs_node_map_init(&osb->umount_map);
+ ocfs2_node_map_init(&osb->mounted_map);
+ ocfs2_node_map_init(&osb->recovery_map);
+ ocfs2_node_map_init(&osb->umount_map);
}
static void ocfs2_hb_node_down_cb(struct o2nm_node *node,
int node_num,
void *data)
{
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
- OCFS_ASSERT(osb->node_num != node_num);
+ OCFS2_ASSERT(osb->node_num != node_num);
mlog(0, "ocfs2: node down event for %d\n", node_num);
- if (ocfs_node_map_test_bit(osb, &osb->umount_map, node_num)) {
+ if (ocfs2_node_map_test_bit(osb, &osb->umount_map, node_num)) {
/* If a node is in the umount map, then we've been
* expecting him to go down and we know ahead of time
* that recovery is not necessary. */
- ocfs_node_map_clear_bit(osb, &osb->umount_map, node_num);
+ ocfs2_node_map_clear_bit(osb, &osb->umount_map, node_num);
return;
}
- ocfs_recovery_thread(osb, node_num);
+ ocfs2_recovery_thread(osb, node_num);
ocfs2_remove_node_from_vote_queues(osb, node_num);
}
@@ -94,25 +95,26 @@
int node_num,
void *data)
{
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
- OCFS_ASSERT(osb->node_num != node_num);
+ OCFS2_ASSERT(osb->node_num != node_num);
mlog(0, "ocfs2: node up event for %d\n", node_num);
- ocfs_node_map_clear_bit(osb, &osb->umount_map, node_num);
+ ocfs2_node_map_clear_bit(osb, &osb->umount_map, node_num);
}
-void ocfs2_setup_hb_callbacks(ocfs_super *osb)
+void ocfs2_setup_hb_callbacks(ocfs2_super *osb)
{
o2hb_setup_callback(&osb->osb_hb_down, O2HB_NODE_DOWN_CB,
- ocfs2_hb_node_down_cb, osb, OCFS2_HB_NODE_DOWN_PRI);
+ ocfs2_hb_node_down_cb, osb,
+ OCFS2_HB_NODE_DOWN_PRI);
o2hb_setup_callback(&osb->osb_hb_up, O2HB_NODE_UP_CB,
ocfs2_hb_node_up_cb, osb, OCFS2_HB_NODE_UP_PRI);
}
/* Most functions here are just stubs for now... */
-int ocfs2_register_hb_callbacks(ocfs_super *osb)
+int ocfs2_register_hb_callbacks(ocfs2_super *osb)
{
int status;
@@ -130,7 +132,7 @@
return status;
}
-void ocfs2_clear_hb_callbacks(ocfs_super *osb)
+void ocfs2_clear_hb_callbacks(ocfs2_super *osb)
{
int status;
@@ -141,10 +143,9 @@
status = o2hb_unregister_callback(&osb->osb_hb_up);
if (status < 0)
mlog_errno(status);
-
}
-void ocfs2_stop_heartbeat(ocfs_super *osb)
+void ocfs2_stop_heartbeat(ocfs2_super *osb)
{
int ret;
char *argv[5], *envp[3];
@@ -175,52 +176,52 @@
/* special case -1 for now
* TODO: should *really* make sure the calling func never passes -1!! */
-void ocfs_node_map_init(ocfs_node_map *map)
+void ocfs2_node_map_init(ocfs2_node_map *map)
{
- map->num_nodes = OCFS_NODE_MAP_MAX_NODES;
- memset(map->map, 0, BITS_TO_LONGS(OCFS_NODE_MAP_MAX_NODES) *
+ map->num_nodes = OCFS2_NODE_MAP_MAX_NODES;
+ memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) *
sizeof(unsigned long));
}
-static inline void __ocfs_node_map_set_bit(ocfs_node_map *map,
- int bit)
+static inline void __ocfs2_node_map_set_bit(ocfs2_node_map *map,
+ int bit)
{
set_bit(bit, map->map);
}
-void ocfs_node_map_set_bit(ocfs_super *osb,
- ocfs_node_map *map,
- int bit)
+void ocfs2_node_map_set_bit(ocfs2_super *osb,
+ ocfs2_node_map *map,
+ int bit)
{
if (bit==-1)
return;
- OCFS_ASSERT(bit < map->num_nodes);
+ OCFS2_ASSERT(bit < map->num_nodes);
spin_lock(&osb->node_map_lock);
- __ocfs_node_map_set_bit(map, bit);
+ __ocfs2_node_map_set_bit(map, bit);
spin_unlock(&osb->node_map_lock);
}
-static inline void __ocfs_node_map_clear_bit(ocfs_node_map *map,
- int bit)
+static inline void __ocfs2_node_map_clear_bit(ocfs2_node_map *map,
+ int bit)
{
clear_bit(bit, map->map);
}
-void ocfs_node_map_clear_bit(ocfs_super *osb,
- ocfs_node_map *map,
- int bit)
+void ocfs2_node_map_clear_bit(ocfs2_super *osb,
+ ocfs2_node_map *map,
+ int bit)
{
if (bit==-1)
return;
- OCFS_ASSERT(bit < map->num_nodes);
+ OCFS2_ASSERT(bit < map->num_nodes);
spin_lock(&osb->node_map_lock);
- __ocfs_node_map_clear_bit(map, bit);
+ __ocfs2_node_map_clear_bit(map, bit);
spin_unlock(&osb->node_map_lock);
}
-int ocfs_node_map_test_bit(ocfs_super *osb,
- ocfs_node_map *map,
- int bit)
+int ocfs2_node_map_test_bit(ocfs2_super *osb,
+ ocfs2_node_map *map,
+ int bit)
{
int ret;
if (bit >= map->num_nodes) {
@@ -233,7 +234,7 @@
return ret;
}
-static inline int __ocfs_node_map_is_empty(ocfs_node_map *map)
+static inline int __ocfs2_node_map_is_empty(ocfs2_node_map *map)
{
int bit;
bit = find_next_bit(map->map, map->num_nodes, 0);
@@ -242,73 +243,73 @@
return 1;
}
-int ocfs_node_map_is_empty(ocfs_super *osb,
- ocfs_node_map *map)
+int ocfs2_node_map_is_empty(ocfs2_super *osb,
+ ocfs2_node_map *map)
{
int ret;
- OCFS_ASSERT(map->num_nodes > 0);
+ OCFS2_ASSERT(map->num_nodes > 0);
spin_lock(&osb->node_map_lock);
- ret = __ocfs_node_map_is_empty(map);
+ ret = __ocfs2_node_map_is_empty(map);
spin_unlock(&osb->node_map_lock);
return ret;
}
-static void __ocfs_node_map_dup(ocfs_node_map *target,
- ocfs_node_map *from)
+static void __ocfs2_node_map_dup(ocfs2_node_map *target,
+ ocfs2_node_map *from)
{
- OCFS_ASSERT(from->num_nodes > 0);
- ocfs_node_map_init(target);
- __ocfs_node_map_set(target, from);
+ OCFS2_ASSERT(from->num_nodes > 0);
+ ocfs2_node_map_init(target);
+ __ocfs2_node_map_set(target, from);
}
/* returns 1 if bit is the only bit set in target, 0 otherwise */
-int ocfs_node_map_is_only(ocfs_super *osb,
- ocfs_node_map *target,
- int bit)
+int ocfs2_node_map_is_only(ocfs2_super *osb,
+ ocfs2_node_map *target,
+ int bit)
{
- ocfs_node_map temp;
+ ocfs2_node_map temp;
int ret;
spin_lock(&osb->node_map_lock);
- __ocfs_node_map_dup(&temp, target);
- __ocfs_node_map_clear_bit(&temp, bit);
- ret = __ocfs_node_map_is_empty(&temp);
+ __ocfs2_node_map_dup(&temp, target);
+ __ocfs2_node_map_clear_bit(&temp, bit);
+ ret = __ocfs2_node_map_is_empty(&temp);
spin_unlock(&osb->node_map_lock);
return ret;
}
-static void __ocfs_node_map_set(ocfs_node_map *target,
- ocfs_node_map *from)
+static void __ocfs2_node_map_set(ocfs2_node_map *target,
+ ocfs2_node_map *from)
{
int num_longs, i;
- OCFS_ASSERT(target->num_nodes == from->num_nodes);
- OCFS_ASSERT(target->num_nodes > 0);
+ OCFS2_ASSERT(target->num_nodes == from->num_nodes);
+ OCFS2_ASSERT(target->num_nodes > 0);
num_longs = BITS_TO_LONGS(target->num_nodes);
for (i = 0; i < num_longs; i++)
target->map[i] = from->map[i];
}
-void ocfs_recovery_map_set(ocfs_super *osb,
- int num)
+void ocfs2_recovery_map_set(ocfs2_super *osb,
+ int num)
{
spin_lock(&osb->node_map_lock);
- __ocfs_node_map_clear_bit(&osb->mounted_map, num);
- __ocfs_node_map_set_bit(&osb->recovery_map, num);
+ __ocfs2_node_map_clear_bit(&osb->mounted_map, num);
+ __ocfs2_node_map_set_bit(&osb->recovery_map, num);
spin_unlock(&osb->node_map_lock);
}
-void ocfs_recovery_map_clear(ocfs_super *osb,
- int num)
+void ocfs2_recovery_map_clear(ocfs2_super *osb,
+ int num)
{
- ocfs_node_map_clear_bit(osb, &osb->recovery_map, num);
+ ocfs2_node_map_clear_bit(osb, &osb->recovery_map, num);
}
-int ocfs_node_map_iterate(ocfs_super *osb,
- ocfs_node_map *map,
- int idx)
+int ocfs2_node_map_iterate(ocfs2_super *osb,
+ ocfs2_node_map *map,
+ int idx)
{
int i = idx;
Modified: trunk/fs/ocfs2/heartbeat.h
===================================================================
--- trunk/fs/ocfs2/heartbeat.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/heartbeat.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,42 +26,42 @@
#ifndef OCFS2_HEARTBEAT_H
#define OCFS2_HEARTBEAT_H
-void ocfs2_init_node_maps(ocfs_super *osb);
+void ocfs2_init_node_maps(ocfs2_super *osb);
-void ocfs2_setup_hb_callbacks(ocfs_super *osb);
-int ocfs2_register_hb_callbacks(ocfs_super *osb);
-void ocfs2_clear_hb_callbacks(ocfs_super *osb);
-void ocfs2_stop_heartbeat(ocfs_super *osb);
+void ocfs2_setup_hb_callbacks(ocfs2_super *osb);
+int ocfs2_register_hb_callbacks(ocfs2_super *osb);
+void ocfs2_clear_hb_callbacks(ocfs2_super *osb);
+void ocfs2_stop_heartbeat(ocfs2_super *osb);
/* node map functions - used to keep track of mounted and in-recovery
* nodes. */
-void ocfs_node_map_init(ocfs_node_map *map);
-int ocfs_node_map_is_empty(ocfs_super *osb,
- ocfs_node_map *map);
-void ocfs_node_map_set_bit(ocfs_super *osb,
- ocfs_node_map *map,
- int bit);
-void ocfs_node_map_clear_bit(ocfs_super *osb,
- ocfs_node_map *map,
- int bit);
-int ocfs_node_map_test_bit(ocfs_super *osb,
- ocfs_node_map *map,
- int bit);
-int ocfs_node_map_iterate(ocfs_super *osb,
- ocfs_node_map *map,
- int idx);
-static inline int ocfs_node_map_first_set_bit(ocfs_super *osb,
- ocfs_node_map *map)
+void ocfs2_node_map_init(ocfs2_node_map *map);
+int ocfs2_node_map_is_empty(ocfs2_super *osb,
+ ocfs2_node_map *map);
+void ocfs2_node_map_set_bit(ocfs2_super *osb,
+ ocfs2_node_map *map,
+ int bit);
+void ocfs2_node_map_clear_bit(ocfs2_super *osb,
+ ocfs2_node_map *map,
+ int bit);
+int ocfs2_node_map_test_bit(ocfs2_super *osb,
+ ocfs2_node_map *map,
+ int bit);
+int ocfs2_node_map_iterate(ocfs2_super *osb,
+ ocfs2_node_map *map,
+ int idx);
+static inline int ocfs2_node_map_first_set_bit(ocfs2_super *osb,
+ ocfs2_node_map *map)
{
- return ocfs_node_map_iterate(osb, map, 0);
+ return ocfs2_node_map_iterate(osb, map, 0);
}
-void ocfs_recovery_map_set(ocfs_super *osb,
- int num);
-void ocfs_recovery_map_clear(ocfs_super *osb,
- int num);
+void ocfs2_recovery_map_set(ocfs2_super *osb,
+ int num);
+void ocfs2_recovery_map_clear(ocfs2_super *osb,
+ int num);
/* returns 1 if bit is the only bit set in target, 0 otherwise */
-int ocfs_node_map_is_only(ocfs_super *osb,
- ocfs_node_map *target,
- int bit);
+int ocfs2_node_map_is_only(ocfs2_super *osb,
+ ocfs2_node_map *target,
+ int bit);
#endif /* OCFS2_HEARTBEAT_H */
Modified: trunk/fs/ocfs2/inode.c
===================================================================
--- trunk/fs/ocfs2/inode.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/inode.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -53,7 +53,7 @@
#include "buffer_head_io.h"
-extern struct address_space_operations ocfs_aops;
+extern struct address_space_operations ocfs2_aops;
struct ocfs2_find_inode_args
{
@@ -62,18 +62,15 @@
u32 flags;
};
-static int ocfs_read_locked_inode(struct inode *inode, struct ocfs2_find_inode_args *args);
-static int ocfs_init_locked_inode(struct inode *inode, void *opaque);
+static int ocfs2_read_locked_inode(struct inode *inode,
+ struct ocfs2_find_inode_args *args);
+static int ocfs2_init_locked_inode(struct inode *inode, void *opaque);
static int ocfs2_find_actor(struct inode *inode, void *opaque);
-static int ocfs_truncate_for_delete(ocfs_super *osb,
+static int ocfs2_truncate_for_delete(ocfs2_super *osb,
struct inode *inode,
struct buffer_head *fe_bh);
-/*
- * ocfs_ilookup()
- * blkno is *required*
- */
-struct inode *ocfs_ilookup(ocfs_super *osb, u64 blkno)
+struct inode *ocfs2_ilookup(ocfs2_super *osb, u64 blkno)
{
struct ocfs2_find_inode_args args;
@@ -83,11 +80,7 @@
return ilookup5(osb->sb, args.ino, ocfs2_find_actor, &args);
}
-/*
- * ocfs_iget()
- * blkno is *required*
- */
-struct inode *ocfs_iget(ocfs_super *osb, u64 blkno)
+struct inode *ocfs2_iget(ocfs2_super *osb, u64 blkno)
{
struct inode *inode = NULL;
struct super_block *sb = osb->sb;
@@ -109,13 +102,13 @@
args.ino = ino_from_blkno(sb, blkno);
inode = iget5_locked(sb, args.ino, ocfs2_find_actor,
- ocfs_init_locked_inode, &args);
+ ocfs2_init_locked_inode, &args);
/* inode was *not* in the inode cache. 2.6.x requires
* us to do our own read_inode call and unlock it
* afterwards. */
if (inode && inode->i_state & I_NEW) {
mlog(0, "Inode was not in inode cache, reading it.\n");
- ocfs_read_locked_inode(inode, &args);
+ ocfs2_read_locked_inode(inode, &args);
unlock_new_inode(inode);
}
if (inode == NULL) {
@@ -138,14 +131,14 @@
mlog_exit_ptr(inode);
return inode;
-} /* ocfs_iget */
+}
/*
* here's how inodes get read from disk:
- * iget5_locked -> find_actor -> OCFS_FIND_ACTOR
+ * iget5_locked -> find_actor -> OCFS2_FIND_ACTOR
* found? : return the in-memory inode
- * not found? : get_new_inode -> OCFS_INIT_LOCKED_INODE
+ * not found? : get_new_inode -> OCFS2_INIT_LOCKED_INODE
*/
static int ocfs2_find_actor(struct inode *inode, void *opaque)
@@ -173,7 +166,7 @@
* us to sleep.
* return 0 on success, 1 on failure
*/
-static int ocfs_init_locked_inode(struct inode *inode, void *opaque)
+static int ocfs2_init_locked_inode(struct inode *inode, void *opaque)
{
struct ocfs2_find_inode_args *args = opaque;
@@ -186,15 +179,11 @@
return 0;
}
-/*
- * ocfs_populate_inode()
- *
- */
-int ocfs_populate_inode(struct inode *inode, ocfs2_dinode *fe,
+int ocfs2_populate_inode(struct inode *inode, ocfs2_dinode *fe,
int create_ino)
{
struct super_block *sb;
- ocfs_super *osb;
+ ocfs2_super *osb;
int status = -EINVAL;
mlog_entry("(0x%p, size:%"MLFu64")\n", inode, fe->i_size);
@@ -233,7 +222,7 @@
inode->i_blocks = 0;
else
inode->i_blocks = ocfs2_align_bytes_to_sectors(fe->i_size);
- inode->i_mapping->a_ops = &ocfs_aops;
+ inode->i_mapping->a_ops = &ocfs2_aops;
inode->i_flags |= S_NOATIME;
inode->i_atime.tv_sec = fe->i_atime;
inode->i_atime.tv_nsec = le32_to_cpu(fe->i_atime_nsec);
@@ -265,31 +254,31 @@
OCFS2_I(inode)->ip_flags |= OCFS2_INODE_BITMAP;
} else if (fe->i_flags & OCFS2_SUPER_BLOCK_FL) {
mlog(0, "superblock inode: i_ino=%lu\n", inode->i_ino);
- // we can't actually hit this as read_inode can't handle
- // superblocks today ;-)
+ /* we can't actually hit this as read_inode can't
+ * handle superblocks today ;-) */
BUG();
}
switch (inode->i_mode & S_IFMT) {
case S_IFREG:
ocfs2_init_inode_seq(inode);
- inode->i_fop = &ocfs_fops;
- inode->i_op = &ocfs_file_iops;
+ inode->i_fop = &ocfs2_fops;
+ inode->i_op = &ocfs2_file_iops;
i_size_write(inode, fe->i_size);
OCFS2_I(inode)->ip_mmu_private = inode->i_size;
break;
case S_IFDIR:
ocfs2_init_inode_seq(inode);
- inode->i_op = &ocfs_dir_iops;
- inode->i_fop = &ocfs_dops;
+ inode->i_op = &ocfs2_dir_iops;
+ inode->i_fop = &ocfs2_dops;
i_size_write(inode, fe->i_size);
break;
case S_IFLNK:
ocfs2_init_inode_seq(inode);
if (ocfs2_inode_is_fast_symlink(inode))
- inode->i_op = &ocfs_fast_symlink_inode_operations;
+ inode->i_op = &ocfs2_fast_symlink_inode_operations;
else
- inode->i_op = &ocfs_symlink_inode_operations;
+ inode->i_op = &ocfs2_symlink_inode_operations;
i_size_write(inode, fe->i_size);
break;
default:
@@ -299,24 +288,25 @@
}
status = ocfs2_inode_lock_res_init(&OCFS2_I(inode)->ip_meta_lockres,
- OCFS_TYPE_META, inode);
+ OCFS2_TYPE_META, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
}
status = ocfs2_inode_lock_res_init(&OCFS2_I(inode)->ip_data_lockres,
- OCFS_TYPE_DATA, inode);
+ OCFS2_TYPE_DATA, inode);
if (status < 0)
mlog_errno(status);
bail:
mlog_exit(status);
return status;
-} /* ocfs_populate_inode */
+} /* ocfs2_populate_inode */
-static int ocfs_read_locked_inode(struct inode *inode, struct ocfs2_find_inode_args *args)
+static int ocfs2_read_locked_inode(struct inode *inode,
+ struct ocfs2_find_inode_args *args)
{
struct super_block *sb;
- ocfs_super *osb;
+ ocfs2_super *osb;
ocfs2_dinode *fe;
struct buffer_head *bh = NULL;
int status;
@@ -341,7 +331,7 @@
/* Read the FE off disk. This is safe because the kernel only
* does one read_inode2 for a new inode, and if it doesn't
* exist yet then nobody can be working on it! */
- status = ocfs_read_block(osb, args->blkno, &bh, 0, NULL);
+ status = ocfs2_read_block(osb, args->blkno, &bh, 0, NULL);
if (status < 0) {
mlog_errno(status);
make_bad_inode(inode);
@@ -361,7 +351,7 @@
inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev));
status = -EINVAL;
- if (ocfs_populate_inode(inode, fe, 0) < 0) {
+ if (ocfs2_populate_inode(inode, fe, 0) < 0) {
mlog(ML_ERROR, "populate inode failed! i_blkno=%"MLFu64", "
"i_ino=%lu\n", fe->i_blkno, inode->i_ino);
make_bad_inode(inode);
@@ -384,17 +374,17 @@
return status;
}
-void ocfs_sync_blockdev(struct super_block *sb)
+void ocfs2_sync_blockdev(struct super_block *sb)
{
sync_blockdev(sb->s_bdev);
}
-static int ocfs_truncate_for_delete(ocfs_super *osb,
- struct inode *inode,
- struct buffer_head *fe_bh)
+static int ocfs2_truncate_for_delete(ocfs2_super *osb,
+ struct inode *inode,
+ struct buffer_head *fe_bh)
{
int status = 0;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
ocfs2_truncate_context *tc = NULL;
ocfs2_dinode *fe;
@@ -406,36 +396,36 @@
if (!fe->i_clusters)
goto bail;
- handle = ocfs_start_trans(osb, handle, OCFS_INODE_UPDATE_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_INODE_UPDATE_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- status = ocfs_set_inode_size(handle, inode, fe_bh, 0ULL);
+ status = ocfs2_set_inode_size(handle, inode, fe_bh, 0ULL);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
handle = NULL;
- status = ocfs_prepare_truncate(osb, inode, fe_bh, &tc);
+ status = ocfs2_prepare_truncate(osb, inode, fe_bh, &tc);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_commit_truncate(osb, inode, fe_bh, tc);
+ status = ocfs2_commit_truncate(osb, inode, fe_bh, tc);
if (status < 0) {
mlog_errno(status);
goto bail;
}
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
mlog_exit(status);
return status;
@@ -448,8 +438,8 @@
int orphaned_slot;
struct inode *orphan_dir_inode = NULL;
struct inode *inode_alloc_inode = NULL;
- ocfs_journal_handle *handle = NULL;
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_journal_handle *handle = NULL;
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct buffer_head *orphan_dir_bh = NULL;
struct buffer_head *inode_alloc_bh = NULL;
struct buffer_head *fe_bh = NULL;
@@ -578,22 +568,22 @@
}
/* Oop, lets be carefull of lock / trans ordering here... */
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
goto bail_unblock;
}
- orphan_dir_inode = ocfs_get_system_file_inode(osb,
- ORPHAN_DIR_SYSTEM_INODE,
- orphaned_slot);
+ orphan_dir_inode = ocfs2_get_system_file_inode(osb,
+ ORPHAN_DIR_SYSTEM_INODE,
+ orphaned_slot);
if (!orphan_dir_inode) {
status = -EEXIST;
mlog_errno(status);
goto bail_unblock;
}
- ocfs_handle_add_inode(handle, orphan_dir_inode);
+ ocfs2_handle_add_inode(handle, orphan_dir_inode);
status = ocfs2_meta_lock(orphan_dir_inode, handle, &orphan_dir_bh, 1);
if (status < 0) {
mlog_errno(status);
@@ -604,44 +594,45 @@
* don't want recovery being run from another node to vote for
* an inode delete on us -- this will result in two nodes
* truncating the same file! */
- status = ocfs_truncate_for_delete(osb, inode, fe_bh);
+ status = ocfs2_truncate_for_delete(osb, inode, fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail_unblock;
}
inode_alloc_inode =
- ocfs_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE,
- le16_to_cpu(fe->i_suballoc_slot));
+ ocfs2_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE,
+ le16_to_cpu(fe->i_suballoc_slot));
if (!inode_alloc_inode) {
status = -EEXIST;
mlog_errno(status);
goto bail_unblock;
}
- ocfs_handle_add_inode(handle, inode_alloc_inode);
- status = ocfs2_meta_lock(inode_alloc_inode, handle, &inode_alloc_bh, 1);
+ ocfs2_handle_add_inode(handle, inode_alloc_inode);
+ status = ocfs2_meta_lock(inode_alloc_inode, handle, &inode_alloc_bh,
+ 1);
if (status < 0) {
mlog_errno(status);
goto bail_unblock;
}
- handle = ocfs_start_trans(osb, handle, OCFS_DELETE_INODE_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_DELETE_INODE_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
goto bail_unblock;
}
- status = ocfs_orphan_del(osb, handle, orphan_dir_inode, inode,
- orphan_dir_bh);
+ status = ocfs2_orphan_del(osb, handle, orphan_dir_inode, inode,
+ orphan_dir_bh);
if (status < 0) {
mlog_errno(status);
goto bail_unblock;
}
/* set the inodes dtime */
- status = ocfs_journal_access(handle, inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail_unblock;
@@ -650,7 +641,7 @@
fe->i_dtime = CURRENT_TIME.tv_sec;
fe->i_flags &= (~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL));
- status = ocfs_journal_dirty(handle, fe_bh);
+ status = ocfs2_journal_dirty(handle, fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail_unblock;
@@ -671,7 +662,7 @@
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (unlock)
ocfs2_meta_unlock(inode, 1);
if (orphan_dir_bh)
@@ -690,10 +681,6 @@
mlog_exit_void();
}
-/*
- * ocfs2_clear_inode()
- *
- */
void ocfs2_clear_inode(struct inode *inode)
{
int status;
@@ -770,30 +757,30 @@
}
/*
- * TODO: this should probably be merged into ocfs_get_block
+ * TODO: this should probably be merged into ocfs2_get_block
*
* However, you now need to pay attention to the cont_prepare_write()
- * stuff in ocfs_get_block (that is, ocfs_get_block pretty much
+ * stuff in ocfs2_get_block (that is, ocfs2_get_block pretty much
* expects never to extend).
*/
-struct buffer_head *ocfs_bread(struct inode *inode,
- int block, int *err, int reada)
+struct buffer_head *ocfs2_bread(struct inode *inode,
+ int block, int *err, int reada)
{
struct buffer_head *bh = NULL;
int tmperr;
u64 p_blkno;
- int readflags = OCFS_BH_CACHED;
+ int readflags = OCFS2_BH_CACHED;
#if 0
/* only turn this on if we know we can deal with read_block
* returning nothing */
if (reada)
- readflags |= OCFS_BH_READAHEAD;
+ readflags |= OCFS2_BH_READAHEAD;
#endif
if (((u64)block << inode->i_sb->s_blocksize_bits) >=
i_size_read(inode)) {
- OCFS_ASSERT(reada);
+ OCFS2_ASSERT(reada);
return NULL;
}
@@ -804,8 +791,8 @@
goto fail;
}
- tmperr = ocfs_read_block(OCFS2_SB(inode->i_sb), p_blkno, &bh,
- readflags, inode);
+ tmperr = ocfs2_read_block(OCFS2_SB(inode->i_sb), p_blkno, &bh,
+ readflags, inode);
if (tmperr < 0)
goto fail;
@@ -824,15 +811,13 @@
}
/*
- * ocfs_inode_revalidate()
- *
* This is called from our getattr.
*/
-int ocfs_inode_revalidate(struct dentry *dentry)
+int ocfs2_inode_revalidate(struct dentry *dentry)
{
struct inode *inode = dentry->d_inode;
int status = 0;
- ocfs_super *osb;
+ ocfs2_super *osb;
mlog_entry("(inode = 0x%p, ino = %"MLFu64")\n", inode,
inode ? OCFS2_I(inode)->ip_blkno : 0ULL);
@@ -854,6 +839,8 @@
}
spin_unlock(&OCFS2_I(inode)->ip_lock);
+ /* Let ocfs2_meta_lock do the work of updating our struct
+ * inode for us. */
status = ocfs2_meta_lock(inode, NULL, NULL, 0);
if (status < 0) {
mlog_errno(status);
@@ -864,26 +851,24 @@
mlog_exit(status);
return status;
-} /* ocfs_inode_revalidate */
+}
/*
- * ocfs_mark_inode_dirty
- *
* Updates a disk inode from a
* struct inode.
* Only takes ip_lock.
*/
-int ocfs_mark_inode_dirty(ocfs_journal_handle *handle,
- struct inode *inode,
- struct buffer_head *bh)
+int ocfs2_mark_inode_dirty(ocfs2_journal_handle *handle,
+ struct inode *inode,
+ struct buffer_head *bh)
{
int status;
ocfs2_dinode *fe = (ocfs2_dinode *) bh->b_data;
mlog_entry("(inode %"MLFu64")\n", OCFS2_I(inode)->ip_blkno);
- status = ocfs_journal_access(handle, inode, bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -905,7 +890,7 @@
fe->i_mtime = inode->i_mtime.tv_sec;
fe->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec);
- status = ocfs_journal_dirty(handle, bh);
+ status = ocfs2_journal_dirty(handle, bh);
if (status < 0)
mlog_errno(status);
@@ -914,18 +899,17 @@
mlog_exit(status);
return status;
-} /* ocfs_mark_inode_dirty */
+}
/*
- * ocfs_refresh_inode
- *
+ *
* Updates a struct inode from a disk inode.
* does no i/o, only takes ip_lock.
*/
-void ocfs_refresh_inode(struct inode *inode,
+void ocfs2_refresh_inode(struct inode *inode,
ocfs2_dinode *fe)
{
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
spin_lock(&OCFS2_I(inode)->ip_lock);
@@ -951,4 +935,4 @@
inode->i_ctime.tv_nsec = le32_to_cpu(fe->i_ctime_nsec);
spin_unlock(&OCFS2_I(inode)->ip_lock);
-} /* ocfs_refresh_inode */
+}
Modified: trunk/fs/ocfs2/inode.h
===================================================================
--- trunk/fs/ocfs2/inode.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/inode.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -53,7 +53,7 @@
* out other I/O to the inode until we either commit or
* abort. */
struct list_head ip_handle_list;
- struct _ocfs_journal_handle *ip_handle;
+ struct _ocfs2_journal_handle *ip_handle;
atomic_t ip_clean_buffer_seq;
u32 ip_flags; /* see below */
@@ -101,27 +101,27 @@
extern kmem_cache_t *ocfs2_inode_cache;
-struct buffer_head *ocfs_bread(struct inode *inode, int block,
- int *err, int reada);
+struct buffer_head *ocfs2_bread(struct inode *inode, int block,
+ int *err, int reada);
void ocfs2_clear_inode(struct inode *inode);
void ocfs2_delete_inode(struct inode *inode);
-struct inode *ocfs_iget(ocfs_super *osb, u64 feoff);
-struct inode *ocfs_ilookup(ocfs_super *osb, u64 feoff);
-int ocfs_inode_init_private(struct inode *inode);
-int ocfs_inode_revalidate(struct dentry *dentry);
-int ocfs_populate_inode(struct inode *inode, ocfs2_dinode *fe,
+struct inode *ocfs2_iget(ocfs2_super *osb, u64 feoff);
+struct inode *ocfs2_ilookup(ocfs2_super *osb, u64 feoff);
+int ocfs2_inode_init_private(struct inode *inode);
+int ocfs2_inode_revalidate(struct dentry *dentry);
+int ocfs2_populate_inode(struct inode *inode, ocfs2_dinode *fe,
int create_ino);
-void ocfs_read_inode(struct inode *inode);
-void ocfs_read_inode2(struct inode *inode, void *opaque);
-ssize_t ocfs_rw_direct(int rw, struct file *filp, char *buf,
- size_t size, loff_t *offp);
-void ocfs_sync_blockdev(struct super_block *sb);
-void ocfs_refresh_inode(struct inode *inode,
- ocfs2_dinode *fe);
-int ocfs_mark_inode_dirty(ocfs_journal_handle *handle,
- struct inode *inode,
- struct buffer_head *bh);
-int ocfs_aio_read(struct file *file, struct kiocb *req, struct iocb *iocb);
-int ocfs_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb);
+void ocfs2_read_inode(struct inode *inode);
+void ocfs2_read_inode2(struct inode *inode, void *opaque);
+ssize_t ocfs2_rw_direct(int rw, struct file *filp, char *buf,
+ size_t size, loff_t *offp);
+void ocfs2_sync_blockdev(struct super_block *sb);
+void ocfs2_refresh_inode(struct inode *inode,
+ ocfs2_dinode *fe);
+int ocfs2_mark_inode_dirty(ocfs2_journal_handle *handle,
+ struct inode *inode,
+ struct buffer_head *bh);
+int ocfs2_aio_read(struct file *file, struct kiocb *req, struct iocb *iocb);
+int ocfs2_aio_write(struct file *file, struct kiocb *req, struct iocb *iocb);
#endif /* OCFS2_INODE_H */
Modified: trunk/fs/ocfs2/journal.c
===================================================================
--- trunk/fs/ocfs2/journal.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/journal.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -52,33 +52,30 @@
spinlock_t trans_inc_lock = SPIN_LOCK_UNLOCKED;
-static int ocfs_force_read_journal(struct inode *inode);
-static int ocfs_recover_node(ocfs_super *osb,
+static int ocfs2_force_read_journal(struct inode *inode);
+static int ocfs2_recover_node(ocfs2_super *osb,
int node_num);
-static int __ocfs_recovery_thread(void *arg);
-static int ocfs_commit_cache(ocfs_super *osb);
-static int ocfs_wait_on_mount(ocfs_super *osb);
-static void ocfs_handle_cleanup_locks(ocfs_journal *journal,
- ocfs_journal_handle *handle,
+static int __ocfs2_recovery_thread(void *arg);
+static int ocfs2_commit_cache(ocfs2_super *osb);
+static int ocfs2_wait_on_mount(ocfs2_super *osb);
+static void ocfs2_handle_cleanup_locks(ocfs2_journal *journal,
+ ocfs2_journal_handle *handle,
int set_id);
-static void ocfs_commit_unstarted_handle(ocfs_journal_handle *handle);
-static int ocfs_journal_toggle_dirty(ocfs_super *osb,
+static void ocfs2_commit_unstarted_handle(ocfs2_journal_handle *handle);
+static int ocfs2_journal_toggle_dirty(ocfs2_super *osb,
int dirty);
-static int ocfs2_trylock_journal(ocfs_super *osb,
+static int ocfs2_trylock_journal(ocfs2_super *osb,
int slot_num);
-static int ocfs_recover_orphans(ocfs_super *osb,
+static int ocfs2_recover_orphans(ocfs2_super *osb,
int slot);
-static int ocfs_commit_thread(void *arg);
+static int ocfs2_commit_thread(void *arg);
-/*
- * ocfs_commit_cache()
- */
-static int ocfs_commit_cache(ocfs_super *osb)
+static int ocfs2_commit_cache(ocfs2_super *osb)
{
int status = 0;
unsigned int flushed;
unsigned long old_id;
- ocfs_journal *journal = NULL;
+ ocfs2_journal *journal = NULL;
mlog_entry_void();
@@ -102,7 +99,7 @@
goto finally;
}
- old_id = ocfs_inc_trans_id(journal);
+ old_id = ocfs2_inc_trans_id(journal);
flushed = atomic_read(&journal->j_num_trans);
atomic_set(&journal->j_num_trans, 0);
@@ -116,11 +113,11 @@
finally:
mlog_exit(status);
return status;
-} /* ocfs_commit_cache */
+}
-ocfs_journal_handle *ocfs_alloc_handle(ocfs_super *osb)
+ocfs2_journal_handle *ocfs2_alloc_handle(ocfs2_super *osb)
{
- ocfs_journal_handle *retval = NULL;
+ ocfs2_journal_handle *retval = NULL;
retval = kmalloc(sizeof(*retval), GFP_KERNEL);
if (!retval) {
@@ -144,9 +141,9 @@
/* pass it NULL and it will allocate a new handle object for you. If
* you pass it a handle however, it may still return NULL, in which
* case it has free'd the passed handle for you. */
-ocfs_journal_handle *ocfs_start_trans(ocfs_super *osb,
- ocfs_journal_handle *handle,
- int max_buffs)
+ocfs2_journal_handle *ocfs2_start_trans(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ int max_buffs)
{
journal_t *journal = osb->journal->j_journal;
@@ -155,8 +152,8 @@
if (!osb || !osb->journal->j_journal)
BUG();
- OCFS_ASSERT(osb->journal->j_state != OCFS_JOURNAL_FREE);
- OCFS_ASSERT(max_buffs > 0);
+ OCFS2_ASSERT(osb->journal->j_state != OCFS2_JOURNAL_FREE);
+ OCFS2_ASSERT(max_buffs > 0);
/* JBD might support this, but our journalling code doesn't yet. */
if (journal_current_handle()) {
@@ -165,7 +162,7 @@
}
if (!handle)
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (!handle) {
mlog(ML_ERROR, "Failed to allocate memory for journal "
"handle!\n");
@@ -188,7 +185,7 @@
}
atomic_inc(&(osb->journal->j_num_trans));
- handle->flags |= OCFS_HANDLE_STARTED;
+ handle->flags |= OCFS2_HANDLE_STARTED;
mlog_exit_ptr(handle);
return handle;
@@ -196,16 +193,17 @@
done_free:
if (handle)
- ocfs_commit_unstarted_handle(handle); /* will kfree handle */
+ ocfs2_commit_unstarted_handle(handle); /* will kfree handle */
mlog_exit(NULL);
return NULL;
-} /* ocfs_start_trans */
+}
-void ocfs_handle_add_inode(ocfs_journal_handle *handle, struct inode *inode)
+void ocfs2_handle_add_inode(ocfs2_journal_handle *handle,
+ struct inode *inode)
{
- OCFS_ASSERT(handle);
- OCFS_ASSERT(inode);
+ OCFS2_ASSERT(handle);
+ OCFS2_ASSERT(inode);
atomic_inc(&inode->i_count);
@@ -213,15 +211,15 @@
down(&inode->i_sem);
/* sanity check */
- OCFS_ASSERT(!OCFS2_I(inode)->ip_handle);
- OCFS_ASSERT(list_empty(&OCFS2_I(inode)->ip_handle_list));
+ OCFS2_ASSERT(!OCFS2_I(inode)->ip_handle);
+ OCFS2_ASSERT(list_empty(&OCFS2_I(inode)->ip_handle_list));
OCFS2_I(inode)->ip_handle = handle;
list_del(&(OCFS2_I(inode)->ip_handle_list));
list_add_tail(&(OCFS2_I(inode)->ip_handle_list), &(handle->inode_list));
}
-static void ocfs_handle_unlock_inodes(ocfs_journal_handle *handle)
+static void ocfs2_handle_unlock_inodes(ocfs2_journal_handle *handle)
{
struct list_head *p, *n;
struct inode *inode;
@@ -242,51 +240,49 @@
/* This is trivial so we do it out of the main commit
* paths. Beware, it can be called from start_trans too! */
-static void ocfs_commit_unstarted_handle(ocfs_journal_handle *handle)
+static void ocfs2_commit_unstarted_handle(ocfs2_journal_handle *handle)
{
mlog_entry_void();
- OCFS_ASSERT(!(handle->flags & OCFS_HANDLE_STARTED));
+ OCFS2_ASSERT(!(handle->flags & OCFS2_HANDLE_STARTED));
- ocfs_handle_unlock_inodes(handle);
+ ocfs2_handle_unlock_inodes(handle);
/* You are allowed to add journal locks before the transaction
* has started. */
- ocfs_handle_cleanup_locks(handle->journal, handle, 0);
+ ocfs2_handle_cleanup_locks(handle->journal, handle, 0);
kfree(handle);
+
mlog_exit_void();
}
-/*
- * ocfs_commit_trans
- */
-void ocfs_commit_trans(ocfs_journal_handle *handle)
+void ocfs2_commit_trans(ocfs2_journal_handle *handle)
{
handle_t *jbd_handle;
int retval;
- ocfs_journal *journal = handle->journal;
+ ocfs2_journal *journal = handle->journal;
mlog_entry_void();
- OCFS_ASSERT(handle);
+ OCFS2_ASSERT(handle);
- if (!(handle->flags & OCFS_HANDLE_STARTED)) {
- ocfs_commit_unstarted_handle(handle);
+ if (!(handle->flags & OCFS2_HANDLE_STARTED)) {
+ ocfs2_commit_unstarted_handle(handle);
mlog_exit_void();
return;
}
/* release inode semaphores we took during this transaction */
- ocfs_handle_unlock_inodes(handle);
+ ocfs2_handle_unlock_inodes(handle);
- /* ocfs_extend_trans may have had to call journal_restart
+ /* ocfs2_extend_trans may have had to call journal_restart
* which will always commit the transaction, but may return
* error for any number of reasons. If this is the case, we
* clear k_handle as it's not valid any more. */
if (handle->k_handle) {
jbd_handle = handle->k_handle;
- if (handle->flags & OCFS_HANDLE_SYNC)
+ if (handle->flags & OCFS2_HANDLE_SYNC)
jbd_handle->h_sync = 1;
else
jbd_handle->h_sync = 0;
@@ -303,13 +299,13 @@
handle->k_handle = NULL; /* it's been free'd in journal_stop */
}
- ocfs_handle_cleanup_locks(journal, handle, 1);
+ ocfs2_handle_cleanup_locks(journal, handle, 1);
up_read(&journal->j_trans_barrier);
kfree(handle);
mlog_exit_void();
-} /* ocfs_commit_trans */
+}
/*
* 'nblocks' is what you want to add to the current
@@ -324,13 +320,14 @@
* good because transaction ids haven't yet been recorded on the
* cluster locks associated with this handle.
*/
-int ocfs_extend_trans(ocfs_journal_handle *handle, int nblocks)
+int ocfs2_extend_trans(ocfs2_journal_handle *handle,
+ int nblocks)
{
int status;
- OCFS_ASSERT(handle);
- OCFS_ASSERT(handle->flags & OCFS_HANDLE_STARTED);
- OCFS_ASSERT(nblocks);
+ OCFS2_ASSERT(handle);
+ OCFS2_ASSERT(handle->flags & OCFS2_HANDLE_STARTED);
+ OCFS2_ASSERT(nblocks);
mlog_entry_void();
@@ -361,26 +358,23 @@
return status;
}
-/*
- * ocfs_journal_access
- */
-int ocfs_journal_access(ocfs_journal_handle *handle,
- struct inode *inode,
- struct buffer_head *bh,
- int type)
+int ocfs2_journal_access(ocfs2_journal_handle *handle,
+ struct inode *inode,
+ struct buffer_head *bh,
+ int type)
{
int status;
- OCFS_ASSERT(inode);
- OCFS_ASSERT(handle);
- OCFS_ASSERT(bh);
- OCFS_ASSERT((handle->flags & OCFS_HANDLE_STARTED));
+ OCFS2_ASSERT(inode);
+ OCFS2_ASSERT(handle);
+ OCFS2_ASSERT(bh);
+ OCFS2_ASSERT((handle->flags & OCFS2_HANDLE_STARTED));
- mlog_entry("(bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %hu)\n",
+ mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %hu\n",
(unsigned long long)bh->b_blocknr, type,
- (type == OCFS_JOURNAL_ACCESS_CREATE) ?
- "OCFS_JOURNAL_ACCESS_CREATE" :
- "OCFS_JOURNAL_ACCESS_WRITE",
+ (type == OCFS2_JOURNAL_ACCESS_CREATE) ?
+ "OCFS2_JOURNAL_ACCESS_CREATE" :
+ "OCFS2_JOURNAL_ACCESS_WRITE",
bh->b_size);
/* we can safely remove this assertion after testing. */
@@ -393,12 +387,12 @@
down(&OCFS2_I(inode)->ip_io_sem);
switch (type) {
- case OCFS_JOURNAL_ACCESS_CREATE:
- case OCFS_JOURNAL_ACCESS_WRITE:
+ case OCFS2_JOURNAL_ACCESS_CREATE:
+ case OCFS2_JOURNAL_ACCESS_WRITE:
status = kapi_journal_get_write_access(handle->k_handle, bh);
break;
- case OCFS_JOURNAL_ACCESS_UNDO:
+ case OCFS2_JOURNAL_ACCESS_UNDO:
status = kapi_journal_get_undo_access(handle->k_handle, bh);
break;
@@ -414,18 +408,14 @@
mlog_exit(status);
return status;
-} /* ocfs_journal_access */
+}
-/*
- * ocfs_journal_dirty
- *
- * We also have to add the buffer to our handles list.
- */
-int ocfs_journal_dirty(ocfs_journal_handle *handle, struct buffer_head *bh)
+int ocfs2_journal_dirty(ocfs2_journal_handle *handle,
+ struct buffer_head *bh)
{
int status;
- OCFS_ASSERT((handle->flags & OCFS_HANDLE_STARTED));
+ OCFS2_ASSERT((handle->flags & OCFS2_HANDLE_STARTED));
mlog_entry("(bh->b_blocknr=%llu)\n",
(unsigned long long)bh->b_blocknr);
@@ -438,16 +428,16 @@
mlog_exit(status);
return status;
-} /* ocfs_journal_dirty */
+}
/* We always assume you're adding a metadata lock at level 'ex' */
-int ocfs_handle_add_lock(ocfs_journal_handle *handle,
- struct inode *inode)
+int ocfs2_handle_add_lock(ocfs2_journal_handle *handle,
+ struct inode *inode)
{
int status;
- ocfs_journal_lock *lock;
+ ocfs2_journal_lock *lock;
- OCFS_ASSERT(inode);
+ OCFS2_ASSERT(inode);
lock = kmem_cache_alloc(ocfs2_lock_cache, GFP_NOFS);
if (!lock) {
@@ -469,22 +459,22 @@
return status;
}
-static void ocfs_handle_cleanup_locks(ocfs_journal *journal,
- ocfs_journal_handle *handle,
- int set_id)
+static void ocfs2_handle_cleanup_locks(ocfs2_journal *journal,
+ ocfs2_journal_handle *handle,
+ int set_id)
{
struct list_head *p, *n;
- ocfs_journal_lock *lock;
+ ocfs2_journal_lock *lock;
struct inode *inode;
list_for_each_safe(p, n, &(handle->locks)) {
- lock = list_entry(p, ocfs_journal_lock, jl_lock_list);
+ lock = list_entry(p, ocfs2_journal_lock, jl_lock_list);
list_del(&lock->jl_lock_list);
handle->num_locks--;
inode = lock->jl_inode;
if (set_id)
- ocfs_set_inode_lock_trans(journal, inode);
+ ocfs2_set_inode_lock_trans(journal, inode);
ocfs2_meta_unlock(inode, 1);
if (atomic_read(&inode->i_count) == 1)
mlog(ML_ERROR,
@@ -495,29 +485,27 @@
}
}
-#define OCFS_DEFAULT_COMMIT_INTERVAL (HZ * 5)
-/*
- * Setup the journal using the journal system file
- */
-int ocfs_journal_init(ocfs_journal *journal,
- int *dirty)
+#define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * 5)
+
+int ocfs2_journal_init(ocfs2_journal *journal,
+ int *dirty)
{
int status = -1;
struct inode *inode = NULL; /* the journal inode */
journal_t *j_journal = NULL;
ocfs2_dinode *fe = NULL;
struct buffer_head *bh = NULL;
- ocfs_super *osb;
+ ocfs2_super *osb;
mlog_entry_void();
- OCFS_ASSERT(journal);
+ OCFS2_ASSERT(journal);
osb = journal->j_osb;
/* already have the inode for our journal */
- inode = ocfs_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
- osb->slot_num);
+ inode = ocfs2_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
+ osb->slot_num);
if (inode == NULL) {
status = -EACCES;
mlog_errno(status);
@@ -572,7 +560,7 @@
mlog(0, "Returned from journal_init_inode\n");
mlog(0, "j_journal->j_maxlen = %u\n", j_journal->j_maxlen);
- j_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
+ j_journal->j_commit_interval = OCFS2_DEFAULT_COMMIT_INTERVAL;
spin_lock(&j_journal->j_state_lock);
if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER)
@@ -588,7 +576,7 @@
journal->j_inode = inode;
journal->j_bh = bh;
- journal->j_state = OCFS_JOURNAL_LOADED;
+ journal->j_state = OCFS2_JOURNAL_LOADED;
status = 0;
done:
@@ -604,14 +592,14 @@
mlog_exit(status);
return status;
-} /* ocfs_journal_init */
+}
-static int ocfs_journal_toggle_dirty(ocfs_super *osb,
- int dirty)
+static int ocfs2_journal_toggle_dirty(ocfs2_super *osb,
+ int dirty)
{
int status;
unsigned int flags;
- ocfs_journal *journal = osb->journal;
+ ocfs2_journal *journal = osb->journal;
struct buffer_head *bh = journal->j_bh;
ocfs2_dinode *fe;
@@ -627,7 +615,7 @@
flags &= ~OCFS2_JOURNAL_DIRTY_FL;
fe->id1.journal1.ij_flags = cpu_to_le32(flags);
- status = ocfs_write_block(osb, bh, journal->j_inode);
+ status = ocfs2_write_block(osb, bh, journal->j_inode);
if (status < 0)
mlog_errno(status);
@@ -636,11 +624,12 @@
}
/*
- if the journal has been kmalloc'd it needs to be freed after this call.
-*/
-void ocfs_journal_shutdown(ocfs_super *osb)
+ * If the journal has been kmalloc'd it needs to be freed after this
+ * call.
+ */
+void ocfs2_journal_shutdown(ocfs2_super *osb)
{
- ocfs_journal *journal = NULL;
+ ocfs2_journal *journal = NULL;
int status = 0;
struct inode *inode = NULL;
int num_running_trans = 0;
@@ -656,7 +645,7 @@
inode = journal->j_inode;
- if (journal->j_state != OCFS_JOURNAL_LOADED)
+ if (journal->j_state != OCFS2_JOURNAL_LOADED)
goto done;
/* need to inc inode use count as journal_destroy will iput. */
@@ -673,9 +662,9 @@
* release any locks that are still held.
* set the SHUTDOWN flag and release the trans lock.
* the commit thread will take the trans lock for us below. */
- journal->j_state = OCFS_JOURNAL_IN_SHUTDOWN;
+ journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN;
- /* The OCFS_JOURNAL_IN_SHUTDOWN will signal to commit_cache to not
+ /* The OCFS2_JOURNAL_IN_SHUTDOWN will signal to commit_cache to not
* drop the trans_lock (which we want to hold until we
* completely destroy the journal. */
if (osb->commit_task) {
@@ -685,9 +674,9 @@
osb->commit_task = NULL;
}
- OCFS_ASSERT(atomic_read(&(osb->journal->j_num_trans)) == 0);
+ OCFS2_ASSERT(atomic_read(&(osb->journal->j_num_trans)) == 0);
- status = ocfs_journal_toggle_dirty(osb, 0);
+ status = ocfs2_journal_toggle_dirty(osb, 0);
if (status < 0)
mlog_errno(status);
@@ -702,7 +691,7 @@
brelse(journal->j_bh);
journal->j_bh = NULL;
- journal->j_state = OCFS_JOURNAL_FREE;
+ journal->j_state = OCFS2_JOURNAL_FREE;
// up_write(&journal->j_trans_barrier);
done:
@@ -711,11 +700,11 @@
mlog_exit_void();
}
-int ocfs_journal_load(ocfs_journal *journal)
+int ocfs2_journal_load(ocfs2_journal *journal)
{
int status = 0;
int olderr = 0;
- ocfs_super *osb;
+ ocfs2_super *osb;
mlog_entry_void();
@@ -737,14 +726,14 @@
journal_clear_err(journal->j_journal);
}
- status = ocfs_journal_toggle_dirty(osb, 1);
+ status = ocfs2_journal_toggle_dirty(osb, 1);
if (status < 0) {
mlog_errno(status);
goto done;
}
/* Launch the commit thread */
- osb->commit_task = kthread_run(ocfs_commit_thread, osb, "ocfs2cmt-%d",
+ osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt-%d",
osb->osb_id);
if (IS_ERR(osb->commit_task)) {
status = PTR_ERR(osb->commit_task);
@@ -762,7 +751,7 @@
/* 'full' flag tells us whether we clear out all blocks or if we just
* mark the journal clean */
-int ocfs_journal_wipe(ocfs_journal *journal, int full)
+int ocfs2_journal_wipe(ocfs2_journal *journal, int full)
{
int status;
@@ -777,7 +766,7 @@
goto bail;
}
- status = ocfs_journal_toggle_dirty(journal->j_osb, 0);
+ status = ocfs2_journal_toggle_dirty(journal->j_osb, 0);
if (status < 0)
mlog_errno(status);
@@ -795,9 +784,8 @@
* work as there may be pages backing this file which are still marked
* up to date. We know things can't change on this file underneath us
* as we have the lock by now :)
- *
*/
-static int ocfs_force_read_journal(struct inode *inode)
+static int ocfs2_force_read_journal(struct inode *inode)
{
int status = 0;
int i, p_blocks;
@@ -807,7 +795,7 @@
mlog_entry_void();
- OCFS_ASSERT(inode->i_blocks ==
+ OCFS2_ASSERT(inode->i_blocks ==
ocfs2_align_bytes_to_sectors(i_size_read(inode)));
memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL);
@@ -816,7 +804,9 @@
(inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9)));
v_blkno = 0;
- while (v_blkno < (inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9))) {
+ while (v_blkno <
+ (inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9))) {
+
status = ocfs2_extent_map_get_blocks(inode, v_blkno,
1, &p_blkno,
&p_blocks);
@@ -828,9 +818,9 @@
if (p_blocks > CONCURRENT_JOURNAL_FILL)
p_blocks = CONCURRENT_JOURNAL_FILL;
- status = ocfs_read_blocks(OCFS2_SB(inode->i_sb),
- p_blkno, p_blocks, bhs, 0,
- inode);
+ status = ocfs2_read_blocks(OCFS2_SB(inode->i_sb),
+ p_blkno, p_blocks, bhs, 0,
+ inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -872,8 +862,8 @@
void ocfs2_complete_recovery(void *data)
{
int ret;
- ocfs_super *osb = data;
- ocfs_journal *journal = osb->journal;
+ ocfs2_super *osb = data;
+ ocfs2_journal *journal = osb->journal;
ocfs2_dinode *la_dinode, *tl_dinode;
struct ocfs2_la_recovery_item *item;
struct list_head *p, *n;
@@ -898,8 +888,8 @@
mlog(0, "Clean up local alloc %"MLFu64"\n",
la_dinode->i_blkno);
- ret = ocfs_complete_local_alloc_recovery(osb,
- la_dinode);
+ ret = ocfs2_complete_local_alloc_recovery(osb,
+ la_dinode);
if (ret < 0)
mlog_errno(ret);
@@ -919,7 +909,7 @@
kfree(tl_dinode);
}
- ret = ocfs_recover_orphans(osb, item->lri_slot);
+ ret = ocfs2_recover_orphans(osb, item->lri_slot);
if (ret < 0)
mlog_errno(ret);
@@ -934,7 +924,7 @@
/* NOTE: This function always eats your references to la_dinode and
* tl_dinode, either manually on error, or by passing them to
* ocfs2_complete_recovery */
-static void ocfs2_queue_recovery_completion(ocfs_journal *journal,
+static void ocfs2_queue_recovery_completion(ocfs2_journal *journal,
int slot_num,
ocfs2_dinode *la_dinode,
ocfs2_dinode *tl_dinode)
@@ -969,9 +959,9 @@
/* Called by the mount code to queue recovery the last part of
* recovery for it's own slot. */
-void ocfs2_complete_mount_recovery(ocfs_super *osb)
+void ocfs2_complete_mount_recovery(ocfs2_super *osb)
{
- ocfs_journal *journal = osb->journal;
+ ocfs2_journal *journal = osb->journal;
if (osb->dirty) {
/* No need to queue up our truncate_log as regular
@@ -985,14 +975,14 @@
}
}
-static int __ocfs_recovery_thread(void *arg)
+static int __ocfs2_recovery_thread(void *arg)
{
int status, node_num;
- ocfs_super *osb = arg;
+ ocfs2_super *osb = arg;
mlog_entry_void();
- status = ocfs_wait_on_mount(osb);
+ status = ocfs2_wait_on_mount(osb);
if (status < 0) {
if (status == -EBUSY)
status = 0;
@@ -1006,15 +996,15 @@
goto bail;
}
- while(!ocfs_node_map_is_empty(osb, &osb->recovery_map)) {
- node_num = ocfs_node_map_first_set_bit(osb,
- &osb->recovery_map);
+ while(!ocfs2_node_map_is_empty(osb, &osb->recovery_map)) {
+ node_num = ocfs2_node_map_first_set_bit(osb,
+ &osb->recovery_map);
if (node_num == O2NM_INVALID_NODE_NUM) {
mlog(0, "Out of nodes to recover.\n");
break;
}
- status = ocfs_recover_node(osb, node_num);
+ status = ocfs2_recover_node(osb, node_num);
if (status < 0) {
mlog(ML_ERROR,
"Error %d recovering node %d on device (%u,%u)!\n",
@@ -1024,7 +1014,7 @@
continue;
}
- ocfs_recovery_map_clear(osb, node_num);
+ ocfs2_recovery_map_clear(osb, node_num);
}
ocfs2_super_unlock(osb, 1);
@@ -1036,7 +1026,7 @@
bail:
down(&osb->recovery_lock);
- if (!ocfs_node_map_is_empty(osb, &osb->recovery_map)) {
+ if (!ocfs2_node_map_is_empty(osb, &osb->recovery_map)) {
up(&osb->recovery_lock);
goto restart;
}
@@ -1055,7 +1045,7 @@
return status;
}
-void ocfs_recovery_thread(ocfs_super *osb, int node_num)
+void ocfs2_recovery_thread(ocfs2_super *osb, int node_num)
{
mlog_entry("(node_num=%d, osb->node_num = %d)\n",
node_num, osb->node_num);
@@ -1065,14 +1055,14 @@
goto out;
/* People waiting on recovery will wait on
* the recovery map to empty. */
- ocfs_recovery_map_set(osb, node_num);
+ ocfs2_recovery_map_set(osb, node_num);
mlog(0, "starting recovery thread...\n");
if (osb->recovery_thread_task)
goto out;
- osb->recovery_thread_task = kthread_run(__ocfs_recovery_thread, osb,
+ osb->recovery_thread_task = kthread_run(__ocfs2_recovery_thread, osb,
"ocfs2rec-%d", osb->osb_id);
if (IS_ERR(osb->recovery_thread_task)) {
mlog_errno((int)PTR_ERR(osb->recovery_thread_task));
@@ -1088,7 +1078,7 @@
/* Does the actual journal replay and marks the journal inode as
* clean. Will only replay if the journal inode is marked dirty. */
-static int ocfs2_replay_journal(ocfs_super *osb,
+static int ocfs2_replay_journal(ocfs2_super *osb,
int node_num,
int slot_num)
{
@@ -1100,8 +1090,8 @@
journal_t *journal = NULL;
struct buffer_head *bh = NULL;
- inode = ocfs_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
- slot_num);
+ inode = ocfs2_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
+ slot_num);
if (inode == NULL) {
status = -EACCES;
mlog_errno(status);
@@ -1141,7 +1131,7 @@
OCFS2_I(inode)->ip_clusters = fe->i_clusters;
- status = ocfs_force_read_journal(inode);
+ status = ocfs2_force_read_journal(inode);
if (status < 0) {
mlog_errno(status);
goto done;
@@ -1177,7 +1167,7 @@
flags &= ~OCFS2_JOURNAL_DIRTY_FL;
fe->id1.journal1.ij_flags = cpu_to_le32(flags);
- status = ocfs_write_block(osb, bh, inode);
+ status = ocfs2_write_block(osb, bh, inode);
if (status < 0)
mlog_errno(status);
@@ -1214,7 +1204,7 @@
* second part of a nodes recovery process (local alloc recovery) is
* far less concerning.
*/
-static int ocfs_recover_node(ocfs_super *osb,
+static int ocfs2_recover_node(ocfs2_super *osb,
int node_num)
{
int status = 0;
@@ -1229,7 +1219,7 @@
mlog(0, "checking node %d\n", node_num);
/* Should not ever be called to recover ourselves -- in that
- * case we should've called ocfs_journal_load instead. */
+ * case we should've called ocfs2_journal_load instead. */
if (osb->node_num == node_num)
BUG();
@@ -1249,7 +1239,7 @@
}
/* Stamp a clean local alloc file AFTER recovering the journal... */
- status = ocfs_begin_local_alloc_recovery(osb, slot_num, &la_copy);
+ status = ocfs2_begin_local_alloc_recovery(osb, slot_num, &la_copy);
if (status < 0) {
mlog_errno(status);
goto done;
@@ -1283,14 +1273,14 @@
/* Test node liveness by trylocking his journal. If we get the lock,
* we drop it here. Return 0 if we got the lock, -EAGAIN if node is
* still alive (we couldn't get the lock) and < 0 on error. */
-static int ocfs2_trylock_journal(ocfs_super *osb,
+static int ocfs2_trylock_journal(ocfs2_super *osb,
int slot_num)
{
int status, flags;
struct inode *inode = NULL;
- inode = ocfs_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
- slot_num);
+ inode = ocfs2_get_system_file_inode(osb, JOURNAL_SYSTEM_INODE,
+ slot_num);
if (inode == NULL) {
mlog(ML_ERROR, "access error\n");
status = -EACCES;
@@ -1305,7 +1295,7 @@
}
SET_INODE_JOURNAL(inode);
- flags = OCFS2_META_LOCK_RECOVERY|OCFS2_META_LOCK_NOQUEUE;
+ flags = OCFS2_META_LOCK_RECOVERY | OCFS2_META_LOCK_NOQUEUE;
status = ocfs2_meta_lock_full(inode, NULL, NULL, 1, flags, NULL, 0);
if (status < 0) {
if (status != -EAGAIN)
@@ -1323,7 +1313,7 @@
/* Call this underneath ocfs2_super_lock. It also assumes that the
* slot info struct has been updated from disk. */
-int ocfs2_mark_dead_nodes(ocfs_super *osb)
+int ocfs2_mark_dead_nodes(ocfs2_super *osb)
{
int status, i, node_num;
ocfs2_slot_info *si = osb->slot_info;
@@ -1339,7 +1329,7 @@
continue;
node_num = si->si_global_node_nums[i];
- if (ocfs_node_map_test_bit(osb, &osb->recovery_map, node_num))
+ if (ocfs2_node_map_test_bit(osb, &osb->recovery_map, node_num))
continue;
spin_unlock(&si->si_lock);
@@ -1351,7 +1341,7 @@
/* Since we're called from mount, we know that
* the recovery thread can't race us on
* setting / checking the recovery bits. */
- ocfs_recovery_thread(osb, node_num);
+ ocfs2_recovery_thread(osb, node_num);
} else if ((status < 0) && (status != -EAGAIN)) {
mlog_errno(status);
goto bail;
@@ -1367,8 +1357,8 @@
return status;
}
-static int ocfs_recover_orphans(ocfs_super *osb,
- int slot)
+static int ocfs2_recover_orphans(ocfs2_super *osb,
+ int slot)
{
int status = 0;
int have_disk_lock = 0;
@@ -1382,9 +1372,9 @@
mlog(0, "Recover inodes from orphan dir in slot %d\n", slot);
- orphan_dir_inode = ocfs_get_system_file_inode(osb,
- ORPHAN_DIR_SYSTEM_INODE,
- slot);
+ orphan_dir_inode = ocfs2_get_system_file_inode(osb,
+ ORPHAN_DIR_SYSTEM_INODE,
+ slot);
if (!orphan_dir_inode) {
status = -ENOENT;
mlog_errno(status);
@@ -1405,7 +1395,7 @@
while(offset < i_size_read(orphan_dir_inode)) {
blk = offset >> sb->s_blocksize_bits;
- bh = ocfs_bread(orphan_dir_inode, blk, &status, 0);
+ bh = ocfs2_bread(orphan_dir_inode, blk, &status, 0);
if (!bh)
status = -EINVAL;
if (status < 0) {
@@ -1421,7 +1411,7 @@
&& local < sb->s_blocksize) {
de = (struct ocfs2_dir_entry *) (bh->b_data + local);
- if (!ocfs_check_dir_entry(orphan_dir_inode,
+ if (!ocfs2_check_dir_entry(orphan_dir_inode,
de, bh, local)) {
up(&orphan_dir_inode->i_sem);
status = -EINVAL;
@@ -1456,7 +1446,7 @@
if (de->name_len == 2 && !strncmp("..", de->name, 2))
continue;
- iter = ocfs_iget(osb, de->inode);
+ iter = ocfs2_iget(osb, de->inode);
if (!iter)
continue;
@@ -1500,7 +1490,7 @@
return status;
}
-static int ocfs_wait_on_mount(ocfs_super *osb)
+static int ocfs2_wait_on_mount(ocfs2_super *osb)
{
/* This check is good because ocfs2 will wait on our recovery
* thread before changing it to something other than MOUNTED
@@ -1520,11 +1510,11 @@
return 0;
}
-static int ocfs_commit_thread(void *arg)
+static int ocfs2_commit_thread(void *arg)
{
int status;
- ocfs_super *osb = arg;
- ocfs_journal *journal = osb->journal;
+ ocfs2_super *osb = arg;
+ ocfs2_journal *journal = osb->journal;
/* we can trust j_num_trans here because _should_stop() is only set in
* shutdown and nobody other than ourselves should be able to start
@@ -1536,9 +1526,9 @@
wait_event_interruptible_timeout(osb->checkpoint_event,
atomic_read(&journal->j_num_trans)
|| kthread_should_stop(),
- OCFS_CHECKPOINT_INTERVAL);
+ OCFS2_CHECKPOINT_INTERVAL);
- status = ocfs_commit_cache(osb);
+ status = ocfs2_commit_cache(osb);
if (status < 0)
mlog_errno(status);
Modified: trunk/fs/ocfs2/journal.h
===================================================================
--- trunk/fs/ocfs2/journal.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/journal.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -29,26 +29,26 @@
#include <linux/fs.h>
#include <linux/jbd.h>
-#define OCFS_CHECKPOINT_INTERVAL (8 * HZ)
+#define OCFS2_CHECKPOINT_INTERVAL (8 * HZ)
-enum ocfs_journal_state {
- OCFS_JOURNAL_FREE = 0,
- OCFS_JOURNAL_LOADED,
- OCFS_JOURNAL_IN_SHUTDOWN,
+enum ocfs2_journal_state {
+ OCFS2_JOURNAL_FREE = 0,
+ OCFS2_JOURNAL_LOADED,
+ OCFS2_JOURNAL_IN_SHUTDOWN,
};
-struct _ocfs_super;
+struct _ocfs2_super;
struct _ocfs2_dinode;
-struct _ocfs_journal_handle;
+struct _ocfs2_journal_handle;
-typedef struct _ocfs_journal ocfs_journal;
-struct _ocfs_journal {
- enum ocfs_journal_state j_state; /* Journals current state */
+typedef struct _ocfs2_journal ocfs2_journal;
+struct _ocfs2_journal {
+ enum ocfs2_journal_state j_state; /* Journals current state */
journal_t *j_journal; /* The kernels journal type */
struct inode *j_inode; /* Kernel inode pointing to
* this journal */
- struct _ocfs_super *j_osb; /* pointer to the super
+ struct _ocfs2_super *j_osb; /* pointer to the super
* block for the node
* we're currently
* running on -- not
@@ -72,7 +72,7 @@
extern spinlock_t trans_inc_lock;
/* wrap j_trans_id so we never have it equal to zero. */
-static inline unsigned long ocfs_inc_trans_id(ocfs_journal *j)
+static inline unsigned long ocfs2_inc_trans_id(ocfs2_journal *j)
{
unsigned long old_id;
spin_lock(&trans_inc_lock);
@@ -83,8 +83,8 @@
return old_id;
}
-static inline void ocfs_set_inode_lock_trans(ocfs_journal *journal,
- struct inode *inode)
+static inline void ocfs2_set_inode_lock_trans(ocfs2_journal *journal,
+ struct inode *inode)
{
spin_lock(&trans_inc_lock);
OCFS2_I(inode)->ip_last_trans = journal->j_trans_id;
@@ -96,10 +96,10 @@
* checkpointed to disk. You should be holding the spinlock on the
* metadata lock while calling this to be sure that nobody can take
* the lock and put it on another transaction. */
-static inline int ocfs_inode_fully_checkpointed(struct inode *inode)
+static inline int ocfs2_inode_fully_checkpointed(struct inode *inode)
{
int ret;
- ocfs_journal *journal = OCFS2_SB(inode->i_sb)->journal;
+ ocfs2_journal *journal = OCFS2_SB(inode->i_sb)->journal;
spin_lock(&trans_inc_lock);
ret = time_after(journal->j_trans_id, OCFS2_I(inode)->ip_last_trans);
@@ -110,7 +110,7 @@
/* convenience function to check if an inode is still new (has never
* hit disk) Will do you a favor and set created_trans = 0 when you've
* been checkpointed. returns '1' if the inode is still new. */
-static inline int ocfs_inode_is_new(struct inode *inode)
+static inline int ocfs2_inode_is_new(struct inode *inode)
{
int ret;
@@ -128,7 +128,7 @@
return ret;
}
-static inline void ocfs_inode_set_new(ocfs_super *osb,
+static inline void ocfs2_inode_set_new(ocfs2_super *osb,
struct inode *inode)
{
spin_lock(&trans_inc_lock);
@@ -138,19 +138,19 @@
extern kmem_cache_t *ocfs2_lock_cache;
-typedef struct _ocfs_journal_lock ocfs_journal_lock;
-struct _ocfs_journal_lock {
+typedef struct _ocfs2_journal_lock ocfs2_journal_lock;
+struct _ocfs2_journal_lock {
struct inode *jl_inode;
struct list_head jl_lock_list;
};
-struct _ocfs_journal_handle {
+struct _ocfs2_journal_handle {
handle_t *k_handle; /* kernel handle. */
- ocfs_journal *journal;
+ ocfs2_journal *journal;
u32 flags; /* see flags below. */
int max_buffs; /* Buffs reserved by this handle */
- /* The following two fields are for ocfs_handle_add_lock */
+ /* The following two fields are for ocfs2_handle_add_lock */
int num_locks;
struct list_head locks; /* A bunch of locks to
* release on commit. This
@@ -159,20 +159,20 @@
struct list_head inode_list;
};
-#define OCFS_HANDLE_STARTED 1
+#define OCFS2_HANDLE_STARTED 1
/* should we sync-commit this handle? */
-#define OCFS_HANDLE_SYNC 2
-static inline int ocfs_handle_started(ocfs_journal_handle *handle)
+#define OCFS2_HANDLE_SYNC 2
+static inline int ocfs2_handle_started(ocfs2_journal_handle *handle)
{
- return handle->flags & OCFS_HANDLE_STARTED;
+ return handle->flags & OCFS2_HANDLE_STARTED;
}
-static inline void ocfs_handle_set_sync(ocfs_journal_handle *handle, int sync)
+static inline void ocfs2_handle_set_sync(ocfs2_journal_handle *handle, int sync)
{
if (sync)
- handle->flags |= OCFS_HANDLE_SYNC;
+ handle->flags |= OCFS2_HANDLE_SYNC;
else
- handle->flags &= ~OCFS_HANDLE_SYNC;
+ handle->flags &= ~OCFS2_HANDLE_SYNC;
}
/* Exported only for the journal struct init code in super.c. Do not call. */
@@ -182,27 +182,30 @@
* Journal Control:
* Initialize, Load, Shutdown, Wipe a journal.
*
- * ocfs_journal_init - Initialize journal structures in the OSB.
- * ocfs_journal_load - Load the given journal off disk. Replay it if
+ * ocfs2_journal_init - Initialize journal structures in the OSB.
+ * ocfs2_journal_load - Load the given journal off disk. Replay it if
* there's transactions still in there.
- * ocfs_journal_shutdown - Shutdown a journal, this will flush all
+ * ocfs2_journal_shutdown - Shutdown a journal, this will flush all
* uncommitted, uncheckpointed transactions.
- * ocfs_journal_wipe - Wipe transactions from a journal. Optionally
+ * ocfs2_journal_wipe - Wipe transactions from a journal. Optionally
* zero out each block.
- * ocfs_recovery_thread - Perform recovery on a node. osb is our own osb.
+ * ocfs2_recovery_thread - Perform recovery on a node. osb is our own osb.
* ocfs2_mark_dead_nodes - Start recovery on nodes we won't get a heartbeat
* event on.
- * ocfs_start_checkpoint - Kick the commit thread to do a checkpoint.
+ * ocfs2_start_checkpoint - Kick the commit thread to do a checkpoint.
*/
-int ocfs_journal_init(ocfs_journal *journal, int *dirty);
-void ocfs_journal_shutdown(struct _ocfs_super *osb);
-int ocfs_journal_wipe(ocfs_journal *journal, int full);
-int ocfs_journal_load(ocfs_journal *journal);
-void ocfs_recovery_thread(struct _ocfs_super *osb, int node_num);
-int ocfs2_mark_dead_nodes(ocfs_super *osb);
-void ocfs2_complete_mount_recovery(ocfs_super *osb);
+int ocfs2_journal_init(ocfs2_journal *journal,
+ int *dirty);
+void ocfs2_journal_shutdown(struct _ocfs2_super *osb);
+int ocfs2_journal_wipe(ocfs2_journal *journal,
+ int full);
+int ocfs2_journal_load(ocfs2_journal *journal);
+void ocfs2_recovery_thread(struct _ocfs2_super *osb,
+ int node_num);
+int ocfs2_mark_dead_nodes(ocfs2_super *osb);
+void ocfs2_complete_mount_recovery(ocfs2_super *osb);
-static inline void ocfs_start_checkpoint(struct _ocfs_super *osb)
+static inline void ocfs2_start_checkpoint(struct _ocfs2_super *osb)
{
atomic_set(&osb->needs_checkpoint, 1);
wake_up(&osb->checkpoint_event);
@@ -210,19 +213,19 @@
static inline void ocfs2_checkpoint_inode(struct inode *inode)
{
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
- if (!ocfs_inode_fully_checkpointed(inode)) {
+ if (!ocfs2_inode_fully_checkpointed(inode)) {
/* WARNING: This only kicks off a single
* checkpoint. If someone races you and adds more
* metadata to the journal, you won't know, and will
* wind up waiting *alot* longer than necessary. Right
* now we only use this in clear_inode so that's
* OK. */
- ocfs_start_checkpoint(osb);
+ ocfs2_start_checkpoint(osb);
wait_event(osb->journal->j_checkpointed,
- ocfs_inode_fully_checkpointed(inode));
+ ocfs2_inode_fully_checkpointed(inode));
}
}
@@ -230,40 +233,40 @@
* Transaction Handling:
* Manage the lifetime of a transaction handle.
*
- * ocfs_alloc_handle - Only allocate a handle so we can start putting
+ * ocfs2_alloc_handle - Only allocate a handle so we can start putting
* cluster locks on it. To actually change blocks,
- * call ocfs_start_trans with the handle returned
- * from this function. You may call ocfs_commit_trans
+ * call ocfs2_start_trans with the handle returned
+ * from this function. You may call ocfs2_commit_trans
* at any time in the lifetime of a handle.
- * ocfs_start_trans - Begin a transaction. Give it an upper estimate of
+ * ocfs2_start_trans - Begin a transaction. Give it an upper estimate of
* the number of blocks that will be changed during
* this handle.
- * ocfs_commit_trans - Complete a handle.
- * ocfs_extend_trans - Extend a handle by nblocks credits. This may
+ * ocfs2_commit_trans - Complete a handle.
+ * ocfs2_extend_trans - Extend a handle by nblocks credits. This may
* commit the handle to disk in the process, but will
* not release any locks taken during the transaction.
- * ocfs_journal_access - Notify the handle that we want to journal this
- * buffer. Will have to call ocfs_journal_dirty once
+ * ocfs2_journal_access - Notify the handle that we want to journal this
+ * buffer. Will have to call ocfs2_journal_dirty once
* we've actually dirtied it. Type is one of . or .
- * ocfs_journal_dirty - Mark a journalled buffer as having dirty data.
- * ocfs_handle_add_lock - Sometimes we need to delay lock release
+ * ocfs2_journal_dirty - Mark a journalled buffer as having dirty data.
+ * ocfs2_handle_add_lock - Sometimes we need to delay lock release
* until after a transaction has been completed. Use
- * ocfs_handle_add_lock to indicate that a lock needs
+ * ocfs2_handle_add_lock to indicate that a lock needs
* to be released at the end of that handle. Locks
* will be released in the order that they are added.
- * ocfs_handle_add_inode - Add a locked inode to a transaction.
+ * ocfs2_handle_add_inode - Add a locked inode to a transaction.
*/
/* You must always start_trans with a number of buffs > 0, but it's
* perfectly legal to go through an entire transaction without having
* dirtied any buffers. */
-ocfs_journal_handle *ocfs_alloc_handle(ocfs_super *osb);
-ocfs_journal_handle *ocfs_start_trans(struct _ocfs_super *osb,
- ocfs_journal_handle *handle,
- int max_buffs);
-void ocfs_commit_trans(ocfs_journal_handle *handle);
-int ocfs_extend_trans(ocfs_journal_handle *handle,
- int nblocks);
+ocfs2_journal_handle *ocfs2_alloc_handle(ocfs2_super *osb);
+ocfs2_journal_handle *ocfs2_start_trans(struct _ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ int max_buffs);
+void ocfs2_commit_trans(ocfs2_journal_handle *handle);
+int ocfs2_extend_trans(ocfs2_journal_handle *handle,
+ int nblocks);
/*
* Create access is for when we get a newly created buffer and we're
@@ -276,14 +279,14 @@
* a copy of that block (if it's part of another, uncommitted
* transaction) before we do so.
*/
-#define OCFS_JOURNAL_ACCESS_CREATE 0
-#define OCFS_JOURNAL_ACCESS_WRITE 1
-#define OCFS_JOURNAL_ACCESS_UNDO 2
+#define OCFS2_JOURNAL_ACCESS_CREATE 0
+#define OCFS2_JOURNAL_ACCESS_WRITE 1
+#define OCFS2_JOURNAL_ACCESS_UNDO 2
-int ocfs_journal_access(ocfs_journal_handle *handle,
- struct inode *inode,
- struct buffer_head *bh,
- int type);
+int ocfs2_journal_access(ocfs2_journal_handle *handle,
+ struct inode *inode,
+ struct buffer_head *bh,
+ int type);
/*
* A word about the journal_access/journal_dirty "dance". It is
* entirely legal to journal_access a buffer more than once (as long
@@ -299,20 +302,20 @@
* path looks like:
*
* <read a bh>
- * ocfs_journal_access(handle, bh, OCFS_JOURNAL_ACCESS_WRITE);
+ * ocfs2_journal_access(handle, bh, OCFS2_JOURNAL_ACCESS_WRITE);
* <modify the bh>
- * ocfs_journal_dirty(handle, bh);
+ * ocfs2_journal_dirty(handle, bh);
*/
-int ocfs_journal_dirty(ocfs_journal_handle *handle,
- struct buffer_head *bh);
-int ocfs_handle_add_lock(ocfs_journal_handle *handle,
- struct inode *inode);
+int ocfs2_journal_dirty(ocfs2_journal_handle *handle,
+ struct buffer_head *bh);
+int ocfs2_handle_add_lock(ocfs2_journal_handle *handle,
+ struct inode *inode);
/*
* Use this to protect from other processes reading buffer state while
* it's in flight.
*/
-void ocfs_handle_add_inode(ocfs_journal_handle *handle,
- struct inode *inode);
+void ocfs2_handle_add_inode(ocfs2_journal_handle *handle,
+ struct inode *inode);
/*
* Credit Macros:
@@ -324,62 +327,62 @@
*/
/* simple file updates like chmod, etc. */
-#define OCFS_INODE_UPDATE_CREDITS 1
+#define OCFS2_INODE_UPDATE_CREDITS 1
/* get one bit out of a suballocator: dinode + group descriptor +
* prev. group desc. if we relink. */
-#define OCFS_SUBALLOC_ALLOC (3)
+#define OCFS2_SUBALLOC_ALLOC (3)
/* dinode + group descriptor update. We don't relink on free yet. */
-#define OCFS_SUBALLOC_FREE (2)
+#define OCFS2_SUBALLOC_FREE (2)
-#define OCFS_TRUNCATE_LOG_UPDATE OCFS_INODE_UPDATE_CREDITS
-#define OCFS_TRUNCATE_LOG_FLUSH_ONE_REC (OCFS_SUBALLOC_FREE \
- + OCFS_TRUNCATE_LOG_UPDATE)
+#define OCFS2_TRUNCATE_LOG_UPDATE OCFS2_INODE_UPDATE_CREDITS
+#define OCFS2_TRUNCATE_LOG_FLUSH_ONE_REC (OCFS2_SUBALLOC_FREE \
+ + OCFS2_TRUNCATE_LOG_UPDATE)
/* data block for new dir/symlink, 2 for bitmap updates (bitmap fe +
* bitmap block for the new bit) */
-#define OCFS_DIR_LINK_ADDITIONAL_CREDITS (1 + 2)
+#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + 2)
/* parent fe, parent block, new file entry, inode alloc fe, inode alloc
* group descriptor + mkdir/symlink blocks */
-#define OCFS_MKNOD_CREDITS (3 + OCFS_SUBALLOC_ALLOC \
- + OCFS_DIR_LINK_ADDITIONAL_CREDITS)
+#define OCFS2_MKNOD_CREDITS (3 + OCFS2_SUBALLOC_ALLOC \
+ + OCFS2_DIR_LINK_ADDITIONAL_CREDITS)
/* local alloc metadata change + main bitmap updates */
-#define OCFS_WINDOW_MOVE_CREDITS (OCFS_INODE_UPDATE_CREDITS \
- + OCFS_SUBALLOC_ALLOC + OCFS_SUBALLOC_FREE)
+#define OCFS2_WINDOW_MOVE_CREDITS (OCFS2_INODE_UPDATE_CREDITS \
+ + OCFS2_SUBALLOC_ALLOC + OCFS2_SUBALLOC_FREE)
/* used when we don't need an allocation change for a dir extend. One
* for the dinode, one for the new block. */
-#define OCFS_SIMPLE_DIR_EXTEND_CREDITS (2)
+#define OCFS2_SIMPLE_DIR_EXTEND_CREDITS (2)
/* file update (nlink, etc) + dir entry block */
-#define OCFS_LINK_CREDITS (OCFS_INODE_UPDATE_CREDITS + 1)
+#define OCFS2_LINK_CREDITS (OCFS2_INODE_UPDATE_CREDITS + 1)
/* inode + dir inode (if we unlink a dir), + dir entry block + orphan
* dir inode link */
-#define OCFS_UNLINK_CREDITS (2 * OCFS_INODE_UPDATE_CREDITS + 1 \
- + OCFS_LINK_CREDITS)
+#define OCFS2_UNLINK_CREDITS (2 * OCFS2_INODE_UPDATE_CREDITS + 1 \
+ + OCFS2_LINK_CREDITS)
/* dinode + orphan dir dinode + inode alloc dinode + orphan dir entry +
* inode alloc group descriptor */
-#define OCFS_DELETE_INODE_CREDITS (3 * OCFS_INODE_UPDATE_CREDITS + 1 + 1)
+#define OCFS2_DELETE_INODE_CREDITS (3 * OCFS2_INODE_UPDATE_CREDITS + 1 + 1)
/* dinode update, old dir dinode update, new dir dinode update, old
* dir dir entry, new dir dir entry, dir entry update for renaming
* directory + target unlink */
-#define OCFS_RENAME_CREDITS (3 * OCFS_INODE_UPDATE_CREDITS + 3 \
- + OCFS_UNLINK_CREDITS)
+#define OCFS2_RENAME_CREDITS (3 * OCFS2_INODE_UPDATE_CREDITS + 3 \
+ + OCFS2_UNLINK_CREDITS)
-static inline int ocfs_calc_extend_credits(struct super_block *sb,
- ocfs2_dinode *fe,
- u32 bits_wanted)
+static inline int ocfs2_calc_extend_credits(struct super_block *sb,
+ ocfs2_dinode *fe,
+ u32 bits_wanted)
{
int bitmap_blocks, sysfile_bitmap_blocks, dinode_blocks;
/* bitmap dinode, group desc. + relinked group. */
- bitmap_blocks = OCFS_SUBALLOC_ALLOC;
+ bitmap_blocks = OCFS2_SUBALLOC_ALLOC;
/* we might need to shift tree depth so lets assume an
* absolute worst case of complete fragmentation. Even with
@@ -387,7 +390,7 @@
* however many metadata chunks needed * a remaining suballoc
* alloc. */
sysfile_bitmap_blocks = 1 +
- (OCFS_SUBALLOC_ALLOC - 1) * ocfs2_extend_meta_needed(fe);
+ (OCFS2_SUBALLOC_ALLOC - 1) * ocfs2_extend_meta_needed(fe);
/* this does not include *new* metadata blocks, which are
* accounted for in sysfile_bitmap_blocks. fe +
@@ -399,9 +402,9 @@
return bitmap_blocks + sysfile_bitmap_blocks + dinode_blocks;
}
-static inline int ocfs_calc_symlink_credits(struct super_block *sb)
+static inline int ocfs2_calc_symlink_credits(struct super_block *sb)
{
- int blocks = OCFS_MKNOD_CREDITS;
+ int blocks = OCFS2_MKNOD_CREDITS;
/* links can be longer than one block so we may update many
* within our single allocated extent. */
@@ -410,28 +413,28 @@
return blocks;
}
-static inline int ocfs_calc_group_alloc_credits(struct super_block *sb,
- unsigned int cpg)
+static inline int ocfs2_calc_group_alloc_credits(struct super_block *sb,
+ unsigned int cpg)
{
int blocks;
- int bitmap_blocks = OCFS_SUBALLOC_ALLOC + 1;
+ int bitmap_blocks = OCFS2_SUBALLOC_ALLOC + 1;
/* parent inode update + new block group header + bitmap inode update
+ bitmap blocks affected */
blocks = 1 + 1 + 1 + bitmap_blocks;
return blocks;
}
-static inline int ocfs_calc_tree_trunc_credits(struct super_block *sb,
- unsigned int clusters_to_del,
- ocfs2_dinode *fe,
- ocfs2_extent_list *last_el)
+static inline int ocfs2_calc_tree_trunc_credits(struct super_block *sb,
+ unsigned int clusters_to_del,
+ ocfs2_dinode *fe,
+ ocfs2_extent_list *last_el)
{
/* for dinode + all headers in this pass + update to next leaf */
int credits = 1 + fe->id2.i_list.l_tree_depth + 1;
int i;
i = last_el->l_next_free_rec - 1;
- OCFS_ASSERT(i >= 0);
+ OCFS2_ASSERT(i >= 0);
/* We may be deleting metadata blocks, so metadata alloc dinode +
one desc. block for each possible delete. */
@@ -441,7 +444,7 @@
credits += 1 + fe->id2.i_list.l_tree_depth;
/* update to the truncate log. */
- credits += OCFS_TRUNCATE_LOG_UPDATE;
+ credits += OCFS2_TRUNCATE_LOG_UPDATE;
return credits;
}
Modified: trunk/fs/ocfs2/localalloc.c
===================================================================
--- trunk/fs/ocfs2/localalloc.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/localalloc.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -45,45 +45,43 @@
#include "buffer_head_io.h"
-static inline int ocfs_local_alloc_window_bits(ocfs_super *osb);
+static inline int ocfs2_local_alloc_window_bits(ocfs2_super *osb);
-static u32 ocfs_local_alloc_count_bits(ocfs2_dinode *alloc);
+static u32 ocfs2_local_alloc_count_bits(ocfs2_dinode *alloc);
-static int ocfs_local_alloc_find_clear_bits(ocfs_super *osb,
- ocfs2_dinode *alloc,
- u32 numbits);
+static int ocfs2_local_alloc_find_clear_bits(ocfs2_super *osb,
+ ocfs2_dinode *alloc,
+ u32 numbits);
-static void ocfs_clear_local_alloc(ocfs2_dinode *alloc);
+static void ocfs2_clear_local_alloc(ocfs2_dinode *alloc);
-static int ocfs_sync_local_to_main(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_dinode *alloc,
- struct inode *main_bm_inode,
- struct buffer_head *main_bm_bh);
+static int ocfs2_sync_local_to_main(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_dinode *alloc,
+ struct inode *main_bm_inode,
+ struct buffer_head *main_bm_bh);
-static int ocfs_local_alloc_reserve_for_window(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context **ac,
- struct inode **bitmap_inode,
- struct buffer_head **bitmap_bh);
+static int ocfs2_local_alloc_reserve_for_window(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context **ac,
+ struct inode **bitmap_inode,
+ struct buffer_head **bitmap_bh);
-static int ocfs_local_alloc_new_window(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *ac);
+static int ocfs2_local_alloc_new_window(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *ac);
-static int ocfs_local_alloc_slide_window(ocfs_super *osb,
- struct inode * local_alloc_inode);
+static int ocfs2_local_alloc_slide_window(ocfs2_super *osb,
+ struct inode *local_alloc_inode);
/*
- * ocfs_local_alloc_window_bits
- *
* Determine how large our local alloc window should be, in bits.
*
- * These values (and the behavior in ocfs_alloc_should_use_local) have
+ * These values (and the behavior in ocfs2_alloc_should_use_local) have
* been chosen so that most allocations, including new block groups go
* through local alloc.
*/
-static inline int ocfs_local_alloc_window_bits(ocfs_super *osb)
+static inline int ocfs2_local_alloc_window_bits(ocfs2_super *osb)
{
BUG_ON(osb->s_clustersize_bits < 12);
@@ -91,14 +89,12 @@
}
/*
- * ocfs_alloc_should_use_local
- *
* Tell us whether a given allocation should use the local alloc
* file. Otherwise, it has to go to the main bitmap.
*/
-int ocfs_alloc_should_use_local(ocfs_super *osb, u64 bits)
+int ocfs2_alloc_should_use_local(ocfs2_super *osb, u64 bits)
{
- int la_bits = ocfs_local_alloc_window_bits(osb);
+ int la_bits = ocfs2_local_alloc_window_bits(osb);
if (osb->local_alloc_state != OCFS2_LA_ENABLED)
return 0;
@@ -113,10 +109,7 @@
return 1;
}
-/*
- * ocfs_load_local_alloc
- */
-int ocfs_load_local_alloc(ocfs_super *osb)
+int ocfs2_load_local_alloc(ocfs2_super *osb)
{
int status = 0;
ocfs2_dinode *alloc = NULL;
@@ -127,15 +120,15 @@
mlog_entry_void();
/* read the alloc off disk */
- inode = ocfs_get_system_file_inode(osb, LOCAL_ALLOC_SYSTEM_INODE,
- osb->slot_num);
+ inode = ocfs2_get_system_file_inode(osb, LOCAL_ALLOC_SYSTEM_INODE,
+ osb->slot_num);
if (!inode) {
status = -EINVAL;
mlog_errno(status);
goto bail;
}
- status = ocfs_read_block(osb, OCFS2_I(inode)->ip_blkno,
- &alloc_bh, 0, inode);
+ status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno,
+ &alloc_bh, 0, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -145,13 +138,13 @@
if (!(alloc->i_flags & (OCFS2_LOCAL_ALLOC_FL|OCFS2_BITMAP_FL))) {
mlog(ML_ERROR, "Invalid local alloc inode, %"MLFu64"\n",
- OCFS2_I(inode)->ip_blkno);
+ OCFS2_I(inode)->ip_blkno);
status = -EINVAL;
goto bail;
}
/* do a little verification. */
- num_used = ocfs_local_alloc_count_bits(alloc);
+ num_used = ocfs2_local_alloc_count_bits(alloc);
/* nowadays the local alloc has always been recovered before
* we load it so there should be no bits used from the main
@@ -161,11 +154,10 @@
|| alloc->id1.bitmap1.i_total
|| OCFS2_LOCAL_ALLOC(alloc)->la_bm_off) {
mlog(ML_ERROR, "Local alloc hasn't been recovered!\n"
- "found = %u, set = %u, taken = %u, off = %u\n",
- num_used,
- le32_to_cpu(alloc->id1.bitmap1.i_used),
- le32_to_cpu(alloc->id1.bitmap1.i_total),
- OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
+ "found = %u, set = %u, taken = %u, off = %u\n",
+ num_used, le32_to_cpu(alloc->id1.bitmap1.i_used),
+ le32_to_cpu(alloc->id1.bitmap1.i_total),
+ OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
status = -EBUSY;
goto bail;
}
@@ -173,7 +165,7 @@
if ((OCFS2_LOCAL_ALLOC(alloc)->la_size == 0) ||
(OCFS2_LOCAL_ALLOC(alloc)->la_size > ocfs2_local_alloc_size(inode->i_sb))) {
mlog(ML_ERROR, "Local alloc size is invalid (la_size = %u)\n",
- OCFS2_LOCAL_ALLOC(alloc)->la_size);
+ OCFS2_LOCAL_ALLOC(alloc)->la_size);
status = -EINVAL;
goto bail;
}
@@ -190,21 +182,19 @@
mlog_exit(status);
return status;
-} /* ocfs_load_local_alloc */
+}
/*
- * ocfs_shutdown_local_alloc
- *
* return any unused bits to the bitmap and write out a clean
* local_alloc.
*
* local_alloc_bh is optional. If not passed, we will simply use the
* one off osb. If you do pass it however, be warned that it *will* be
* returned brelse'd and NULL'd out.*/
-void ocfs_shutdown_local_alloc(ocfs_super *osb)
+void ocfs2_shutdown_local_alloc(ocfs2_super *osb)
{
int status;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
struct inode *local_alloc_inode = NULL;
struct buffer_head *bh = NULL;
struct buffer_head *main_bm_bh = NULL;
@@ -218,9 +208,9 @@
goto bail;
local_alloc_inode =
- ocfs_get_system_file_inode(osb,
- LOCAL_ALLOC_SYSTEM_INODE,
- osb->slot_num);
+ ocfs2_get_system_file_inode(osb,
+ LOCAL_ALLOC_SYSTEM_INODE,
+ osb->slot_num);
if (!local_alloc_inode) {
status = -ENOENT;
mlog_errno(status);
@@ -229,23 +219,23 @@
osb->local_alloc_state = OCFS2_LA_DISABLED;
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- main_bm_inode = ocfs_get_system_file_inode(osb,
- GLOBAL_BITMAP_SYSTEM_INODE,
- -1);
+ main_bm_inode = ocfs2_get_system_file_inode(osb,
+ GLOBAL_BITMAP_SYSTEM_INODE,
+ -1);
if (!main_bm_inode) {
status = -EINVAL;
mlog_errno(status);
goto bail;
}
- ocfs_handle_add_inode(handle, main_bm_inode);
+ ocfs2_handle_add_inode(handle, main_bm_inode);
status = ocfs2_meta_lock(main_bm_inode, handle, &main_bm_bh, 1);
if (status < 0) {
mlog_errno(status);
@@ -253,7 +243,7 @@
}
/* WINDOW_MOVE_CREDITS is a bit heavy... */
- handle = ocfs_start_trans(osb, handle, OCFS_WINDOW_MOVE_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_WINDOW_MOVE_CREDITS);
if (!handle) {
mlog_errno(-ENOMEM);
goto bail;
@@ -269,16 +259,16 @@
}
memcpy(alloc_copy, alloc, bh->b_size);
- status = ocfs_journal_access(handle, local_alloc_inode, bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, local_alloc_inode, bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- ocfs_clear_local_alloc(alloc);
+ ocfs2_clear_local_alloc(alloc);
- status = ocfs_journal_dirty(handle, bh);
+ status = ocfs2_journal_dirty(handle, bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -288,14 +278,14 @@
osb->local_alloc_bh = NULL;
osb->local_alloc_state = OCFS2_LA_UNUSED;
- status = ocfs_sync_local_to_main(osb, handle, alloc_copy,
- main_bm_inode, main_bm_bh);
+ status = ocfs2_sync_local_to_main(osb, handle, alloc_copy,
+ main_bm_inode, main_bm_bh);
if (status < 0)
mlog_errno(status);
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (main_bm_bh)
brelse(main_bm_bh);
@@ -310,20 +300,18 @@
kfree(alloc_copy);
mlog_exit_void();
-} /* ocfs_shutdown_local_alloc */
+}
/*
- * ocfs_begin_local_alloc_recovery
- *
* We want to free the bitmap bits outside of any recovery context as
* we'll need a cluster lock to do so, but we must clear the local
* alloc before giving up the recovered nodes journal. To solve this,
* we kmalloc a copy of the local alloc before it's change for the
- * caller to process with ocfs_complete_local_alloc_recovery
+ * caller to process with ocfs2_complete_local_alloc_recovery
*/
-int ocfs_begin_local_alloc_recovery(ocfs_super *osb,
- int slot_num,
- ocfs2_dinode **alloc_copy)
+int ocfs2_begin_local_alloc_recovery(ocfs2_super *osb,
+ int slot_num,
+ ocfs2_dinode **alloc_copy)
{
int status = 0;
struct buffer_head *alloc_bh = NULL;
@@ -334,17 +322,17 @@
*alloc_copy = NULL;
- inode = ocfs_get_system_file_inode(osb,
- LOCAL_ALLOC_SYSTEM_INODE,
- slot_num);
+ inode = ocfs2_get_system_file_inode(osb,
+ LOCAL_ALLOC_SYSTEM_INODE,
+ slot_num);
if (!inode) {
status = -EINVAL;
mlog_errno(status);
goto bail;
}
- status = ocfs_read_block(osb, OCFS2_I(inode)->ip_blkno,
- &alloc_bh, 0, inode);
+ status = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno,
+ &alloc_bh, 0, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -358,9 +346,9 @@
memcpy((*alloc_copy), alloc_bh->b_data, alloc_bh->b_size);
alloc = (ocfs2_dinode *) alloc_bh->b_data;
- ocfs_clear_local_alloc(alloc);
+ ocfs2_clear_local_alloc(alloc);
- status = ocfs_write_block(osb, alloc_bh, inode);
+ status = ocfs2_write_block(osb, alloc_bh, inode);
if (status < 0)
mlog_errno(status);
@@ -378,7 +366,7 @@
mlog_exit(status);
return status;
-} /* ocfs_begin_local_alloc_recovery */
+}
/*
* Step 2: By now, we've completed the journal recovery, we've stamped
@@ -386,40 +374,40 @@
* recovery map. Dlm locks will no longer stall, so lets clear out the
* main bitmap.
*/
-int ocfs_complete_local_alloc_recovery(ocfs_super *osb,
+int ocfs2_complete_local_alloc_recovery(ocfs2_super *osb,
ocfs2_dinode *alloc)
{
int status;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
struct buffer_head *main_bm_bh = NULL;
struct inode *main_bm_inode = NULL;
mlog_entry_void();
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- main_bm_inode = ocfs_get_system_file_inode(osb,
- GLOBAL_BITMAP_SYSTEM_INODE,
- -1);
+ main_bm_inode = ocfs2_get_system_file_inode(osb,
+ GLOBAL_BITMAP_SYSTEM_INODE,
+ -1);
if (!main_bm_inode) {
status = -EINVAL;
mlog_errno(status);
goto bail;
}
- ocfs_handle_add_inode(handle, main_bm_inode);
+ ocfs2_handle_add_inode(handle, main_bm_inode);
status = ocfs2_meta_lock(main_bm_inode, handle, &main_bm_bh, 1);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- handle = ocfs_start_trans(osb, handle, OCFS_WINDOW_MOVE_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_WINDOW_MOVE_CREDITS);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
@@ -427,16 +415,16 @@
}
/* we want the bitmap change to be recorded on disk asap */
- ocfs_handle_set_sync(handle, 1);
+ ocfs2_handle_set_sync(handle, 1);
- status = ocfs_sync_local_to_main(osb, handle, alloc,
- main_bm_inode, main_bm_bh);
+ status = ocfs2_sync_local_to_main(osb, handle, alloc,
+ main_bm_inode, main_bm_bh);
if (status < 0)
mlog_errno(status);
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (main_bm_bh)
brelse(main_bm_bh);
@@ -449,18 +437,16 @@
}
/*
- * ocfs_reserve_local_alloc_bits
- *
* make sure we've got at least bitswanted contiguous bits in the
* local alloc. You lose them when you drop i_sem.
*
* We will add ourselves to the transaction passed in, but may start
* our own in order to shift windows.
*/
-int ocfs_reserve_local_alloc_bits(ocfs_super *osb,
- ocfs_journal_handle *passed_handle,
- u32 bits_wanted,
- ocfs2_alloc_context *ac)
+int ocfs2_reserve_local_alloc_bits(ocfs2_super *osb,
+ ocfs2_journal_handle *passed_handle,
+ u32 bits_wanted,
+ ocfs2_alloc_context *ac)
{
int status;
ocfs2_dinode *alloc;
@@ -469,27 +455,27 @@
mlog_entry_void();
- OCFS_ASSERT(passed_handle);
- OCFS_ASSERT(ac);
- OCFS_ASSERT(!(passed_handle->flags & OCFS_HANDLE_STARTED));
+ OCFS2_ASSERT(passed_handle);
+ OCFS2_ASSERT(ac);
+ OCFS2_ASSERT(!(passed_handle->flags & OCFS2_HANDLE_STARTED));
local_alloc_inode =
- ocfs_get_system_file_inode(osb,
- LOCAL_ALLOC_SYSTEM_INODE,
- osb->slot_num);
+ ocfs2_get_system_file_inode(osb,
+ LOCAL_ALLOC_SYSTEM_INODE,
+ osb->slot_num);
if (!local_alloc_inode) {
status = -ENOENT;
mlog_errno(status);
goto bail;
}
- ocfs_handle_add_inode(passed_handle, local_alloc_inode);
+ ocfs2_handle_add_inode(passed_handle, local_alloc_inode);
if (osb->local_alloc_state != OCFS2_LA_ENABLED) {
status = -ENOSPC;
goto bail;
}
- if (bits_wanted > ocfs_local_alloc_window_bits(osb)) {
+ if (bits_wanted > ocfs2_local_alloc_window_bits(osb)) {
mlog(0, "Asking for more than my max window size!\n");
status = -ENOSPC;
goto bail;
@@ -497,15 +483,15 @@
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- OCFS_ASSERT(le32_to_cpu(alloc->id1.bitmap1.i_used) ==
- ocfs_local_alloc_count_bits(alloc));
+ OCFS2_ASSERT(le32_to_cpu(alloc->id1.bitmap1.i_used) ==
+ ocfs2_local_alloc_count_bits(alloc));
free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) -
le32_to_cpu(alloc->id1.bitmap1.i_used);
if (bits_wanted > free_bits) {
/* uhoh, window change time. */
- status =
- ocfs_local_alloc_slide_window(osb, local_alloc_inode);
+ status =
+ ocfs2_local_alloc_slide_window(osb, local_alloc_inode);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -516,7 +502,7 @@
ac->ac_inode = igrab(local_alloc_inode);
get_bh(osb->local_alloc_bh);
ac->ac_bh = osb->local_alloc_bh;
- ac->ac_which = OCFS_AC_USE_LOCAL;
+ ac->ac_which = OCFS2_AC_USE_LOCAL;
status = 0;
bail:
if (local_alloc_inode)
@@ -526,12 +512,12 @@
return status;
}
-int ocfs_claim_local_alloc_bits(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *ac,
- u32 min_bits,
- u32 *bit_off,
- u32 *num_bits)
+int ocfs2_claim_local_alloc_bits(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *ac,
+ u32 min_bits,
+ u32 *bit_off,
+ u32 *num_bits)
{
int status, start;
struct inode *local_alloc_inode;
@@ -540,13 +526,13 @@
ocfs2_dinode *alloc;
mlog_entry_void();
- OCFS_ASSERT(ac->ac_which == OCFS_AC_USE_LOCAL);
+ OCFS2_ASSERT(ac->ac_which == OCFS2_AC_USE_LOCAL);
bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given;
local_alloc_inode = ac->ac_inode;
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- start = ocfs_local_alloc_find_clear_bits(osb, alloc, bits_wanted);
+ start = ocfs2_local_alloc_find_clear_bits(osb, alloc, bits_wanted);
if (start == -1) {
/* TODO: Shouldn't we just BUG here? */
status = -ENOSPC;
@@ -560,9 +546,9 @@
* delete bits from it! */
*num_bits = bits_wanted;
- status = ocfs_journal_access(handle, local_alloc_inode,
- osb->local_alloc_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, local_alloc_inode,
+ osb->local_alloc_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -574,7 +560,7 @@
alloc->id1.bitmap1.i_used = cpu_to_le32(*num_bits +
le32_to_cpu(alloc->id1.bitmap1.i_used));
- status = ocfs_journal_dirty(handle, osb->local_alloc_bh);
+ status = ocfs2_journal_dirty(handle, osb->local_alloc_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -586,10 +572,7 @@
return status;
}
-/*
- * ocfs_local_alloc_count_bits
- */
-static u32 ocfs_local_alloc_count_bits(ocfs2_dinode *alloc)
+static u32 ocfs2_local_alloc_count_bits(ocfs2_dinode *alloc)
{
int i;
u8 *buffer;
@@ -603,14 +586,11 @@
mlog_exit(count);
return count;
-} /* ocfs_local_alloc_count_bits */
+}
-/*
- * ocfs_local_alloc_find_clear_bits
- */
-static int ocfs_local_alloc_find_clear_bits(ocfs_super *osb,
- ocfs2_dinode *alloc,
- u32 numbits)
+static int ocfs2_local_alloc_find_clear_bits(ocfs2_super *osb,
+ ocfs2_dinode *alloc,
+ u32 numbits)
{
int numfound, bitoff, left, startoff, lastzero;
void *bitmap = NULL;
@@ -665,12 +645,9 @@
bail:
mlog_exit(bitoff);
return bitoff;
-} /* ocfs_local_find_alloc_clear_bits */
+}
-/*
- * ocfs_clear_local_alloc
- */
-static void ocfs_clear_local_alloc(ocfs2_dinode *alloc)
+static void ocfs2_clear_local_alloc(ocfs2_dinode *alloc)
{
int i;
mlog_entry_void();
@@ -682,7 +659,7 @@
OCFS2_LOCAL_ALLOC(alloc)->la_bitmap[i] = 0;
mlog_exit_void();
-} /* ocfs_clear_local_alloc */
+}
#if 0
/* turn this on and uncomment below to aid debugging window shifts. */
@@ -704,18 +681,16 @@
#endif
/*
- * ocfs_sync_local_to_main
- *
* sync the local alloc to main bitmap.
*
* assumes you've already locked the main bitmap -- the bitmap inode
* passed is used for caching.
*/
-static int ocfs_sync_local_to_main(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_dinode *alloc,
- struct inode *main_bm_inode,
- struct buffer_head *main_bm_bh)
+static int ocfs2_sync_local_to_main(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_dinode *alloc,
+ struct inode *main_bm_inode,
+ struct buffer_head *main_bm_bh)
{
int status = 0;
int bit_off, left, count, start;
@@ -724,9 +699,9 @@
void *bitmap;
mlog_entry("total = %u, COUNT = %u, used = %u\n",
- le32_to_cpu(alloc->id1.bitmap1.i_total),
- ocfs_local_alloc_count_bits(alloc),
- le32_to_cpu(alloc->id1.bitmap1.i_used));
+ le32_to_cpu(alloc->id1.bitmap1.i_total),
+ ocfs2_local_alloc_count_bits(alloc),
+ le32_to_cpu(alloc->id1.bitmap1.i_used));
if (!alloc->id1.bitmap1.i_total) {
mlog(0, "nothing to sync!\n");
@@ -752,8 +727,6 @@
continue;
}
if (count) {
-// ocfs2_verify_zero_bits(bitmap, start, count);
-
blkno = la_start_blk +
ocfs2_clusters_to_blocks(osb->sb,
start - count);
@@ -763,8 +736,8 @@
"blkno = %"MLFu64")\n", count, start - count,
la_start_blk, blkno);
- status = ocfs_free_clusters(handle, main_bm_inode,
- main_bm_bh, blkno, count);
+ status = ocfs2_free_clusters(handle, main_bm_inode,
+ main_bm_bh, blkno, count);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -779,13 +752,13 @@
bail:
mlog_exit(status);
return status;
-} /* ocfs_sync_local_to_main */
+}
-static int ocfs_local_alloc_reserve_for_window(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context **ac,
- struct inode **bitmap_inode,
- struct buffer_head **bitmap_bh)
+static int ocfs2_local_alloc_reserve_for_window(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context **ac,
+ struct inode **bitmap_inode,
+ struct buffer_head **bitmap_bh)
{
int status;
@@ -797,9 +770,9 @@
}
memset(*ac, 0, sizeof(ocfs2_alloc_context));
(*ac)->ac_handle = handle;
- (*ac)->ac_bits_wanted = ocfs_local_alloc_window_bits(osb);
+ (*ac)->ac_bits_wanted = ocfs2_local_alloc_window_bits(osb);
- status = ocfs_reserve_cluster_bitmap_bits(osb, *ac);
+ status = ocfs2_reserve_cluster_bitmap_bits(osb, *ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -813,7 +786,7 @@
status = 0;
bail:
if ((status < 0) && *ac) {
- ocfs_free_alloc_context(*ac);
+ ocfs2_free_alloc_context(*ac);
*ac = NULL;
}
@@ -822,13 +795,11 @@
}
/*
- * ocfs_local_alloc_new_window
- *
* pass it the bitmap lock in lock_bh if you have it.
*/
-static int ocfs_local_alloc_new_window(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *ac)
+static int ocfs2_local_alloc_new_window(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *ac)
{
int status = 0;
u32 cluster_off, cluster_count;
@@ -842,13 +813,13 @@
"one\n");
mlog(0, "Allocating %u clusters for a new window.\n",
- ocfs_local_alloc_window_bits(osb));
+ ocfs2_local_alloc_window_bits(osb));
/* we used the generic suballoc reserve function, but we set
* everything up nicely, so there's no reason why we can't use
* the more specific cluster api to claim bits. */
- status = ocfs_claim_clusters(osb, handle, ac,
- ocfs_local_alloc_window_bits(osb),
- &cluster_off, &cluster_count);
+ status = ocfs2_claim_clusters(osb, handle, ac,
+ ocfs2_local_alloc_window_bits(osb),
+ &cluster_off, &cluster_count);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -875,24 +846,24 @@
bail:
mlog_exit(status);
return status;
-} /* ocfs_local_alloc_new_window */
+}
/* Note that we do *NOT* lock the local alloc inode here as
* it's been locked already for us. */
-static int ocfs_local_alloc_slide_window(ocfs_super *osb,
+static int ocfs2_local_alloc_slide_window(ocfs2_super *osb,
struct inode *local_alloc_inode)
{
int status = 0;
struct buffer_head *main_bm_bh = NULL;
struct inode *main_bm_inode = NULL;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
ocfs2_dinode *alloc;
ocfs2_dinode *alloc_copy = NULL;
ocfs2_alloc_context *ac = NULL;
mlog_entry_void();
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
@@ -900,18 +871,18 @@
}
/* This will lock the main bitmap for us. */
- status = ocfs_local_alloc_reserve_for_window(osb,
- handle,
- &ac,
- &main_bm_inode,
- &main_bm_bh);
+ status = ocfs2_local_alloc_reserve_for_window(osb,
+ handle,
+ &ac,
+ &main_bm_inode,
+ &main_bm_bh);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
goto bail;
}
- handle = ocfs_start_trans(osb, handle, OCFS_WINDOW_MOVE_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_WINDOW_MOVE_CREDITS);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
@@ -933,30 +904,30 @@
}
memcpy(alloc_copy, alloc, osb->local_alloc_bh->b_size);
- status = ocfs_journal_access(handle, local_alloc_inode,
- osb->local_alloc_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, local_alloc_inode,
+ osb->local_alloc_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- ocfs_clear_local_alloc(alloc);
+ ocfs2_clear_local_alloc(alloc);
- status = ocfs_journal_dirty(handle, osb->local_alloc_bh);
+ status = ocfs2_journal_dirty(handle, osb->local_alloc_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_sync_local_to_main(osb, handle, alloc_copy,
- main_bm_inode, main_bm_bh);
+ status = ocfs2_sync_local_to_main(osb, handle, alloc_copy,
+ main_bm_inode, main_bm_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_local_alloc_new_window(osb, handle, ac);
+ status = ocfs2_local_alloc_new_window(osb, handle, ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -968,7 +939,7 @@
status = 0;
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (main_bm_bh)
brelse(main_bm_bh);
@@ -980,7 +951,7 @@
kfree(alloc_copy);
if (ac)
- ocfs_free_alloc_context(ac);
+ ocfs2_free_alloc_context(ac);
mlog_exit(status);
return status;
Modified: trunk/fs/ocfs2/localalloc.h
===================================================================
--- trunk/fs/ocfs2/localalloc.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/localalloc.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,31 +26,31 @@
#ifndef OCFS2_LOCALALLOC_H
#define OCFS2_LOCALALLOC_H
-int ocfs_load_local_alloc(ocfs_super *osb);
+int ocfs2_load_local_alloc(ocfs2_super *osb);
-void ocfs_shutdown_local_alloc(ocfs_super *osb);
+void ocfs2_shutdown_local_alloc(ocfs2_super *osb);
-int ocfs_begin_local_alloc_recovery(ocfs_super *osb,
- int node_num,
- ocfs2_dinode **alloc_copy);
+int ocfs2_begin_local_alloc_recovery(ocfs2_super *osb,
+ int node_num,
+ ocfs2_dinode **alloc_copy);
-int ocfs_complete_local_alloc_recovery(ocfs_super *osb,
- ocfs2_dinode *alloc);
+int ocfs2_complete_local_alloc_recovery(ocfs2_super *osb,
+ ocfs2_dinode *alloc);
-int ocfs_alloc_should_use_local(ocfs_super *osb,
- u64 bits);
+int ocfs2_alloc_should_use_local(ocfs2_super *osb,
+ u64 bits);
struct _ocfs2_alloc_context;
-int ocfs_reserve_local_alloc_bits(ocfs_super *osb,
- ocfs_journal_handle *passed_handle,
- u32 bits_wanted,
- struct _ocfs2_alloc_context *ac);
+int ocfs2_reserve_local_alloc_bits(ocfs2_super *osb,
+ ocfs2_journal_handle *passed_handle,
+ u32 bits_wanted,
+ struct _ocfs2_alloc_context *ac);
-int ocfs_claim_local_alloc_bits(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct _ocfs2_alloc_context *ac,
- u32 min_bits,
- u32 *bit_off,
- u32 *num_bits);
+int ocfs2_claim_local_alloc_bits(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct _ocfs2_alloc_context *ac,
+ u32 min_bits,
+ u32 *bit_off,
+ u32 *num_bits);
#endif /* OCFS2_LOCALALLOC_H */
Modified: trunk/fs/ocfs2/mmap.c
===================================================================
--- trunk/fs/ocfs2/mmap.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/mmap.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -169,7 +169,7 @@
{
struct inode *inode = binode->ba_inode;
- OCFS_ASSERT(inode);
+ OCFS2_ASSERT(inode);
return OCFS2_I(inode)->ip_blkno;
}
@@ -189,8 +189,8 @@
struct rb_node * parent = NULL;
struct rb_node ** p = &ctxt->b_inodes.rb_node;
- OCFS_ASSERT(ctxt);
- OCFS_ASSERT(inode);
+ OCFS2_ASSERT(ctxt);
+ OCFS2_ASSERT(inode);
blkno = OCFS2_I(inode)->ip_blkno;
@@ -270,7 +270,7 @@
if (!skip_sem)
down_read(&mm->mmap_sem);
- OCFS_ASSERT(!__ocfs2_buffer_lock_ctxt_root(ctxt));
+ OCFS2_ASSERT(!__ocfs2_buffer_lock_ctxt_root(ctxt));
/* We always insert target because it might not be backing part of the
* buffer - but it needs to be in there so that it's lock gets ordered
@@ -364,10 +364,9 @@
if (!binode->ba_meta_locked) {
status = ocfs2_meta_lock_full(inode, NULL, NULL,
- binode->ba_lock_meta_level,
- 0,
- ctxt->b_cb,
- ctxt->b_cb_data);
+ binode->ba_lock_meta_level,
+ 0, ctxt->b_cb,
+ ctxt->b_cb_data);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -415,7 +414,7 @@
if (binode->ba_locked && binode->ba_lock_data)
ocfs2_data_unlock(binode->ba_inode,
binode->ba_lock_data_level);
-
+
if (binode->ba_locked || binode->ba_meta_locked)
ocfs2_meta_unlock(binode->ba_inode,
binode->ba_lock_meta_level);
@@ -437,13 +436,15 @@
* in when it thinks the dlm won't block any more. Thus, the caller must zero
* the info struct before calling in the first time.
*/
-ssize_t ocfs_write_lock_maybe_extend(struct file *filp, const char __user *buf,
- size_t count, loff_t *ppos,
- struct ocfs2_write_lock_info *info,
- ocfs2_buffer_lock_ctxt *ctxt)
+ssize_t ocfs2_write_lock_maybe_extend(struct file *filp,
+ const char __user *buf,
+ size_t count,
+ loff_t *ppos,
+ struct ocfs2_write_lock_info *info,
+ ocfs2_buffer_lock_ctxt *ctxt)
{
int ret = 0;
- ocfs_super *osb = NULL;
+ ocfs2_super *osb = NULL;
struct dentry *dentry = filp->f_dentry;
struct inode *inode = dentry->d_inode;
int status;
@@ -551,8 +552,7 @@
/* we want an extend, but need a higher
* level cluster lock. */
mlog(0, "inode %"MLFu64", had a PR, looping back "
- "for EX\n",
- OCFS2_I(inode)->ip_blkno);
+ "for EX\n", OCFS2_I(inode)->ip_blkno);
ocfs2_meta_unlock(inode, level);
info->wl_have_target_meta = 0;
level = 1;
@@ -566,8 +566,8 @@
/* If we extend AT ALL here then we update our state
* and continue the write call, regardless of error --
* this is basically a short write. */
- status = ocfs_extend_file(osb, inode, info->wl_newsize,
- &bytes_added);
+ status = ocfs2_extend_file(osb, inode, info->wl_newsize,
+ &bytes_added);
if (status < 0 && (!bytes_added)) {
if (status != -ERESTARTSYS
&& status != -EINTR
Modified: trunk/fs/ocfs2/mmap.h
===================================================================
--- trunk/fs/ocfs2/mmap.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/mmap.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -121,8 +121,10 @@
ocfs2_backing_inode *wl_target_binode;
};
-ssize_t ocfs_write_lock_maybe_extend(struct file *filp, const char __user *buf,
- size_t count, loff_t *ppos,
+ssize_t ocfs2_write_lock_maybe_extend(struct file *filp,
+ const char __user *buf,
+ size_t count,
+ loff_t *ppos,
struct ocfs2_write_lock_info *info,
ocfs2_buffer_lock_ctxt *ctxt);
Modified: trunk/fs/ocfs2/namei.c
===================================================================
--- trunk/fs/ocfs2/namei.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/namei.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -63,81 +63,80 @@
#include "buffer_head_io.h"
-static int inline search_dirblock(struct buffer_head *bh,
- struct inode *dir,
- const char *name, int namelen,
- unsigned long offset,
- struct ocfs2_dir_entry **res_dir);
+static int inline ocfs2_search_dirblock(struct buffer_head *bh,
+ struct inode *dir,
+ const char *name, int namelen,
+ unsigned long offset,
+ struct ocfs2_dir_entry **res_dir);
-static int ocfs_delete_entry(ocfs_journal_handle *handle,
- struct inode *dir,
- struct ocfs2_dir_entry *de_del,
- struct buffer_head *bh);
+static int ocfs2_delete_entry(ocfs2_journal_handle *handle,
+ struct inode *dir,
+ struct ocfs2_dir_entry *de_del,
+ struct buffer_head *bh);
-static int __ocfs_add_entry(ocfs_journal_handle *handle, struct inode *dir,
- const char *name, int namelen,
- struct inode *inode, u64 blkno,
- struct buffer_head *parent_fe_bh,
- struct buffer_head *insert_bh);
+static int __ocfs2_add_entry(ocfs2_journal_handle *handle, struct inode *dir,
+ const char *name, int namelen,
+ struct inode *inode, u64 blkno,
+ struct buffer_head *parent_fe_bh,
+ struct buffer_head *insert_bh);
-static int ocfs_mknod_locked(ocfs_super *osb, struct inode *dir,
- struct dentry *dentry, int mode,
- dev_t dev,
- struct buffer_head **new_fe_bh,
- struct buffer_head *parent_fe_bh,
- ocfs_journal_handle *handle,
- struct inode *inode,
- ocfs2_alloc_context *inode_ac);
+static int ocfs2_mknod_locked(ocfs2_super *osb, struct inode *dir,
+ struct dentry *dentry, int mode,
+ dev_t dev,
+ struct buffer_head **new_fe_bh,
+ struct buffer_head *parent_fe_bh,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ ocfs2_alloc_context *inode_ac);
-static int ocfs_fill_new_dir(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *parent,
- struct inode *inode,
- struct buffer_head *fe_bh,
- ocfs2_alloc_context *data_ac);
+static int ocfs2_fill_new_dir(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *parent,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ ocfs2_alloc_context *data_ac);
-static int ocfs_double_lock(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct buffer_head **bh1,
- struct inode *inode1,
- struct buffer_head **bh2,
- struct inode *inode2);
+static int ocfs2_double_lock(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct buffer_head **bh1,
+ struct inode *inode1,
+ struct buffer_head **bh2,
+ struct inode *inode2);
-static int ocfs_prepare_orphan_dir(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *inode,
- char *name,
- struct buffer_head **de_bh);
+static int ocfs2_prepare_orphan_dir(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ char *name,
+ struct buffer_head **de_bh);
-static int ocfs_orphan_add(ocfs_super *osb, ocfs_journal_handle *handle,
- struct inode *inode, ocfs2_dinode *fe,
- char *name, struct buffer_head *de_bh);
+static int ocfs2_orphan_add(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ ocfs2_dinode *fe,
+ char *name,
+ struct buffer_head *de_bh);
-static int ocfs_create_symlink_data(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *inode,
- const char *symname);
+static int ocfs2_create_symlink_data(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ const char *symname);
-static inline int ocfs_add_entry(ocfs_journal_handle *handle,
- struct dentry *dentry,
- struct inode *inode, u64 blkno,
- struct buffer_head *parent_fe_bh,
- struct buffer_head *insert_bh)
+static inline int ocfs2_add_entry(ocfs2_journal_handle *handle,
+ struct dentry *dentry,
+ struct inode *inode, u64 blkno,
+ struct buffer_head *parent_fe_bh,
+ struct buffer_head *insert_bh)
{
- return __ocfs_add_entry(handle, dentry->d_parent->d_inode,
- dentry->d_name.name, dentry->d_name.len,
- inode, blkno, parent_fe_bh, insert_bh);
+ return __ocfs2_add_entry(handle, dentry->d_parent->d_inode,
+ dentry->d_name.name, dentry->d_name.len,
+ inode, blkno, parent_fe_bh, insert_bh);
}
/* An orphan dir name is an 8 byte value, printed as a hex string */
#define OCFS2_ORPHAN_NAMELEN ((int)(2 * sizeof(u64)))
-/*
- * ocfs_lookup()
- *
- */
-static struct dentry *ocfs_lookup(struct inode *dir, struct dentry *dentry,
- struct nameidata *nd)
+static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry,
+ struct nameidata *nd)
{
int status;
u64 blkno;
@@ -145,7 +144,7 @@
struct inode *inode = NULL;
struct super_block *sb = dir->i_sb;
struct dentry *ret;
- ocfs_super *osb = OCFS2_SB(sb);
+ ocfs2_super *osb = OCFS2_SB(sb);
struct ocfs2_dir_entry *dirent;
mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
@@ -158,13 +157,13 @@
mlog(0, "about to call find_files_on_disk with inode=%p\n", dir);
- status = ocfs_find_files_on_disk(osb, dentry->d_name.name,
- dentry->d_name.len, &blkno,
- dir, 1, &dirent_bh, &dirent);
+ status = ocfs2_find_files_on_disk(osb, dentry->d_name.name,
+ dentry->d_name.len, &blkno,
+ dir, 1, &dirent_bh, &dirent);
if (status < 0)
goto bail_add;
- inode = ocfs_iget(osb, blkno);
+ inode = ocfs2_iget(osb, blkno);
if (!inode) {
mlog(ML_ERROR, "Could not create inode!\n");
ret = ERR_PTR(-EACCES);
@@ -172,7 +171,7 @@
}
bail_add:
- dentry->d_op = &ocfs_dentry_ops;
+ dentry->d_op = &ocfs2_dentry_ops;
d_add(dentry, inode);
ret = NULL;
@@ -183,13 +182,9 @@
mlog_exit_ptr(ret);
return ret;
-} /* ocfs_lookup */
+}
-/*
- * ocfs_get_parent
- *
- */
-struct dentry *ocfs_get_parent(struct dentry *child)
+struct dentry *ocfs2_get_parent(struct dentry *child)
{
int status;
u64 blkno;
@@ -197,7 +192,7 @@
struct inode *inode;
struct inode *dir = child->d_inode;
struct super_block *sb = dir->i_sb;
- ocfs_super *osb = OCFS2_SB(sb);
+ ocfs2_super *osb = OCFS2_SB(sb);
struct buffer_head *dirent_bh = NULL;
struct ocfs2_dir_entry *dirent;
@@ -206,14 +201,14 @@
mlog(0, "about to call find_files_on_disk with inode=%p\n", dir);
- status = ocfs_find_files_on_disk(osb, "..", 2, &blkno,
- dir, 1, &dirent_bh, &dirent);
+ status = ocfs2_find_files_on_disk(osb, "..", 2, &blkno,
+ dir, 1, &dirent_bh, &dirent);
if (status < 0) {
parent = ERR_PTR(-ENOENT);
goto bail;
}
-
- inode = ocfs_iget(osb, blkno);
+
+ inode = ocfs2_iget(osb, blkno);
if (!inode) {
mlog(ML_ERROR, "Could not create inode!\n");
parent = ERR_PTR(-EACCES);
@@ -233,14 +228,14 @@
mlog_exit_ptr(parent);
return parent;
-} /* ocfs_get_parent */
+}
-static int ocfs_fill_new_dir(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *parent,
- struct inode *inode,
- struct buffer_head *fe_bh,
- ocfs2_alloc_context *data_ac)
+static int ocfs2_fill_new_dir(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *parent,
+ struct inode *inode,
+ struct buffer_head *fe_bh,
+ ocfs2_alloc_context *data_ac)
{
int status;
struct buffer_head *new_bh = NULL;
@@ -248,8 +243,8 @@
mlog_entry_void();
- status = ocfs_do_extend_dir(osb->sb, handle, inode, fe_bh,
- data_ac, NULL, &new_bh);
+ status = ocfs2_do_extend_dir(osb->sb, handle, inode, fe_bh,
+ data_ac, NULL, &new_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -257,8 +252,8 @@
set_buffer_uptodate(new_bh);
ocfs2_set_bh_seqnum(inode, new_bh);
- status = ocfs_journal_access(handle, inode, new_bh,
- OCFS_JOURNAL_ACCESS_CREATE);
+ status = ocfs2_journal_access(handle, inode, new_bh,
+ OCFS2_JOURNAL_ACCESS_CREATE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -280,7 +275,7 @@
strcpy(de->name, "..");
ocfs2_set_de_type(de, S_IFDIR);
- status = ocfs_journal_dirty(handle, new_bh);
+ status = ocfs2_journal_dirty(handle, new_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -289,7 +284,7 @@
i_size_write(inode, inode->i_sb->s_blocksize);
inode->i_nlink = 2;
inode->i_blocks = ocfs2_align_bytes_to_sectors(inode->i_sb->s_blocksize);
- status = ocfs_mark_inode_dirty(handle, inode, fe_bh);
+ status = ocfs2_mark_inode_dirty(handle, inode, fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -304,14 +299,16 @@
return status;
}
-static int ocfs_mknod(struct inode *dir, struct dentry *dentry,
- int mode, dev_t dev)
+static int ocfs2_mknod(struct inode *dir,
+ struct dentry *dentry,
+ int mode,
+ dev_t dev)
{
int status = 0;
struct buffer_head *parent_fe_bh = NULL;
u64 file_off;
- ocfs_journal_handle *handle = NULL;
- ocfs_super *osb;
+ ocfs2_journal_handle *handle = NULL;
+ ocfs2_super *osb;
ocfs2_dinode *fe = NULL;
ocfs2_dinode *dirfe;
struct buffer_head *new_fe_bh = NULL;
@@ -321,7 +318,8 @@
ocfs2_alloc_context *data_ac = NULL;
mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
- (unsigned long)dev, dentry->d_name.len, dentry->d_name.name);
+ (unsigned long)dev, dentry->d_name.len,
+ dentry->d_name.name);
/* get our super block */
osb = OCFS2_SB(dir->i_sb);
@@ -340,7 +338,7 @@
goto leave;
}
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -361,16 +359,16 @@
}
/* get a spot inside the dir. */
- status = ocfs_prepare_dir_for_insert(osb, dir, parent_fe_bh,
- dentry->d_name.name,
- dentry->d_name.len, &de_bh);
+ status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh,
+ dentry->d_name.name,
+ dentry->d_name.len, &de_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
}
/* reserve an inode spot */
- status = ocfs_reserve_new_inode(osb, handle, &inode_ac);
+ status = ocfs2_reserve_new_inode(osb, handle, &inode_ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -380,7 +378,7 @@
/* are we making a directory? If so, reserve a cluster for his
* 1st extent. */
if (S_ISDIR(mode)) {
- status = ocfs_reserve_clusters(osb, handle, 1, &data_ac);
+ status = ocfs2_reserve_clusters(osb, handle, 1, &data_ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -388,7 +386,7 @@
}
}
- handle = ocfs_start_trans(osb, handle, OCFS_MKNOD_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_MKNOD_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -396,9 +394,9 @@
}
/* do the real work now. */
- status = ocfs_mknod_locked(osb, dir, dentry, mode, dev,
- &new_fe_bh, parent_fe_bh, handle,
- inode, inode_ac);
+ status = ocfs2_mknod_locked(osb, dir, dentry, mode, dev,
+ &new_fe_bh, parent_fe_bh, handle,
+ inode, inode_ac);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -407,7 +405,7 @@
fe = (ocfs2_dinode *)new_fe_bh->b_data;
OCFS2_I(inode)->ip_blkno = fe->i_blkno;
- if (ocfs_populate_inode(inode, fe, 1) < 0) {
+ if (ocfs2_populate_inode(inode, fe, 1) < 0) {
mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, "
"i_blkno=%"MLFu64", i_ino=%lu\n",
(unsigned long long)new_fe_bh->b_blocknr,
@@ -415,7 +413,7 @@
BUG();
}
- ocfs_inode_set_new(osb, inode);
+ ocfs2_inode_set_new(osb, inode);
status = ocfs2_create_new_inode_locks(inode);
if (status < 0)
mlog_errno(status);
@@ -423,21 +421,21 @@
file_off = fe->i_blkno << dir->i_sb->s_blocksize_bits;
if (S_ISDIR(mode)) {
- status = ocfs_fill_new_dir(osb, handle, dir, inode,
- new_fe_bh, data_ac);
+ status = ocfs2_fill_new_dir(osb, handle, dir, inode,
+ new_fe_bh, data_ac);
if (status < 0) {
mlog_errno(status);
goto leave;
}
- status = ocfs_journal_access(handle, dir, parent_fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, dir, parent_fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto leave;
}
dirfe->i_links_count++;
- status = ocfs_journal_dirty(handle, parent_fe_bh);
+ status = ocfs2_journal_dirty(handle, parent_fe_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -445,8 +443,8 @@
dir->i_nlink++;
}
- status = ocfs_add_entry(handle, dentry, inode, fe->i_blkno,
- parent_fe_bh, de_bh);
+ status = ocfs2_add_entry(handle, dentry, inode, fe->i_blkno,
+ parent_fe_bh, de_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -458,12 +456,12 @@
status = 0;
leave:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (status == -ENOSPC)
mlog(0, "Disk is full\n");
- if (new_fe_bh)
+ if (new_fe_bh)
brelse(new_fe_bh);
if (de_bh)
@@ -476,28 +474,24 @@
iput(inode);
if (inode_ac)
- ocfs_free_alloc_context(inode_ac);
+ ocfs2_free_alloc_context(inode_ac);
if (data_ac)
- ocfs_free_alloc_context(data_ac);
+ ocfs2_free_alloc_context(data_ac);
mlog_exit(status);
return status;
-} /* ocfs_mknod */
+}
-/*
- * ocfs_mknod_locked()
- *
- */
-static int ocfs_mknod_locked(ocfs_super *osb, struct inode *dir,
- struct dentry *dentry, int mode,
- dev_t dev,
- struct buffer_head **new_fe_bh,
- struct buffer_head *parent_fe_bh,
- ocfs_journal_handle *handle,
- struct inode *inode,
- ocfs2_alloc_context *inode_ac)
+static int ocfs2_mknod_locked(ocfs2_super *osb, struct inode *dir,
+ struct dentry *dentry, int mode,
+ dev_t dev,
+ struct buffer_head **new_fe_bh,
+ struct buffer_head *parent_fe_bh,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ ocfs2_alloc_context *inode_ac)
{
int status = 0;
ocfs2_dinode *fe = NULL;
@@ -506,13 +500,14 @@
u16 suballoc_bit;
mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, mode,
- (unsigned long)dev, dentry->d_name.len, dentry->d_name.name);
+ (unsigned long)dev, dentry->d_name.len,
+ dentry->d_name.name);
- OCFS_ASSERT(new_fe_bh);
+ OCFS2_ASSERT(new_fe_bh);
*new_fe_bh = NULL;
- status = ocfs_claim_new_inode(osb, handle, inode_ac, &suballoc_bit,
- &fe_blkno);
+ status = ocfs2_claim_new_inode(osb, handle, inode_ac, &suballoc_bit,
+ &fe_blkno);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -527,8 +522,8 @@
set_buffer_uptodate(*new_fe_bh);
ocfs2_set_bh_seqnum(inode, *new_fe_bh);
- status = ocfs_journal_access(handle, inode, *new_fe_bh,
- OCFS_JOURNAL_ACCESS_CREATE);
+ status = ocfs2_journal_access(handle, inode, *new_fe_bh,
+ OCFS2_JOURNAL_ACCESS_CREATE);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -580,7 +575,7 @@
fe = NULL;
- status = ocfs_journal_dirty(handle, *new_fe_bh);
+ status = ocfs2_journal_dirty(handle, *new_fe_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -597,55 +592,49 @@
mlog_exit(status);
return status;
-} /* ocfs_mknod_locked */
+}
-/*
- * ocfs_mkdir()
- *
- */
-static int ocfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
+static int ocfs2_mkdir(struct inode *dir,
+ struct dentry *dentry,
+ int mode)
{
int ret;
mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
dentry->d_name.len, dentry->d_name.name);
- ret = ocfs_mknod(dir, dentry, mode | S_IFDIR, 0);
+ ret = ocfs2_mknod(dir, dentry, mode | S_IFDIR, 0);
mlog_exit(ret);
return ret;
-} /* ocfs_mkdir */
+}
-/*
- * ocfs_create()
- *
- */
-static int ocfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd)
+static int ocfs2_create(struct inode *dir,
+ struct dentry *dentry,
+ int mode,
+ struct nameidata *nd)
{
int ret;
mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, mode,
dentry->d_name.len, dentry->d_name.name);
- ret = ocfs_mknod(dir, dentry, mode | S_IFREG, 0);
+ ret = ocfs2_mknod(dir, dentry, mode | S_IFREG, 0);
mlog_exit(ret);
return ret;
-} /* ocfs_create */
+}
-/*
- * ocfs_link()
- *
- */
-static int ocfs_link(struct dentry * old_dentry,
- struct inode * dir, struct dentry *dentry)
+static int ocfs2_link(struct dentry *old_dentry,
+ struct inode *dir,
+ struct dentry *dentry)
{
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
struct inode *inode = old_dentry->d_inode;
int err;
struct buffer_head *fe_bh = NULL;
struct buffer_head *parent_fe_bh = NULL;
struct buffer_head *de_bh = NULL;
ocfs2_dinode *fe = NULL;
- ocfs_super *osb = OCFS2_SB(dir->i_sb);
+ ocfs2_super *osb = OCFS2_SB(dir->i_sb);
mlog_entry("(inode=%lu, old='%.*s' new='%.*s')\n", inode->i_ino,
old_dentry->d_name.len, old_dentry->d_name.name,
@@ -661,7 +650,7 @@
goto bail;
}
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
err = -ENOMEM;
goto bail;
@@ -673,9 +662,9 @@
goto bail;
}
- err = ocfs_prepare_dir_for_insert(osb, dir, parent_fe_bh,
- dentry->d_name.name,
- dentry->d_name.len, &de_bh);
+ err = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh,
+ dentry->d_name.name,
+ dentry->d_name.len, &de_bh);
if (err < 0) {
mlog_errno(err);
goto bail;
@@ -693,14 +682,14 @@
goto bail;
}
- handle = ocfs_start_trans(osb, handle, OCFS_LINK_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_LINK_CREDITS);
if (handle == NULL) {
err = -ENOMEM;
goto bail;
}
- err = ocfs_journal_access(handle, inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ err = ocfs2_journal_access(handle, inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (err < 0) {
mlog_errno(err);
goto bail;
@@ -712,7 +701,7 @@
fe->i_ctime = inode->i_ctime.tv_sec;
fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
- err = ocfs_journal_dirty(handle, fe_bh);
+ err = ocfs2_journal_dirty(handle, fe_bh);
if (err < 0) {
fe->i_links_count--;
inode->i_nlink--;
@@ -720,9 +709,9 @@
goto bail;
}
- err = ocfs_add_entry(handle, dentry, inode,
- OCFS2_I(inode)->ip_blkno,
- parent_fe_bh, de_bh);
+ err = ocfs2_add_entry(handle, dentry, inode,
+ OCFS2_I(inode)->ip_blkno,
+ parent_fe_bh, de_bh);
if (err) {
fe->i_links_count--;
inode->i_nlink--;
@@ -734,7 +723,7 @@
d_instantiate(dentry, inode);
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (de_bh)
brelse(de_bh);
if (fe_bh)
@@ -745,23 +734,20 @@
mlog_exit(err);
return err;
-} /* ocfs_link */
+}
-/*
- * ocfs_unlink()
- *
- */
-static int ocfs_unlink(struct inode *dir, struct dentry *dentry)
+static int ocfs2_unlink(struct inode *dir,
+ struct dentry *dentry)
{
int status;
unsigned int saved_nlink = 0;
struct inode *inode = dentry->d_inode;
- ocfs_super *osb = OCFS2_SB(dir->i_sb);
+ ocfs2_super *osb = OCFS2_SB(dir->i_sb);
u64 blkno;
ocfs2_dinode *fe = NULL;
struct buffer_head *fe_bh = NULL;
struct buffer_head *parent_node_bh = NULL;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
struct ocfs2_dir_entry *dirent = NULL;
struct buffer_head *dirent_bh = NULL;
char orphan_name[OCFS2_ORPHAN_NAMELEN + 1];
@@ -770,7 +756,7 @@
mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
dentry->d_name.len, dentry->d_name.name);
- OCFS_ASSERT((dentry->d_parent->d_inode == dir));
+ OCFS2_ASSERT((dentry->d_parent->d_inode == dir));
mlog(0, "ino = %"MLFu64"\n", OCFS2_I(inode)->ip_blkno);
@@ -780,7 +766,7 @@
goto leave;
}
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -793,10 +779,10 @@
goto leave;
}
- status = ocfs_find_files_on_disk(osb, dentry->d_name.name,
- dentry->d_name.len, &blkno,
- dir, 0, &dirent_bh,
- &dirent);
+ status = ocfs2_find_files_on_disk(osb, dentry->d_name.name,
+ dentry->d_name.len, &blkno,
+ dir, 0, &dirent_bh,
+ &dirent);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
@@ -814,7 +800,7 @@
}
if (S_ISDIR(inode->i_mode)) {
- if (!ocfs_empty_dir(inode)) {
+ if (!ocfs2_empty_dir(inode)) {
status = -ENOTEMPTY;
goto leave;
} else if (inode->i_nlink != 2) {
@@ -843,24 +829,24 @@
}
if (!inode->i_nlink) {
- status = ocfs_prepare_orphan_dir(osb, handle, inode,
- orphan_name,
- &orphan_entry_bh);
+ status = ocfs2_prepare_orphan_dir(osb, handle, inode,
+ orphan_name,
+ &orphan_entry_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
}
}
- handle = ocfs_start_trans(osb, handle, OCFS_UNLINK_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_UNLINK_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
goto leave;
}
- status = ocfs_journal_access(handle, inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -869,8 +855,8 @@
fe = (ocfs2_dinode *) fe_bh->b_data;
if (!inode->i_nlink) {
- status = ocfs_orphan_add(osb, handle, inode, fe, orphan_name,
- orphan_entry_bh);
+ status = ocfs2_orphan_add(osb, handle, inode, fe, orphan_name,
+ orphan_entry_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -878,7 +864,7 @@
}
/* delete the name from the parent dir */
- status = ocfs_delete_entry(handle, dir, dirent, dirent_bh);
+ status = ocfs2_delete_entry(handle, dir, dirent, dirent_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -889,7 +875,7 @@
fe->i_links_count = inode->i_nlink;
saved_nlink = 0;
- status = ocfs_journal_dirty(handle, fe_bh);
+ status = ocfs2_journal_dirty(handle, fe_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -897,8 +883,8 @@
if (S_ISDIR(inode->i_mode)) {
dir->i_nlink--;
- status = ocfs_mark_inode_dirty(handle, dir,
- parent_node_bh);
+ status = ocfs2_mark_inode_dirty(handle, dir,
+ parent_node_bh);
if (status < 0) {
mlog_errno(status);
dir->i_nlink++;
@@ -910,7 +896,7 @@
inode->i_nlink = saved_nlink;
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (fe_bh)
brelse(fe_bh);
@@ -927,20 +913,18 @@
mlog_exit(status);
return status;
-} /* ocfs_unlink */
+}
/*
- * ocfs_double_lock()
- *
* The only place this should be used is rename!
* if they have the same id, then the 1st one is the only one locked.
*/
-static int ocfs_double_lock(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct buffer_head **bh1,
- struct inode *inode1,
- struct buffer_head **bh2,
- struct inode *inode2)
+static int ocfs2_double_lock(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct buffer_head **bh1,
+ struct inode *inode1,
+ struct buffer_head **bh2,
+ struct inode *inode2)
{
int status;
struct ocfs2_inode_info *oi1 = OCFS2_I(inode1);
@@ -951,7 +935,7 @@
mlog_entry("(inode1 = %"MLFu64", inode2 = %"MLFu64")\n",
oi1->ip_blkno, oi2->ip_blkno);
- OCFS_ASSERT(handle);
+ OCFS2_ASSERT(handle);
if (*bh1)
*bh1 = NULL;
@@ -987,19 +971,17 @@
bail:
mlog_exit(status);
return status;
-} /* ocfs_double_lock */
+}
#define PARENT_INO(buffer) \
((struct ocfs2_dir_entry *) \
((char *)buffer + \
le16_to_cpu(((struct ocfs2_dir_entry *)buffer)->rec_len)))->inode
-/*
- * ocfs_rename()
- *
- */
-static int ocfs_rename(struct inode *old_dir, struct dentry *old_dentry,
- struct inode *new_dir, struct dentry *new_dentry)
+static int ocfs2_rename(struct inode *old_dir,
+ struct dentry *old_dentry,
+ struct inode *new_dir,
+ struct dentry *new_dentry)
{
int status = 0;
struct inode *old_inode = old_dentry->d_inode;
@@ -1009,9 +991,9 @@
struct buffer_head *orphan_entry_bh = NULL;
struct buffer_head *newfe_bh = NULL;
struct buffer_head *insert_entry_bh = NULL;
- ocfs_super *osb = NULL;
+ ocfs2_super *osb = NULL;
u64 newfe_blkno;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
struct buffer_head *old_dir_bh = NULL;
struct buffer_head *new_dir_bh = NULL;
struct ocfs2_dir_entry *old_de = NULL, *new_de = NULL; // dirent for old_dentry
@@ -1045,7 +1027,7 @@
}
}
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -1053,7 +1035,7 @@
}
/* if old and new are the same, this'll just do one lock. */
- status = ocfs_double_lock(osb, handle,
+ status = ocfs2_double_lock(osb, handle,
&old_dir_bh, old_dir,
&new_dir_bh, new_dir);
if (status < 0) {
@@ -1091,7 +1073,7 @@
}
status = -EIO;
- old_inode_de_bh = ocfs_bread(old_inode, 0, &status, 0);
+ old_inode_de_bh = ocfs2_bread(old_inode, 0, &status, 0);
if (!old_inode_de_bh)
goto bail;
@@ -1114,9 +1096,9 @@
}
status = -ENOENT;
- old_de_bh = ocfs_find_entry(old_dentry->d_name.name,
- old_dentry->d_name.len,
- old_dir, &old_de);
+ old_de_bh = ocfs2_find_entry(old_dentry->d_name.name,
+ old_dentry->d_name.len,
+ old_dir, &old_de);
if (!old_de_bh)
goto bail;
@@ -1131,10 +1113,10 @@
/* check if the target already exists (in which case we need
* to delete it */
- status = ocfs_find_files_on_disk(osb, new_dentry->d_name.name,
- new_dentry->d_name.len,
- &newfe_blkno, new_dir, 0,
- &new_de_bh, &new_de);
+ status = ocfs2_find_files_on_disk(osb, new_dentry->d_name.name,
+ new_dentry->d_name.len,
+ &newfe_blkno, new_dir, 0,
+ &new_de_bh, &new_de);
/* The only error we allow here is -ENOENT because the new
* file not existing is perfectly valid. */
if ((status < 0) && (status != -ENOENT)) {
@@ -1183,28 +1165,28 @@
(unsigned long long)newfe_bh->b_blocknr : 0ULL);
if (S_ISDIR(new_inode->i_mode) || (new_inode->i_nlink == 1)) {
- status = ocfs_prepare_orphan_dir(osb, handle,
- new_inode,
- orphan_name,
- &orphan_entry_bh);
+ status = ocfs2_prepare_orphan_dir(osb, handle,
+ new_inode,
+ orphan_name,
+ &orphan_entry_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
}
} else {
- OCFS_ASSERT(new_dentry->d_parent->d_inode == new_dir);
- status = ocfs_prepare_dir_for_insert(osb, new_dir, new_dir_bh,
- new_dentry->d_name.name,
- new_dentry->d_name.len,
- &insert_entry_bh);
+ OCFS2_ASSERT(new_dentry->d_parent->d_inode == new_dir);
+ status = ocfs2_prepare_dir_for_insert(osb, new_dir, new_dir_bh,
+ new_dentry->d_name.name,
+ new_dentry->d_name.len,
+ &insert_entry_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
}
- handle = ocfs_start_trans(osb, handle, OCFS_RENAME_CREDITS);
+ handle = ocfs2_start_trans(osb, handle, OCFS2_RENAME_CREDITS);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -1213,22 +1195,23 @@
if (new_de) {
if (S_ISDIR(new_inode->i_mode)) {
- if (!ocfs_empty_dir(new_inode) || new_inode->i_nlink != 2) {
+ if (!ocfs2_empty_dir(new_inode) ||
+ new_inode->i_nlink != 2) {
status = -ENOTEMPTY;
goto bail;
}
}
- status = ocfs_journal_access(handle, new_inode, newfe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, new_inode, newfe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
}
if (S_ISDIR(new_inode->i_mode) || (newfe->i_links_count == 1)){
- status = ocfs_orphan_add(osb, handle, new_inode,
- newfe, orphan_name,
- orphan_entry_bh);
+ status = ocfs2_orphan_add(osb, handle, new_inode,
+ newfe, orphan_name,
+ orphan_entry_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1236,17 +1219,16 @@
}
/* change the dirent to point to the correct inode */
- status = ocfs_journal_access(handle, new_dir, new_de_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, new_dir, new_de_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- new_de->inode =
- le64_to_cpu(OCFS2_I(old_inode)->ip_blkno);
+ new_de->inode = le64_to_cpu(OCFS2_I(old_inode)->ip_blkno);
new_de->file_type = old_de->file_type;
new_dir->i_version++;
- status = ocfs_journal_dirty(handle, new_de_bh);
+ status = ocfs2_journal_dirty(handle, new_de_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1257,23 +1239,23 @@
else
newfe->i_links_count--;
- status = ocfs_journal_dirty(handle, newfe_bh);
+ status = ocfs2_journal_dirty(handle, newfe_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
} else {
/* if the name was not found in new_dir, add it now */
- status = ocfs_add_entry(handle, new_dentry, old_inode,
- OCFS2_I(old_inode)->ip_blkno,
- new_dir_bh, insert_entry_bh);
+ status = ocfs2_add_entry(handle, new_dentry, old_inode,
+ OCFS2_I(old_inode)->ip_blkno,
+ new_dir_bh, insert_entry_bh);
}
old_inode->i_ctime = CURRENT_TIME;
mark_inode_dirty(old_inode);
/* now that the name has been added to new_dir, remove the old name */
- status = ocfs_delete_entry(handle, old_dir, old_de, old_de_bh);
+ status = ocfs2_delete_entry(handle, old_dir, old_de, old_de_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1285,12 +1267,12 @@
}
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
if (old_inode_de_bh) {
- status = ocfs_journal_access(handle, old_inode,
+ status = ocfs2_journal_access(handle, old_inode,
old_inode_de_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ OCFS2_JOURNAL_ACCESS_WRITE);
PARENT_INO(old_inode_de_bh->b_data) =
le64_to_cpu(OCFS2_I(new_dir)->ip_blkno);
- status = ocfs_journal_dirty(handle, old_inode_de_bh);
+ status = ocfs2_journal_dirty(handle, old_inode_de_bh);
old_dir->i_nlink--;
if (new_inode) {
new_inode->i_nlink--;
@@ -1307,44 +1289,43 @@
if (new_dir_nlink != new_dir->i_nlink) {
if (!new_dir_bh) {
mlog(ML_ERROR, "need to change nlink for new "
- "dir %"MLFu64" from %d to %d "
- "but bh is NULL\n",
- OCFS2_I(new_dir)->ip_blkno,
+ "dir %"MLFu64" from %d to %d but bh is "
+ "NULL\n", OCFS2_I(new_dir)->ip_blkno,
(int)new_dir_nlink, new_dir->i_nlink);
} else {
ocfs2_dinode *fe;
- status = ocfs_journal_access(handle,
- new_dir,
- new_dir_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle,
+ new_dir,
+ new_dir_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
fe = (ocfs2_dinode *) new_dir_bh->b_data;
fe->i_links_count = new_dir->i_nlink;
- status = ocfs_journal_dirty(handle, new_dir_bh);
+ status = ocfs2_journal_dirty(handle, new_dir_bh);
}
}
if (old_dir_nlink != old_dir->i_nlink) {
if (!old_dir_bh) {
mlog(ML_ERROR, "need to change nlink for old dir "
- "%"MLFu64" from %d to %d but bh is "
- "NULL!\n",
+ "%"MLFu64" from %d to %d but bh is NULL!\n",
OCFS2_I(old_dir)->ip_blkno,
(int)old_dir_nlink,
old_dir->i_nlink);
} else {
ocfs2_dinode *fe;
- status = ocfs_journal_access(handle, old_dir,
- old_dir_bh, OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, old_dir,
+ old_dir_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
fe = (ocfs2_dinode *) old_dir_bh->b_data;
fe->i_links_count = old_dir->i_nlink;
- status = ocfs_journal_dirty(handle, old_dir_bh);
+ status = ocfs2_journal_dirty(handle, old_dir_bh);
}
}
status = 0;
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (new_inode)
sync_mapping_buffers(old_inode->i_mapping);
@@ -1371,18 +1352,16 @@
mlog_exit(status);
return status;
-} /* ocfs_rename */
+}
/*
- * ocfs_create_symlink_data()
- *
* we expect i_size = strlen(symname). Copy symname into the file
* data, including the null terminator.
*/
-static int ocfs_create_symlink_data(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *inode,
- const char *symname)
+static int ocfs2_create_symlink_data(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ const char *symname)
{
struct buffer_head **bhs = NULL;
const char *c;
@@ -1400,7 +1379,8 @@
inode->i_blocks, i_size_read(inode), blocks);
/* Sanity check -- make sure we're going to fit. */
- if (bytes_left > ocfs2_clusters_to_bytes(sb, OCFS2_I(inode)->ip_clusters)) {
+ if (bytes_left >
+ ocfs2_clusters_to_bytes(sb, OCFS2_I(inode)->ip_clusters)) {
status = -EIO;
mlog_errno(status);
goto bail;
@@ -1444,8 +1424,8 @@
set_buffer_uptodate(bhs[virtual]);
ocfs2_set_bh_seqnum(inode, bhs[virtual]);
- status = ocfs_journal_access(handle, inode, bhs[virtual],
- OCFS_JOURNAL_ACCESS_CREATE);
+ status = ocfs2_journal_access(handle, inode, bhs[virtual],
+ OCFS2_JOURNAL_ACCESS_CREATE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1457,7 +1437,7 @@
(bytes_left > sb->s_blocksize) ? sb->s_blocksize :
bytes_left);
- status = ocfs_journal_dirty(handle, bhs[virtual]);
+ status = ocfs2_journal_dirty(handle, bhs[virtual]);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1480,18 +1460,15 @@
mlog_exit(status);
return status;
-} /* ocfs_create_symlink_data */
+}
-/*
- * ocfs_symlink()
- *
- */
-static int ocfs_symlink(struct inode *dir, struct dentry *dentry,
- const char *symname)
+static int ocfs2_symlink(struct inode *dir,
+ struct dentry *dentry,
+ const char *symname)
{
int status, l, credits;
u64 newsize;
- ocfs_super *osb = NULL;
+ ocfs2_super *osb = NULL;
struct inode *inode = NULL;
struct super_block *sb;
struct buffer_head *new_fe_bh = NULL;
@@ -1499,7 +1476,7 @@
struct buffer_head *parent_fe_bh = NULL;
ocfs2_dinode *fe = NULL;
ocfs2_dinode *dirfe;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
ocfs2_alloc_context *inode_ac = NULL;
ocfs2_alloc_context *data_ac = NULL;
@@ -1519,9 +1496,9 @@
goto bail;
}
- credits = ocfs_calc_symlink_credits(sb);
+ credits = ocfs2_calc_symlink_credits(sb);
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
@@ -1542,15 +1519,15 @@
goto bail;
}
- status = ocfs_prepare_dir_for_insert(osb, dir, parent_fe_bh,
- dentry->d_name.name,
- dentry->d_name.len, &de_bh);
+ status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh,
+ dentry->d_name.name,
+ dentry->d_name.len, &de_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_reserve_new_inode(osb, handle, &inode_ac);
+ status = ocfs2_reserve_new_inode(osb, handle, &inode_ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -1559,7 +1536,7 @@
/* don't reserve bitmap space for fast symlinks. */
if (l > ocfs2_fast_symlink_chars(sb)) {
- status = ocfs_reserve_clusters(osb, handle, 1, &data_ac);
+ status = ocfs2_reserve_clusters(osb, handle, 1, &data_ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -1567,17 +1544,17 @@
}
}
- handle = ocfs_start_trans(osb, handle, credits);
+ handle = ocfs2_start_trans(osb, handle, credits);
if (handle == NULL) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- status = ocfs_mknod_locked(osb, dir, dentry,
- S_IFLNK | S_IRWXUGO, 0,
- &new_fe_bh, parent_fe_bh, handle,
- inode, inode_ac);
+ status = ocfs2_mknod_locked(osb, dir, dentry,
+ S_IFLNK | S_IRWXUGO, 0,
+ &new_fe_bh, parent_fe_bh, handle,
+ inode, inode_ac);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1586,7 +1563,7 @@
fe = (ocfs2_dinode *) new_fe_bh->b_data;
OCFS2_I(inode)->ip_blkno = fe->i_blkno;
- if (ocfs_populate_inode(inode, fe, 1) < 0) {
+ if (ocfs2_populate_inode(inode, fe, 1) < 0) {
mlog(ML_ERROR, "populate inode failed! bh->b_blocknr=%llu, "
"i_blkno=%"MLFu64", i_ino=%lu\n",
(unsigned long long)new_fe_bh->b_blocknr,
@@ -1594,7 +1571,7 @@
BUG();
}
- ocfs_inode_set_new(osb, inode);
+ ocfs2_inode_set_new(osb, inode);
status = ocfs2_create_new_inode_locks(inode);
if (status < 0)
mlog_errno(status);
@@ -1602,9 +1579,9 @@
inode->i_rdev = 0;
newsize = l - 1;
if (l > ocfs2_fast_symlink_chars(sb)) {
- inode->i_op = &ocfs_symlink_inode_operations;
- status = ocfs_extend_allocation(osb, inode, 1, new_fe_bh,
- handle, data_ac, NULL, NULL);
+ inode->i_op = &ocfs2_symlink_inode_operations;
+ status = ocfs2_extend_allocation(osb, inode, 1, new_fe_bh,
+ handle, data_ac, NULL, NULL);
if (status < 0) {
if (status != -ENOSPC && status != -EINTR) {
mlog(ML_ERROR, "Failed to extend file to "
@@ -1618,28 +1595,29 @@
i_size_write(inode, newsize);
inode->i_blocks = ocfs2_align_bytes_to_sectors(newsize);
} else {
- inode->i_op = &ocfs_fast_symlink_inode_operations;
+ inode->i_op = &ocfs2_fast_symlink_inode_operations;
memcpy((char *) fe->id2.i_symlink, symname, l);
i_size_write(inode, newsize);
inode->i_blocks = 0;
}
- status = ocfs_mark_inode_dirty(handle, inode, new_fe_bh);
+ status = ocfs2_mark_inode_dirty(handle, inode, new_fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
if (!ocfs2_inode_is_fast_symlink(inode)) {
- status = ocfs_create_symlink_data(osb, handle, inode, symname);
+ status = ocfs2_create_symlink_data(osb, handle, inode,
+ symname);
if (status < 0) {
mlog_errno(status);
goto bail;
}
}
- status = ocfs_add_entry(handle, dentry, inode, fe->i_blkno,
- parent_fe_bh, de_bh);
+ status = ocfs2_add_entry(handle, dentry, inode, fe->i_blkno,
+ parent_fe_bh, de_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1649,7 +1627,7 @@
d_instantiate(dentry, inode);
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (new_fe_bh)
brelse(new_fe_bh);
if (parent_fe_bh)
@@ -1657,19 +1635,19 @@
if (de_bh)
brelse(de_bh);
if (inode_ac)
- ocfs_free_alloc_context(inode_ac);
+ ocfs2_free_alloc_context(inode_ac);
if (data_ac)
- ocfs_free_alloc_context(data_ac);
+ ocfs2_free_alloc_context(data_ac);
mlog_exit(status);
return status;
-} /* ocfs_symlink */
+}
-
-
-int ocfs_check_dir_entry(struct inode * dir, struct ocfs2_dir_entry * de,
- struct buffer_head * bh, unsigned long offset)
+int ocfs2_check_dir_entry(struct inode * dir,
+ struct ocfs2_dir_entry * de,
+ struct buffer_head * bh,
+ unsigned long offset)
{
const char *error_msg = NULL;
const int rlen = le16_to_cpu(de->rec_len);
@@ -1696,12 +1674,12 @@
*
* If you pass me insert_bh, I'll skip the search of the other dir
* blocks and put the record in there.
-*/
-static int __ocfs_add_entry(ocfs_journal_handle *handle, struct inode *dir,
- const char *name, int namelen,
- struct inode *inode, u64 blkno,
- struct buffer_head *parent_fe_bh,
- struct buffer_head *insert_bh)
+ */
+static int __ocfs2_add_entry(ocfs2_journal_handle *handle, struct inode *dir,
+ const char *name, int namelen,
+ struct inode *inode, u64 blkno,
+ struct buffer_head *parent_fe_bh,
+ struct buffer_head *insert_bh)
{
unsigned long offset;
unsigned short rec_len;
@@ -1710,7 +1688,7 @@
int retval, status;
mlog_entry_void();
- OCFS_ASSERT(insert_bh);
+ OCFS2_ASSERT(insert_bh);
sb = dir->i_sb;
@@ -1721,15 +1699,15 @@
offset = 0;
de = (struct ocfs2_dir_entry *) insert_bh->b_data;
while (1) {
- OCFS_ASSERT((char *)de < sb->s_blocksize + insert_bh->b_data);
+ OCFS2_ASSERT((char *)de < sb->s_blocksize + insert_bh->b_data);
/* These checks should've already been passed by the
* prepare function, but I guess we can leave them
* here anyway. */
- if (!ocfs_check_dir_entry(dir, de, insert_bh, offset)) {
+ if (!ocfs2_check_dir_entry(dir, de, insert_bh, offset)) {
retval = -ENOENT;
goto bail;
}
- if (ocfs_match(namelen, name, de)) {
+ if (ocfs2_match(namelen, name, de)) {
retval = -EEXIST;
goto bail;
}
@@ -1737,8 +1715,8 @@
(le16_to_cpu(de->rec_len) >= rec_len)) ||
(le16_to_cpu(de->rec_len) >=
(OCFS2_DIR_REC_LEN(de->name_len) + rec_len))) {
- status = ocfs_journal_access(handle, dir, insert_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, dir, insert_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
/* By now the buffer is marked for journaling */
offset += le16_to_cpu(de->rec_len);
if (le64_to_cpu(de->inode)) {
@@ -1761,7 +1739,7 @@
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
dir->i_version++;
- status = ocfs_journal_dirty(handle, insert_bh);
+ status = ocfs2_journal_dirty(handle, insert_bh);
retval = 0;
goto bail;
}
@@ -1780,12 +1758,13 @@
/*
- * ocfs_delete_entry deletes a directory entry by merging it with the
+ * ocfs2_delete_entry deletes a directory entry by merging it with the
* previous entry
*/
-static int ocfs_delete_entry(ocfs_journal_handle *handle, struct inode *dir,
- struct ocfs2_dir_entry *de_del,
- struct buffer_head *bh)
+static int ocfs2_delete_entry(ocfs2_journal_handle *handle,
+ struct inode *dir,
+ struct ocfs2_dir_entry *de_del,
+ struct buffer_head *bh)
{
struct ocfs2_dir_entry *de, *pde;
int i, status = -ENOENT;
@@ -1796,13 +1775,13 @@
pde = NULL;
de = (struct ocfs2_dir_entry *) bh->b_data;
while (i < bh->b_size) {
- if (!ocfs_check_dir_entry(dir, de, bh, i)) {
+ if (!ocfs2_check_dir_entry(dir, de, bh, i)) {
status = -EIO;
goto bail;
}
if (de == de_del) {
- status = ocfs_journal_access(handle, dir, bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, dir, bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
status = -EIO;
goto bail;
@@ -1814,7 +1793,7 @@
else
de->inode = 0;
dir->i_version++;
- status = ocfs_journal_dirty(handle, bh);
+ status = ocfs2_journal_dirty(handle, bh);
goto bail;
}
i += le16_to_cpu(de->rec_len);
@@ -1829,11 +1808,11 @@
/*
* Returns 0 if not found, -1 on failure, and 1 on success
*/
-static int inline search_dirblock(struct buffer_head *bh,
- struct inode *dir,
- const char *name, int namelen,
- unsigned long offset,
- struct ocfs2_dir_entry **res_dir)
+static int inline ocfs2_search_dirblock(struct buffer_head *bh,
+ struct inode *dir,
+ const char *name, int namelen,
+ unsigned long offset,
+ struct ocfs2_dir_entry **res_dir)
{
struct ocfs2_dir_entry *de;
char *dlimit, *de_buf;
@@ -1852,9 +1831,9 @@
de = (struct ocfs2_dir_entry *) de_buf;
if (de_buf + namelen <= dlimit &&
- ocfs_match(namelen, name, de)) {
+ ocfs2_match(namelen, name, de)) {
/* found a match - just to be sure, do a full check */
- if (!ocfs_check_dir_entry(dir, de, bh, offset)) {
+ if (!ocfs2_check_dir_entry(dir, de, bh, offset)) {
ret = -1;
goto bail;
}
@@ -1881,9 +1860,9 @@
-struct buffer_head *ocfs_find_entry(const char *name, int namelen,
- struct inode *dir,
- struct ocfs2_dir_entry **res_dir)
+struct buffer_head *ocfs2_find_entry(const char *name, int namelen,
+ struct inode *dir,
+ struct ocfs2_dir_entry **res_dir)
{
struct super_block *sb;
struct buffer_head *bh_use[NAMEI_RA_SIZE];
@@ -1928,7 +1907,7 @@
num++;
/* XXX: questionable readahead stuff here */
- bh = ocfs_bread(dir, b++, &err, 1);
+ bh = ocfs2_bread(dir, b++, &err, 1);
bh_use[ra_max] = bh;
#if 0 // ???
if (bh)
@@ -1944,8 +1923,9 @@
brelse(bh);
goto next;
}
- i = search_dirblock(bh, dir, name, namelen,
- block << sb->s_blocksize_bits, res_dir);
+ i = ocfs2_search_dirblock(bh, dir, name, namelen,
+ block << sb->s_blocksize_bits,
+ res_dir);
if (i == 1) {
OCFS2_I(dir)->ip_dir_start_lookup = block;
ret = bh;
@@ -1980,7 +1960,7 @@
return ret;
}
-static int ocfs_blkno_stringify(u64 blkno, char *name)
+static int ocfs2_blkno_stringify(u64 blkno, char *name)
{
int status, namelen;
@@ -2011,41 +1991,41 @@
return status;
}
-static int ocfs_prepare_orphan_dir(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *inode,
- char *name,
- struct buffer_head **de_bh)
+static int ocfs2_prepare_orphan_dir(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ char *name,
+ struct buffer_head **de_bh)
{
struct inode *orphan_dir_inode = NULL;
struct buffer_head *orphan_dir_bh = NULL;
int status = 0;
- status = ocfs_blkno_stringify(OCFS2_I(inode)->ip_blkno, name);
+ status = ocfs2_blkno_stringify(OCFS2_I(inode)->ip_blkno, name);
if (status < 0) {
mlog_errno(status);
goto leave;
}
- orphan_dir_inode = ocfs_get_system_file_inode(osb,
- ORPHAN_DIR_SYSTEM_INODE,
- osb->slot_num);
+ orphan_dir_inode = ocfs2_get_system_file_inode(osb,
+ ORPHAN_DIR_SYSTEM_INODE,
+ osb->slot_num);
if (!orphan_dir_inode) {
status = -ENOENT;
mlog_errno(status);
goto leave;
}
- ocfs_handle_add_inode(handle, orphan_dir_inode);
+ ocfs2_handle_add_inode(handle, orphan_dir_inode);
status = ocfs2_meta_lock(orphan_dir_inode, handle, &orphan_dir_bh, 1);
if (status < 0) {
mlog_errno(status);
goto leave;
}
- status = ocfs_prepare_dir_for_insert(osb, orphan_dir_inode,
- orphan_dir_bh, name,
- OCFS2_ORPHAN_NAMELEN, de_bh);
+ status = ocfs2_prepare_dir_for_insert(osb, orphan_dir_inode,
+ orphan_dir_bh, name,
+ OCFS2_ORPHAN_NAMELEN, de_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -2062,13 +2042,12 @@
return status;
}
-/*
- * ocfs_orphan_add()
- *
- */
-static int ocfs_orphan_add(ocfs_super *osb, ocfs_journal_handle *handle,
- struct inode *inode, ocfs2_dinode *fe,
- char *name, struct buffer_head *de_bh)
+static int ocfs2_orphan_add(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *inode,
+ ocfs2_dinode *fe,
+ char *name,
+ struct buffer_head *de_bh)
{
struct inode *orphan_dir_inode = NULL;
struct buffer_head *orphan_dir_bh = NULL;
@@ -2077,26 +2056,26 @@
mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino);
- orphan_dir_inode = ocfs_get_system_file_inode(osb,
- ORPHAN_DIR_SYSTEM_INODE,
- osb->slot_num);
+ orphan_dir_inode = ocfs2_get_system_file_inode(osb,
+ ORPHAN_DIR_SYSTEM_INODE,
+ osb->slot_num);
if (!orphan_dir_inode) {
status = -ENOENT;
mlog_errno(status);
goto leave;
}
- status = ocfs_read_block(osb,
- OCFS2_I(orphan_dir_inode)->ip_blkno,
- &orphan_dir_bh, OCFS_BH_CACHED,
- orphan_dir_inode);
+ status = ocfs2_read_block(osb,
+ OCFS2_I(orphan_dir_inode)->ip_blkno,
+ &orphan_dir_bh, OCFS2_BH_CACHED,
+ orphan_dir_inode);
if (status < 0) {
mlog_errno(status);
goto leave;
}
- status = ocfs_journal_access(handle, orphan_dir_inode, orphan_dir_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, orphan_dir_inode, orphan_dir_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -2109,17 +2088,17 @@
orphan_fe->i_links_count++;
orphan_dir_inode->i_nlink = orphan_fe->i_links_count;
- status = ocfs_journal_dirty(handle, orphan_dir_bh);
+ status = ocfs2_journal_dirty(handle, orphan_dir_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
}
- status = __ocfs_add_entry(handle, orphan_dir_inode, name,
- OCFS2_ORPHAN_NAMELEN, inode,
- OCFS2_I(inode)->ip_blkno,
- orphan_dir_bh,
- de_bh);
+ status = __ocfs2_add_entry(handle, orphan_dir_inode, name,
+ OCFS2_ORPHAN_NAMELEN, inode,
+ OCFS2_I(inode)->ip_blkno,
+ orphan_dir_bh,
+ de_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -2146,12 +2125,14 @@
mlog_exit(status);
return status;
-} /* ocfs_orphan_add */
+}
/* unlike orphan_add, we expect the orphan dir to already be locked here. */
-int ocfs_orphan_del(ocfs_super *osb, ocfs_journal_handle *handle,
- struct inode *orphan_dir_inode, struct inode *inode,
- struct buffer_head *orphan_dir_bh)
+int ocfs2_orphan_del(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *orphan_dir_inode,
+ struct inode *inode,
+ struct buffer_head *orphan_dir_bh)
{
char name[OCFS2_ORPHAN_NAMELEN + 1];
ocfs2_dinode *orphan_fe;
@@ -2161,7 +2142,7 @@
mlog_entry_void();
- status = ocfs_blkno_stringify(OCFS2_I(inode)->ip_blkno, name);
+ status = ocfs2_blkno_stringify(OCFS2_I(inode)->ip_blkno, name);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -2171,8 +2152,8 @@
name, OCFS2_I(orphan_dir_inode)->ip_blkno, OCFS2_ORPHAN_NAMELEN);
/* find it's spot in the orphan directory */
- target_de_bh = ocfs_find_entry(name, OCFS2_ORPHAN_NAMELEN,
- orphan_dir_inode, &target_de);
+ target_de_bh = ocfs2_find_entry(name, OCFS2_ORPHAN_NAMELEN,
+ orphan_dir_inode, &target_de);
if (!target_de_bh) {
status = -ENOENT;
mlog_errno(status);
@@ -2180,15 +2161,15 @@
}
/* remove it from the orphan directory */
- status = ocfs_delete_entry(handle, orphan_dir_inode, target_de,
- target_de_bh);
+ status = ocfs2_delete_entry(handle, orphan_dir_inode, target_de,
+ target_de_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
}
- status = ocfs_journal_access(handle,orphan_dir_inode, orphan_dir_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle,orphan_dir_inode, orphan_dir_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -2200,7 +2181,7 @@
orphan_fe->i_links_count--;
orphan_dir_inode->i_nlink = orphan_fe->i_links_count;
- status = ocfs_journal_dirty(handle, orphan_dir_bh);
+ status = ocfs2_journal_dirty(handle, orphan_dir_bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -2214,16 +2195,16 @@
return status;
}
-struct inode_operations ocfs_dir_iops = {
- .create = ocfs_create,
- .lookup = ocfs_lookup,
- .link = ocfs_link,
- .unlink = ocfs_unlink,
- .rmdir = ocfs_unlink,
- .symlink = ocfs_symlink,
- .mkdir = ocfs_mkdir,
- .mknod = ocfs_mknod,
- .rename = ocfs_rename,
- .setattr = ocfs_setattr,
- .getattr = ocfs_getattr,
+struct inode_operations ocfs2_dir_iops = {
+ .create = ocfs2_create,
+ .lookup = ocfs2_lookup,
+ .link = ocfs2_link,
+ .unlink = ocfs2_unlink,
+ .rmdir = ocfs2_unlink,
+ .symlink = ocfs2_symlink,
+ .mkdir = ocfs2_mkdir,
+ .mknod = ocfs2_mknod,
+ .rename = ocfs2_rename,
+ .setattr = ocfs2_setattr,
+ .getattr = ocfs2_getattr,
};
Modified: trunk/fs/ocfs2/namei.h
===================================================================
--- trunk/fs/ocfs2/namei.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/namei.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,18 +26,24 @@
#ifndef OCFS2_NAMEI_H
#define OCFS2_NAMEI_H
-extern struct inode_operations ocfs_dir_iops;
+extern struct inode_operations ocfs2_dir_iops;
-int ocfs_check_dir_entry (struct inode *dir,
- struct ocfs2_dir_entry *de,
- struct buffer_head *bh, unsigned long offset);
-struct buffer_head *ocfs_find_entry(const char *name, int namelen,
- struct inode *dir,
- struct ocfs2_dir_entry **res_dir);
-int ocfs_orphan_del(ocfs_super *osb, ocfs_journal_handle *handle,
- struct inode *orphan_dir_inode, struct inode *inode,
- struct buffer_head *orphan_dir_bh);
-static inline int ocfs_match (int len, const char * const name, struct ocfs2_dir_entry * de)
+int ocfs2_check_dir_entry (struct inode *dir,
+ struct ocfs2_dir_entry *de,
+ struct buffer_head *bh,
+ unsigned long offset);
+struct buffer_head *ocfs2_find_entry(const char *name,
+ int namelen,
+ struct inode *dir,
+ struct ocfs2_dir_entry **res_dir);
+int ocfs2_orphan_del(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ struct inode *orphan_dir_inode,
+ struct inode *inode,
+ struct buffer_head *orphan_dir_bh);
+static inline int ocfs2_match(int len,
+ const char * const name,
+ struct ocfs2_dir_entry *de)
{
if (len != de->name_len)
return 0;
Modified: trunk/fs/ocfs2/ocfs.h
===================================================================
--- trunk/fs/ocfs2/ocfs.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/ocfs.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -45,9 +45,9 @@
/* convenience macro */
-#define OCFS_ASSERT(cond) do { if (unlikely(!(cond))) BUG(); } while (0)
+#define OCFS2_ASSERT(cond) do { if (unlikely(!(cond))) BUG(); } while (0)
-#define OCFS_ASSERT_RO(x) \
+#define OCFS2_ASSERT_RO(x) \
do { \
if (unlikely(!(x))) { \
printk(KERN_ERR "This should make the filesystem remount RO\n"); \
@@ -56,7 +56,7 @@
} while (0)
-#define OCFS_MAX_OSB_ID 65536
+#define OCFS2_MAX_OSB_ID 65536
#define OCFS2_IS_VALID_DINODE(ptr) \
(!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE))
@@ -92,24 +92,24 @@
** Structures...
*/
-#define OCFS2_SB(sb) ((ocfs_super *)(sb)->s_fs_info)
+#define OCFS2_SB(sb) ((ocfs2_super *)(sb)->s_fs_info)
/* This totally sucks that we have to include these here
* FIXME: Make them seperately includable. */
#include "ocfs2_fs.h"
-typedef struct _ocfs_super ocfs_super;
+typedef struct _ocfs2_super ocfs2_super;
/* this limits us to 256 nodes
* if we need more, we can do a kmalloc for the map */
-#define OCFS_NODE_MAP_MAX_NODES 256
-typedef struct _ocfs_node_map
+#define OCFS2_NODE_MAP_MAX_NODES 256
+typedef struct _ocfs2_node_map
{
u16 num_nodes;
- unsigned long map[BITS_TO_LONGS(OCFS_NODE_MAP_MAX_NODES)];
-} ocfs_node_map;
+ unsigned long map[BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES)];
+} ocfs2_node_map;
-struct _ocfs_journal_handle;
+struct _ocfs2_journal_handle;
/* I hate our includes */
struct ocfs2_extent_map {
@@ -132,10 +132,10 @@
};
enum ocfs2_lock_type {
- OCFS_TYPE_META = 0,
- OCFS_TYPE_DATA,
- OCFS_TYPE_SUPER,
- OCFS_NUM_LOCK_TYPES
+ OCFS2_TYPE_META = 0,
+ OCFS2_TYPE_DATA,
+ OCFS2_TYPE_SUPER,
+ OCFS2_NUM_LOCK_TYPES
};
/* ocfs2_lock_res->l_flags flags. */
@@ -192,23 +192,23 @@
wait_queue_head_t l_event;
} ocfs2_lock_res;
-typedef enum _ocfs_vol_state
+typedef enum _ocfs2_vol_state
{
VOLUME_INIT = 0,
VOLUME_MOUNTED,
VOLUME_DISMOUNTED,
VOLUME_DISABLED
}
-ocfs_vol_state;
+ocfs2_vol_state;
-typedef struct _ocfs_alloc_stats
+typedef struct _ocfs2_alloc_stats
{
atomic_t moves;
atomic_t local_data;
atomic_t bitmap_data;
atomic_t bg_allocs;
atomic_t bg_extends;
-} ocfs_alloc_stats;
+} ocfs2_alloc_stats;
enum ocfs2_local_alloc_state
{
@@ -223,15 +223,15 @@
OCFS2_MOUNT_BARRIER = 1 << 1 /* Use block barriers */
};
-struct _ocfs_journal;
+struct _ocfs2_journal;
struct _ocfs2_slot_info;
/*
- * ocfs_super
+ * ocfs2_super
*
* A mounted volume is represented using the following structure.
*/
-struct _ocfs_super
+struct _ocfs2_super
{
u32 osb_id; /* id used by the proc interface */
struct task_struct *commit_task;
@@ -243,9 +243,9 @@
struct _ocfs2_slot_info *slot_info;
spinlock_t node_map_lock;
- ocfs_node_map mounted_map;
- ocfs_node_map recovery_map;
- ocfs_node_map umount_map;
+ ocfs2_node_map mounted_map;
+ ocfs2_node_map recovery_map;
+ ocfs2_node_map umount_map;
u32 num_clusters;
u64 root_blkno;
@@ -282,7 +282,7 @@
int disable_recovery;
wait_queue_head_t checkpoint_event;
atomic_t needs_checkpoint;
- struct _ocfs_journal *journal;
+ struct _ocfs2_journal *journal;
atomic_t clean_buffer_seq;
enum ocfs2_local_alloc_state local_alloc_state;
@@ -293,7 +293,7 @@
int dirty;
ocfs2_dinode *local_alloc_copy;
- ocfs_alloc_stats alloc_stats;
+ ocfs2_alloc_stats alloc_stats;
char dev_str[20]; /* "major,minor" of the device */
dlm_ctxt *dlm;
@@ -350,6 +350,6 @@
return (unsigned long)(blkno & (u64)ULONG_MAX);
}
-typedef struct _ocfs_journal_handle ocfs_journal_handle;
+typedef struct _ocfs2_journal_handle ocfs2_journal_handle;
#endif /* !OCFS_H */
Modified: trunk/fs/ocfs2/ocfs2_fs.h
===================================================================
--- trunk/fs/ocfs2/ocfs2_fs.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/ocfs2_fs.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -619,7 +619,7 @@
/*
* Global system inodes can only have one copy. Everything
- * after OCFS_LAST_GLOBAL_SYSTEM_INODE in the system inode
+ * after OCFS2_LAST_GLOBAL_SYSTEM_INODE in the system inode
* list has a copy per slot.
*/
if (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)
Modified: trunk/fs/ocfs2/proc.c
===================================================================
--- trunk/fs/ocfs2/proc.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/proc.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -46,52 +46,98 @@
static struct proc_dir_entry *ocfs2_proc_root_dir = NULL; /* points to /proc/fs/ocfs2 */
-static int ocfs_proc_version(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs_proc_nodenum(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs_proc_slotnum(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs_proc_nodename(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs2_proc_uuid(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs_proc_statistics(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs_proc_device(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs_proc_nodes(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs_proc_alloc_stat(char *page, char **start, off_t off, int count, int *eof, void *data);
-static int ocfs_proc_label(char *page, char **start, off_t off, int count, int *eof, void *data);
+static int ocfs2_proc_version(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_nodenum(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_slotnum(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_nodename(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_uuid(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_statistics(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_device(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_nodes(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_alloc_stat(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
+static int ocfs2_proc_label(char *page,
+ char **start,
+ off_t off,
+ int count,
+ int *eof,
+ void *data);
-typedef struct _ocfs_proc_list
+typedef struct _ocfs2_proc_list
{
char *name;
char *data;
int (*read_proc) (char *, char **, off_t, int, int *, void *);
write_proc_t *write_proc;
mode_t mode;
-} ocfs_proc_list;
+} ocfs2_proc_list;
-static ocfs_proc_list top_dir[] = {
- { "version", NULL, ocfs_proc_version, NULL, S_IFREG | S_IRUGO, },
- { "nodename", NULL, ocfs_proc_nodename, NULL, S_IFREG | S_IRUGO, },
+static ocfs2_proc_list top_dir[] = {
+ { "version", NULL, ocfs2_proc_version, NULL, S_IFREG | S_IRUGO, },
+ { "nodename", NULL, ocfs2_proc_nodename, NULL, S_IFREG | S_IRUGO, },
{ NULL }
};
-static ocfs_proc_list sub_dir[] = {
- { "nodenum", NULL, ocfs_proc_nodenum, NULL, S_IFREG | S_IRUGO, },
+static ocfs2_proc_list sub_dir[] = {
+ { "nodenum", NULL, ocfs2_proc_nodenum, NULL, S_IFREG | S_IRUGO, },
{ "uuid", NULL, ocfs2_proc_uuid, NULL, S_IFREG | S_IRUGO, },
- { "slotnum", NULL, ocfs_proc_slotnum, NULL, S_IFREG | S_IRUGO, },
- { "statistics", NULL, ocfs_proc_statistics, NULL, S_IFREG | S_IRUGO, },
- { "device", NULL, ocfs_proc_device, NULL, S_IFREG | S_IRUGO, },
- { "nodes", NULL, ocfs_proc_nodes, NULL, S_IFREG | S_IRUGO, },
- { "allocstat", NULL, ocfs_proc_alloc_stat, NULL, S_IFREG | S_IRUGO, },
- { "label", NULL, ocfs_proc_label, NULL, S_IFREG | S_IRUGO, },
+ { "slotnum", NULL, ocfs2_proc_slotnum, NULL, S_IFREG | S_IRUGO, },
+ { "statistics", NULL, ocfs2_proc_statistics, NULL, S_IFREG | S_IRUGO, },
+ { "device", NULL, ocfs2_proc_device, NULL, S_IFREG | S_IRUGO, },
+ { "nodes", NULL, ocfs2_proc_nodes, NULL, S_IFREG | S_IRUGO, },
+ { "allocstat", NULL, ocfs2_proc_alloc_stat, NULL, S_IFREG | S_IRUGO, },
+ { "label", NULL, ocfs2_proc_label, NULL, S_IFREG | S_IRUGO, },
{ NULL }
};
-/*
- * ocfs_proc_init()
- *
- */
-int ocfs_proc_init(void)
+int ocfs2_proc_init(void)
{
struct proc_dir_entry *parent = NULL;
- ocfs_proc_list *p;
+ ocfs2_proc_list *p;
struct proc_dir_entry* entry;
mlog_entry_void();
@@ -114,16 +160,12 @@
mlog_exit_void();
return 0;
-} /* ocfs_proc_init */
+}
-/*
- * ocfs_proc_deinit()
- *
- */
-void ocfs_proc_deinit(void)
+void ocfs2_proc_deinit(void)
{
struct proc_dir_entry *parent = ocfs2_proc_root_dir;
- ocfs_proc_list *p;
+ ocfs2_proc_list *p;
mlog_entry_void();
@@ -134,14 +176,10 @@
}
mlog_exit_void();
-} /* ocfs_proc_deinit */
+}
-/*
- * ocfs_proc_calc_metrics()
- *
- */
-static int ocfs_proc_calc_metrics(char *page, char **start, off_t off,
- int count, int *eof, int len)
+static int ocfs2_proc_calc_metrics(char *page, char **start, off_t off,
+ int count, int *eof, int len)
{
mlog_entry_void();
@@ -160,18 +198,14 @@
mlog_exit_void();
return len;
-} /* ocfs_proc_calc_metrics */
+}
-/*
- * ocfs_proc_alloc_stat()
- *
- */
-static int ocfs_proc_alloc_stat(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_alloc_stat(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len, ret;
char *la_state;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
mlog_entry_void();
@@ -198,19 +232,15 @@
len += sprintf(page + len, ALLOC_STATS_HDR, "Block Group Adds",
atomic_read(&osb->alloc_stats.bg_extends));
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
}
-/*
- * ocfs_proc_version()
- *
- */
-static int ocfs_proc_version(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_version(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len;
int ret;
@@ -218,58 +248,46 @@
mlog_entry_void();
len = ocfs2_str_version(page);
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs_proc_version */
+}
-/*
- * ocfs_proc_nodenum()
- *
- */
-static int ocfs_proc_nodenum(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_nodenum(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len;
int ret;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
mlog_entry_void();
len = sprintf(page, "%d\n", osb->node_num);
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs_proc_nodenum */
+}
-/*
- * ocfs_proc_slotnum()
- *
- */
-static int ocfs_proc_slotnum(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_slotnum(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len;
int ret;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
mlog_entry_void();
len = sprintf(page, "%d\n", osb->slot_num);
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs_proc_slotnum */
+}
-/*
- * ocfs_proc_nodename()
- *
- */
-static int ocfs_proc_nodename(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_nodename(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len;
int ret;
@@ -285,22 +303,18 @@
} else
len = sprintf(page, "(unknown)\n");
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs_proc_nodename */
+}
-/*
- * ocfs_proc_add_volume()
- *
- */
-void ocfs_proc_add_volume(ocfs_super * osb)
+void ocfs2_proc_add_volume(ocfs2_super * osb)
{
char newdir[20];
struct proc_dir_entry *parent = NULL;
struct proc_dir_entry* entry;
- ocfs_proc_list *p;
+ ocfs2_proc_list *p;
mlog_entry_void();
@@ -329,15 +343,11 @@
}
mlog_exit_void();
-} /* ocfs_proc_add_volume */
+}
-/*
- * ocfs_proc_remove_volume()
- *
- */
-void ocfs_proc_remove_volume(ocfs_super * osb)
+void ocfs2_proc_remove_volume(ocfs2_super * osb)
{
- ocfs_proc_list *p;
+ ocfs2_proc_list *p;
char dir[20];
mlog_entry_void();
@@ -352,37 +362,29 @@
}
mlog_exit_void();
-} /* ocfs_proc_remove_volume */
+}
-/*
- * ocfs2_proc_uuid()
- *
- */
static int ocfs2_proc_uuid(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
int len, ret;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
mlog_entry_void();
len = sprintf(page, "%s\n", osb->uuid_str);
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs2_proc_uuid */
+}
-/*
- * ocfs_proc_statistics()
- *
- */
-static int ocfs_proc_statistics(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_statistics(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len;
int ret = 0;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
mlog_entry_void();
@@ -396,77 +398,65 @@
ocfs2_clusters_to_bytes(osb->sb, osb->num_clusters),
atomic_read(&osb->journal->j_num_trans));
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs_proc_statistics */
+}
-/*
- * ocfs_proc_device()
- *
- */
-static int ocfs_proc_device(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_device(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len;
int ret;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
mlog_entry_void();
len = snprintf(page, sizeof(osb->dev_str), "%s\n", osb->dev_str);
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs_proc_device */
+}
-/*
- * ocfs_proc_nodes()
- *
- */
-static int ocfs_proc_nodes(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_nodes(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len = 0;
int i;
int ret;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
char mount;
mlog_entry_void();
if (osb) {
- for (i = 0; i < OCFS_NODE_MAP_MAX_NODES; i++) {
- mount = ocfs_node_map_test_bit(osb, &osb->mounted_map, i) ? 'M' : ' ';
+ for (i = 0; i < OCFS2_NODE_MAP_MAX_NODES; i++) {
+ mount = ocfs2_node_map_test_bit(osb, &osb->mounted_map, i) ? 'M' : ' ';
len += sprintf(page + len, "%2d %c\n", i, mount);
}
}
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs_proc_nodes */
+}
-/*
- * ocfs_proc_label()
- *
- */
-static int ocfs_proc_label(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+static int ocfs2_proc_label(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
int len;
int ret;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
mlog_entry_void();
len = sprintf(page, "%s\n", osb->vol_label);
- ret = ocfs_proc_calc_metrics(page, start, off, count, eof, len);
+ ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
mlog_exit(ret);
return ret;
-} /* ocfs_proc_label */
+}
Modified: trunk/fs/ocfs2/proc.h
===================================================================
--- trunk/fs/ocfs2/proc.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/proc.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,9 +26,9 @@
#ifndef OCFS2_PROC_H
#define OCFS2_PROC_H
-void ocfs_proc_add_volume(ocfs_super *osb);
-void ocfs_proc_deinit(void);
-int ocfs_proc_init(void);
-void ocfs_proc_remove_volume(ocfs_super *osb);
+void ocfs2_proc_add_volume(ocfs2_super *osb);
+void ocfs2_proc_deinit(void);
+int ocfs2_proc_init(void);
+void ocfs2_proc_remove_volume(ocfs2_super *osb);
#endif /* OCFS2_PROC_H */
Modified: trunk/fs/ocfs2/slot_map.c
===================================================================
--- trunk/fs/ocfs2/slot_map.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/slot_map.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -53,7 +53,7 @@
* nodes. Should be holding an EX on super block. assumes slot info is
* up to date. Note that we call this *after* we find a slot, so our
* own node should be set in the map too... */
-void ocfs2_populate_mounted_map(ocfs_super *osb)
+void ocfs2_populate_mounted_map(ocfs2_super *osb)
{
int i;
ocfs2_slot_info *si = osb->slot_info;
@@ -62,7 +62,7 @@
for (i = 0; i < si->si_size; i++)
if (si->si_global_node_nums[i] != OCFS2_INVALID_SLOT)
- ocfs_node_map_set_bit(osb, &osb->mounted_map,
+ ocfs2_node_map_set_bit(osb, &osb->mounted_map,
si->si_global_node_nums[i]);
spin_unlock(&si->si_lock);
@@ -87,7 +87,7 @@
/* post the our slot info stuff into it's destination bh and write it
* out. */
-int ocfs2_update_disk_slots(ocfs_super *osb,
+int ocfs2_update_disk_slots(ocfs2_super *osb,
ocfs2_slot_info *si)
{
int status, i;
@@ -98,7 +98,7 @@
disk_info[i] = cpu_to_le16(si->si_global_node_nums[i]);
spin_unlock(&si->si_lock);
- status = ocfs_write_block(osb, si->si_bh, si->si_inode);
+ status = ocfs2_write_block(osb, si->si_bh, si->si_inode);
if (status < 0)
mlog_errno(status);
@@ -151,9 +151,9 @@
s16 slot_num,
s16 node_num)
{
- OCFS_ASSERT(slot_num != OCFS2_INVALID_SLOT);
- OCFS_ASSERT(slot_num < si->si_num_slots);
- OCFS_ASSERT((node_num == O2NM_INVALID_NODE_NUM) ||
+ OCFS2_ASSERT(slot_num != OCFS2_INVALID_SLOT);
+ OCFS2_ASSERT(slot_num < si->si_num_slots);
+ OCFS2_ASSERT((node_num == O2NM_INVALID_NODE_NUM) ||
(node_num < O2NM_MAX_NODES));
si->si_global_node_nums[slot_num] = node_num;
@@ -167,7 +167,7 @@
spin_unlock(&si->si_lock);
}
-int ocfs2_init_slot_info(ocfs_super *osb)
+int ocfs2_init_slot_info(ocfs2_super *osb)
{
int status, i;
u64 blkno;
@@ -189,7 +189,7 @@
for(i = 0; i < si->si_num_slots; i++)
si->si_global_node_nums[i] = OCFS2_INVALID_SLOT;
- inode = ocfs_get_system_file_inode(osb, SLOT_MAP_SYSTEM_INODE, -1);
+ inode = ocfs2_get_system_file_inode(osb, SLOT_MAP_SYSTEM_INODE, -1);
if (!inode) {
status = -EINVAL;
mlog_errno(status);
@@ -202,7 +202,7 @@
goto bail;
}
- status = ocfs_read_block(osb, blkno, &bh, 0, inode);
+ status = ocfs2_read_block(osb, blkno, &bh, 0, inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -227,7 +227,7 @@
kfree(si);
}
-int ocfs2_find_slot(ocfs_super *osb)
+int ocfs2_find_slot(ocfs2_super *osb)
{
int status;
s16 slot;
@@ -274,7 +274,7 @@
return status;
}
-void ocfs2_put_slot(ocfs_super *osb)
+void ocfs2_put_slot(ocfs2_super *osb)
{
int status;
ocfs2_slot_info *si = osb->slot_info;
Modified: trunk/fs/ocfs2/slot_map.h
===================================================================
--- trunk/fs/ocfs2/slot_map.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/slot_map.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -37,14 +37,14 @@
s16 si_global_node_nums[OCFS2_MAX_SLOTS];
} ocfs2_slot_info;
-int ocfs2_init_slot_info(ocfs_super *osb);
+int ocfs2_init_slot_info(ocfs2_super *osb);
void ocfs2_free_slot_info(ocfs2_slot_info *si);
-int ocfs2_find_slot(ocfs_super *osb);
-void ocfs2_put_slot(ocfs_super *osb);
+int ocfs2_find_slot(ocfs2_super *osb);
+void ocfs2_put_slot(ocfs2_super *osb);
void ocfs2_update_slot_info(ocfs2_slot_info *si);
-int ocfs2_update_disk_slots(ocfs_super *osb,
+int ocfs2_update_disk_slots(ocfs2_super *osb,
ocfs2_slot_info *si);
s16 ocfs2_node_num_to_slot(ocfs2_slot_info *si,
@@ -52,7 +52,7 @@
void ocfs2_clear_slot(ocfs2_slot_info *si,
s16 slot_num);
-void ocfs2_populate_mounted_map(ocfs_super *osb);
+void ocfs2_populate_mounted_map(ocfs2_super *osb);
static inline int ocfs2_is_empty_slot(ocfs2_slot_info *si,
int slot_num)
Modified: trunk/fs/ocfs2/suballoc.c
===================================================================
--- trunk/fs/ocfs2/suballoc.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/suballoc.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -45,21 +45,21 @@
#include "buffer_head_io.h"
-static inline void debug_bg(ocfs2_group_desc *bg);
-static inline void debug_suballoc_inode(ocfs2_dinode *fe);
+static inline void ocfs2_debug_bg(ocfs2_group_desc *bg);
+static inline void ocfs2_debug_suballoc_inode(ocfs2_dinode *fe);
static inline u16 ocfs2_find_victim_chain(ocfs2_chain_list *cl);
-static int ocfs2_block_group_fill(ocfs_journal_handle *handle,
+static int ocfs2_block_group_fill(ocfs2_journal_handle *handle,
struct inode *alloc_inode,
struct buffer_head *bg_bh,
u64 group_blkno,
u16 my_chain,
ocfs2_chain_list *cl);
-static int ocfs_block_group_alloc(ocfs_super *osb,
- struct inode *alloc_inode,
- struct buffer_head *bh);
+static int ocfs2_block_group_alloc(ocfs2_super *osb,
+ struct inode *alloc_inode,
+ struct buffer_head *bh);
-static int ocfs_reserve_suballoc_bits(ocfs_super *osb,
- ocfs2_alloc_context *ac);
+static int ocfs2_reserve_suballoc_bits(ocfs2_super *osb,
+ ocfs2_alloc_context *ac);
static int ocfs2_cluster_group_search(struct inode *inode,
struct buffer_head *group_bh,
@@ -69,55 +69,55 @@
struct buffer_head *group_bh,
u32 bits_wanted, u32 min_bits,
u16 *bit_off, u16 *bits_found);
-static int ocfs_search_chain(ocfs2_alloc_context *ac,
- u32 bits_wanted,
- u32 min_bits,
- u16 *bit_off,
- unsigned int *num_bits,
- u64 *bg_blkno);
-static int ocfs_claim_suballoc_bits(ocfs_super *osb,
- ocfs2_alloc_context *ac,
- u32 bits_wanted,
- u32 min_bits,
- u16 *bit_off,
- unsigned int *num_bits,
- u64 *bg_blkno);
-static int ocfs_test_bg_bit_allocatable(struct buffer_head *bg_bh,
- int nr);
-static int ocfs_block_group_find_clear_bits(ocfs_super *osb,
- struct buffer_head *bg_bh,
- unsigned int bits_wanted,
- u16 *bit_off,
- u16 *bits_found);
-static inline int ocfs_block_group_set_bits(ocfs_journal_handle *handle,
- struct inode *alloc_inode,
- ocfs2_group_desc *bg,
- struct buffer_head *group_bh,
- unsigned int bit_off,
- unsigned int num_bits);
-static inline int ocfs_block_group_clear_bits(ocfs_journal_handle *handle,
- struct inode *alloc_inode,
- ocfs2_group_desc *bg,
- struct buffer_head *group_bh,
- unsigned int bit_off,
- unsigned int num_bits);
+static int ocfs2_search_chain(ocfs2_alloc_context *ac,
+ u32 bits_wanted,
+ u32 min_bits,
+ u16 *bit_off,
+ unsigned int *num_bits,
+ u64 *bg_blkno);
+static int ocfs2_claim_suballoc_bits(ocfs2_super *osb,
+ ocfs2_alloc_context *ac,
+ u32 bits_wanted,
+ u32 min_bits,
+ u16 *bit_off,
+ unsigned int *num_bits,
+ u64 *bg_blkno);
+static int ocfs2_test_bg_bit_allocatable(struct buffer_head *bg_bh,
+ int nr);
+static int ocfs2_block_group_find_clear_bits(ocfs2_super *osb,
+ struct buffer_head *bg_bh,
+ unsigned int bits_wanted,
+ u16 *bit_off,
+ u16 *bits_found);
+static inline int ocfs2_block_group_set_bits(ocfs2_journal_handle *handle,
+ struct inode *alloc_inode,
+ ocfs2_group_desc *bg,
+ struct buffer_head *group_bh,
+ unsigned int bit_off,
+ unsigned int num_bits);
+static inline int ocfs2_block_group_clear_bits(ocfs2_journal_handle *handle,
+ struct inode *alloc_inode,
+ ocfs2_group_desc *bg,
+ struct buffer_head *group_bh,
+ unsigned int bit_off,
+ unsigned int num_bits);
-static int ocfs_relink_block_group(ocfs_journal_handle *handle,
- struct inode *alloc_inode,
- struct buffer_head *fe_bh,
- struct buffer_head *bg_bh,
- struct buffer_head *prev_bg_bh,
- u16 chain);
-static inline int ocfs_block_group_reasonably_empty(ocfs2_group_desc *bg,
- u32 wanted);
-static int ocfs_free_suballoc_bits(ocfs_journal_handle *handle,
- struct inode *alloc_inode,
- struct buffer_head *alloc_bh,
- unsigned int start_bit,
- u64 bg_blkno,
- unsigned int count);
-static inline u64 ocfs_which_suballoc_group(u64 block,
- unsigned int bit);
+static int ocfs2_relink_block_group(ocfs2_journal_handle *handle,
+ struct inode *alloc_inode,
+ struct buffer_head *fe_bh,
+ struct buffer_head *bg_bh,
+ struct buffer_head *prev_bg_bh,
+ u16 chain);
+static inline int ocfs2_block_group_reasonably_empty(ocfs2_group_desc *bg,
+ u32 wanted);
+static int ocfs2_free_suballoc_bits(ocfs2_journal_handle *handle,
+ struct inode *alloc_inode,
+ struct buffer_head *alloc_bh,
+ unsigned int start_bit,
+ u64 bg_blkno,
+ unsigned int count);
+static inline u64 ocfs2_which_suballoc_group(u64 block,
+ unsigned int bit);
static inline u32 ocfs2_desc_bitmap_to_cluster_off(struct inode *inode,
u64 bg_blkno,
u16 bg_bit_off);
@@ -128,7 +128,7 @@
u64 *bg_blkno,
u16 *bg_bit_off);
-void ocfs_free_alloc_context(ocfs2_alloc_context *ac)
+void ocfs2_free_alloc_context(ocfs2_alloc_context *ac)
{
if (ac->ac_inode)
iput(ac->ac_inode);
@@ -137,7 +137,7 @@
kfree(ac);
}
-static int ocfs2_block_group_fill(ocfs_journal_handle *handle,
+static int ocfs2_block_group_fill(ocfs2_journal_handle *handle,
struct inode *alloc_inode,
struct buffer_head *bg_bh,
u64 group_blkno,
@@ -150,12 +150,12 @@
mlog_entry_void();
- OCFS_ASSERT(((unsigned long long) bg_bh->b_blocknr) == group_blkno);
+ OCFS2_ASSERT(((unsigned long long) bg_bh->b_blocknr) == group_blkno);
- status = ocfs_journal_access(handle,
- alloc_inode,
- bg_bh,
- OCFS_JOURNAL_ACCESS_CREATE);
+ status = ocfs2_journal_access(handle,
+ alloc_inode,
+ bg_bh,
+ OCFS2_JOURNAL_ACCESS_CREATE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -174,7 +174,7 @@
ocfs2_set_bit(0, (unsigned long *)bg->bg_bitmap);
bg->bg_free_bits_count = bg->bg_bits - 1;
- status = ocfs_journal_dirty(handle, bg_bh);
+ status = ocfs2_journal_dirty(handle, bg_bh);
if (status < 0)
mlog_errno(status);
@@ -204,26 +204,26 @@
/*
* We expect the block group allocator to already be locked.
*/
-static int ocfs_block_group_alloc(ocfs_super *osb,
- struct inode *alloc_inode,
- struct buffer_head *bh)
+static int ocfs2_block_group_alloc(ocfs2_super *osb,
+ struct inode *alloc_inode,
+ struct buffer_head *bh)
{
int status, credits;
ocfs2_dinode *fe = (ocfs2_dinode *) bh->b_data;
ocfs2_chain_list *cl;
ocfs2_alloc_context *ac = NULL;
- ocfs_journal_handle *handle = NULL;
+ ocfs2_journal_handle *handle = NULL;
u32 bit_off, num_bits, tmp;
u16 alloc_rec;
u64 bg_blkno;
struct buffer_head *bg_bh = NULL;
ocfs2_group_desc *bg;
- OCFS_ASSERT(!ocfs2_is_cluster_bitmap(alloc_inode));
+ OCFS2_ASSERT(!ocfs2_is_cluster_bitmap(alloc_inode));
mlog_entry_void();
- handle = ocfs_alloc_handle(osb);
+ handle = ocfs2_alloc_handle(osb);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
@@ -231,29 +231,29 @@
}
cl = &fe->id2.i_chain;
- status = ocfs_reserve_clusters(osb,
- handle,
- cl->cl_cpg,
- &ac);
+ status = ocfs2_reserve_clusters(osb,
+ handle,
+ cl->cl_cpg,
+ &ac);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- credits = ocfs_calc_group_alloc_credits(osb->sb, cl->cl_cpg);
- handle = ocfs_start_trans(osb, handle, credits);
+ credits = ocfs2_calc_group_alloc_credits(osb->sb, cl->cl_cpg);
+ handle = ocfs2_start_trans(osb, handle, credits);
if (!handle) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
- status = ocfs_claim_clusters(osb,
- handle,
- ac,
- cl->cl_cpg,
- &bit_off,
- &num_bits);
+ status = ocfs2_claim_clusters(osb,
+ handle,
+ ac,
+ cl->cl_cpg,
+ &bit_off,
+ &num_bits);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -289,8 +289,8 @@
bg = (ocfs2_group_desc *) bg_bh->b_data;
- status = ocfs_journal_access(handle, alloc_inode,
- bh, OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, alloc_inode,
+ bh, OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -312,7 +312,7 @@
fe->i_clusters += cl->cl_cpg;
- status = ocfs_journal_dirty(handle, bh);
+ status = ocfs2_journal_dirty(handle, bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -330,10 +330,10 @@
status = 0;
bail:
if (handle)
- ocfs_commit_trans(handle);
+ ocfs2_commit_trans(handle);
if (ac)
- ocfs_free_alloc_context(ac);
+ ocfs2_free_alloc_context(ac);
if (bg_bh)
brelse(bg_bh);
@@ -342,22 +342,22 @@
return status;
}
-static int ocfs_reserve_suballoc_bits(ocfs_super *osb,
- ocfs2_alloc_context *ac)
+static int ocfs2_reserve_suballoc_bits(ocfs2_super *osb,
+ ocfs2_alloc_context *ac)
{
int status;
u32 bits_wanted = ac->ac_bits_wanted;
struct inode *alloc_inode = ac->ac_inode;
struct buffer_head *bh = NULL;
- ocfs_journal_handle *handle = ac->ac_handle;
+ ocfs2_journal_handle *handle = ac->ac_handle;
ocfs2_dinode *fe;
u32 free_bits;
mlog_entry_void();
- OCFS_ASSERT(!(handle->flags & OCFS_HANDLE_STARTED));
+ OCFS2_ASSERT(!(handle->flags & OCFS2_HANDLE_STARTED));
- ocfs_handle_add_inode(handle, alloc_inode);
+ ocfs2_handle_add_inode(handle, alloc_inode);
status = ocfs2_meta_lock(alloc_inode, handle, &bh, 1);
if (status < 0) {
mlog_errno(status);
@@ -366,7 +366,7 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS_ASSERT_RO(fe->i_flags & OCFS2_CHAIN_FL);
+ OCFS2_ASSERT_RO(fe->i_flags & OCFS2_CHAIN_FL);
free_bits = le32_to_cpu(fe->id1.bitmap1.i_total) -
le32_to_cpu(fe->id1.bitmap1.i_used);
@@ -380,7 +380,7 @@
goto bail;
}
- status = ocfs_block_group_alloc(osb, alloc_inode, bh);
+ status = ocfs2_block_group_alloc(osb, alloc_inode, bh);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -389,7 +389,7 @@
atomic_inc(&osb->alloc_stats.bg_extends);
/* You should never ask for this much metadata */
- OCFS_ASSERT(bits_wanted <=
+ OCFS2_ASSERT(bits_wanted <=
(le32_to_cpu(fe->id1.bitmap1.i_total)
- le32_to_cpu(fe->id1.bitmap1.i_used)));
}
@@ -404,10 +404,10 @@
return status;
}
-int ocfs_reserve_new_metadata(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_dinode *fe,
- ocfs2_alloc_context **ac)
+int ocfs2_reserve_new_metadata(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_dinode *fe,
+ ocfs2_alloc_context **ac)
{
int status;
struct inode *alloc_inode = NULL;
@@ -421,12 +421,16 @@
memset(*ac, 0, sizeof(ocfs2_alloc_context));
(*ac)->ac_bits_wanted = ocfs2_extend_meta_needed(fe);
(*ac)->ac_handle = handle;
- (*ac)->ac_which = OCFS_AC_USE_META;
+ (*ac)->ac_which = OCFS2_AC_USE_META;
-#ifndef OCFS_USE_ALL_METADATA_SUBALLOCATORS
- alloc_inode = ocfs_get_system_file_inode(osb, EXTENT_ALLOC_SYSTEM_INODE, 0);
+#ifndef OCFS2_USE_ALL_METADATA_SUBALLOCATORS
+ alloc_inode = ocfs2_get_system_file_inode(osb,
+ EXTENT_ALLOC_SYSTEM_INODE,
+ 0);
#else
- alloc_inode = ocfs_get_system_file_inode(osb, EXTENT_ALLOC_SYSTEM_INODE, osb->slot_num);
+ alloc_inode = ocfs2_get_system_file_inode(osb,
+ EXTENT_ALLOC_SYSTEM_INODE,
+ osb->slot_num);
#endif
if (!alloc_inode) {
status = -ENOMEM;
@@ -437,7 +441,7 @@
(*ac)->ac_inode = igrab(alloc_inode);
(*ac)->ac_group_search = ocfs2_block_group_search;
- status = ocfs_reserve_suballoc_bits(osb, (*ac));
+ status = ocfs2_reserve_suballoc_bits(osb, (*ac));
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -447,7 +451,7 @@
status = 0;
bail:
if ((status < 0) && *ac) {
- ocfs_free_alloc_context(*ac);
+ ocfs2_free_alloc_context(*ac);
*ac = NULL;
}
@@ -458,9 +462,9 @@
return status;
}
-int ocfs_reserve_new_inode(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context **ac)
+int ocfs2_reserve_new_inode(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context **ac)
{
int status;
struct inode *alloc_inode = NULL;
@@ -474,9 +478,11 @@
memset(*ac, 0, sizeof(ocfs2_alloc_context));
(*ac)->ac_bits_wanted = 1;
(*ac)->ac_handle = handle;
- (*ac)->ac_which = OCFS_AC_USE_INODE;
+ (*ac)->ac_which = OCFS2_AC_USE_INODE;
- alloc_inode = ocfs_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE, osb->slot_num);
+ alloc_inode = ocfs2_get_system_file_inode(osb,
+ INODE_ALLOC_SYSTEM_INODE,
+ osb->slot_num);
if (!alloc_inode) {
status = -ENOMEM;
mlog_errno(status);
@@ -486,7 +492,7 @@
(*ac)->ac_inode = igrab(alloc_inode);
(*ac)->ac_group_search = &ocfs2_block_group_search;
- status = ocfs_reserve_suballoc_bits(osb, *ac);
+ status = ocfs2_reserve_suballoc_bits(osb, *ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -496,7 +502,7 @@
status = 0;
bail:
if ((status < 0) && *ac) {
- ocfs_free_alloc_context(*ac);
+ ocfs2_free_alloc_context(*ac);
*ac = NULL;
}
@@ -509,23 +515,23 @@
/* local alloc code has to do the same thing, so rather than do this
* twice.. */
-int ocfs_reserve_cluster_bitmap_bits(ocfs_super *osb,
- ocfs2_alloc_context *ac)
+int ocfs2_reserve_cluster_bitmap_bits(ocfs2_super *osb,
+ ocfs2_alloc_context *ac)
{
int status;
- ac->ac_inode = ocfs_get_system_file_inode(osb,
- GLOBAL_BITMAP_SYSTEM_INODE,
- -1);
+ ac->ac_inode = ocfs2_get_system_file_inode(osb,
+ GLOBAL_BITMAP_SYSTEM_INODE,
+ -1);
if (!ac->ac_inode) {
status = -EINVAL;
mlog(ML_ERROR, "Could not get bitmap inode!\n");
goto bail;
}
- ac->ac_which = OCFS_AC_USE_MAIN;
+ ac->ac_which = OCFS2_AC_USE_MAIN;
ac->ac_group_search = &ocfs2_cluster_group_search;
- status = ocfs_reserve_suballoc_bits(osb, ac);
+ status = ocfs2_reserve_suballoc_bits(osb, ac);
if (status < 0 && status != -ENOSPC)
mlog_errno(status);
bail:
@@ -535,16 +541,16 @@
/* Callers don't need to care which bitmap (local alloc or main) to
* use so we figure it out for them, but unfortunately this clutters
* things a bit. */
-int ocfs_reserve_clusters(ocfs_super *osb,
- ocfs_journal_handle *handle,
- u32 bits_wanted,
- ocfs2_alloc_context **ac)
+int ocfs2_reserve_clusters(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ u32 bits_wanted,
+ ocfs2_alloc_context **ac)
{
int status;
mlog_entry_void();
- OCFS_ASSERT(handle);
+ OCFS2_ASSERT(handle);
*ac = kmalloc(sizeof(ocfs2_alloc_context), GFP_KERNEL);
if (!(*ac)) {
@@ -557,11 +563,11 @@
(*ac)->ac_handle = handle;
status = -ENOSPC;
- if (ocfs_alloc_should_use_local(osb, bits_wanted)) {
- status = ocfs_reserve_local_alloc_bits(osb,
- handle,
- bits_wanted,
- *ac);
+ if (ocfs2_alloc_should_use_local(osb, bits_wanted)) {
+ status = ocfs2_reserve_local_alloc_bits(osb,
+ handle,
+ bits_wanted,
+ *ac);
if ((status < 0) && (status != -ENOSPC)) {
mlog_errno(status);
goto bail;
@@ -578,7 +584,7 @@
}
if (status == -ENOSPC) {
- status = ocfs_reserve_cluster_bitmap_bits(osb, *ac);
+ status = ocfs2_reserve_cluster_bitmap_bits(osb, *ac);
if (status < 0) {
if (status != -ENOSPC)
mlog_errno(status);
@@ -589,7 +595,7 @@
status = 0;
bail:
if ((status < 0) && *ac) {
- ocfs_free_alloc_context(*ac);
+ ocfs2_free_alloc_context(*ac);
*ac = NULL;
}
@@ -619,8 +625,8 @@
* allocations, as those bitmaps are seperate and undo access is never
* called on a metadata group descriptor.
*/
-static int ocfs_test_bg_bit_allocatable(struct buffer_head *bg_bh,
- int nr)
+static int ocfs2_test_bg_bit_allocatable(struct buffer_head *bg_bh,
+ int nr)
{
ocfs2_group_desc *bg = (ocfs2_group_desc *) bg_bh->b_data;
@@ -633,11 +639,11 @@
return !ocfs2_test_bit(nr, (unsigned long *)bg->bg_bitmap);
}
-static int ocfs_block_group_find_clear_bits(ocfs_super *osb,
- struct buffer_head *bg_bh,
- unsigned int bits_wanted,
- u16 *bit_off,
- u16 *bits_found)
+static int ocfs2_block_group_find_clear_bits(ocfs2_super *osb,
+ struct buffer_head *bg_bh,
+ unsigned int bits_wanted,
+ u16 *bit_off,
+ u16 *bits_found)
{
void *bitmap;
u16 best_offset, best_size;
@@ -655,7 +661,7 @@
if (offset == bg->bg_bits)
break;
- if (!ocfs_test_bg_bit_allocatable(bg_bh, offset)) {
+ if (!ocfs2_test_bg_bit_allocatable(bg_bh, offset)) {
/* We found a zero, but we can't use it as it
* hasn't been put to disk yet! */
found = 0;
@@ -692,38 +698,38 @@
} else {
status = -ENOSPC;
/* No error log here -- see the comment above
- * ocfs_test_bg_bit_allocatable */
+ * ocfs2_test_bg_bit_allocatable */
}
return status;
}
-static inline int ocfs_block_group_set_bits(ocfs_journal_handle *handle,
- struct inode *alloc_inode,
- ocfs2_group_desc *bg,
- struct buffer_head *group_bh,
- unsigned int bit_off,
- unsigned int num_bits)
+static inline int ocfs2_block_group_set_bits(ocfs2_journal_handle *handle,
+ struct inode *alloc_inode,
+ ocfs2_group_desc *bg,
+ struct buffer_head *group_bh,
+ unsigned int bit_off,
+ unsigned int num_bits)
{
int status;
void *bitmap = bg->bg_bitmap;
- int journal_type = OCFS_JOURNAL_ACCESS_WRITE;
+ int journal_type = OCFS2_JOURNAL_ACCESS_WRITE;
mlog_entry_void();
OCFS2_BUG_ON_INVALID_GROUP_DESC(bg);
- OCFS_ASSERT(bg->bg_free_bits_count >= num_bits);
+ OCFS2_ASSERT(bg->bg_free_bits_count >= num_bits);
mlog(0, "block_group_set_bits: off = %u, num = %u\n", bit_off,
num_bits);
if (ocfs2_is_cluster_bitmap(alloc_inode))
- journal_type = OCFS_JOURNAL_ACCESS_UNDO;
+ journal_type = OCFS2_JOURNAL_ACCESS_UNDO;
- status = ocfs_journal_access(handle,
- alloc_inode,
- group_bh,
- journal_type);
+ status = ocfs2_journal_access(handle,
+ alloc_inode,
+ group_bh,
+ journal_type);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -734,8 +740,8 @@
while(num_bits--)
ocfs2_set_bit(bit_off++, bitmap);
- status = ocfs_journal_dirty(handle,
- group_bh);
+ status = ocfs2_journal_dirty(handle,
+ group_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -751,7 +757,7 @@
{
u16 curr, best;
- OCFS_ASSERT(cl->cl_next_free_rec);
+ OCFS2_ASSERT(cl->cl_next_free_rec);
best = curr = 0;
while (curr < cl->cl_next_free_rec) {
@@ -760,16 +766,16 @@
curr++;
}
- OCFS_ASSERT(best < cl->cl_next_free_rec);
+ OCFS2_ASSERT(best < cl->cl_next_free_rec);
return best;
}
-static int ocfs_relink_block_group(ocfs_journal_handle *handle,
- struct inode *alloc_inode,
- struct buffer_head *fe_bh,
- struct buffer_head *bg_bh,
- struct buffer_head *prev_bg_bh,
- u16 chain)
+static int ocfs2_relink_block_group(ocfs2_journal_handle *handle,
+ struct inode *alloc_inode,
+ struct buffer_head *fe_bh,
+ struct buffer_head *bg_bh,
+ struct buffer_head *prev_bg_bh,
+ u16 chain)
{
int status;
/* there is a really tiny chance the journal calls could fail,
@@ -784,15 +790,15 @@
OCFS2_BUG_ON_INVALID_GROUP_DESC(prev_bg);
mlog(0, "In suballoc %"MLFu64", chain %u, move group %"MLFu64" to "
- "top, prev = %"MLFu64"\n",
+ "top, prev = %"MLFu64"\n",
fe->i_blkno, chain, bg->bg_blkno, prev_bg->bg_blkno);
fe_ptr = fe->id2.i_chain.cl_recs[chain].c_blkno;
bg_ptr = bg->bg_next_group;
prev_bg_ptr = prev_bg->bg_next_group;
- status = ocfs_journal_access(handle, alloc_inode, prev_bg_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, alloc_inode, prev_bg_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -800,14 +806,14 @@
prev_bg->bg_next_group = bg->bg_next_group;
- status = ocfs_journal_dirty(handle, prev_bg_bh);
+ status = ocfs2_journal_dirty(handle, prev_bg_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_journal_access(handle, alloc_inode, bg_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, alloc_inode, bg_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -815,14 +821,14 @@
bg->bg_next_group = fe->id2.i_chain.cl_recs[chain].c_blkno;
- status = ocfs_journal_dirty(handle, bg_bh);
+ status = ocfs2_journal_dirty(handle, bg_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_journal_access(handle, alloc_inode, fe_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, alloc_inode, fe_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -830,7 +836,7 @@
fe->id2.i_chain.cl_recs[chain].c_blkno = bg->bg_blkno;
- status = ocfs_journal_dirty(handle, fe_bh);
+ status = ocfs2_journal_dirty(handle, fe_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -848,8 +854,8 @@
return status;
}
-static inline int ocfs_block_group_reasonably_empty(ocfs2_group_desc *bg,
- u32 wanted)
+static inline int ocfs2_block_group_reasonably_empty(ocfs2_group_desc *bg,
+ u32 wanted)
{
return bg->bg_free_bits_count > wanted;
}
@@ -866,12 +872,12 @@
ocfs2_group_desc *bg = (ocfs2_group_desc *) group_bh->b_data;
u16 tmp_off, tmp_found;
- OCFS_ASSERT(ocfs2_is_cluster_bitmap(inode));
+ OCFS2_ASSERT(ocfs2_is_cluster_bitmap(inode));
if (bg->bg_free_bits_count) {
- ret = ocfs_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
- group_bh, bits_wanted,
- &tmp_off, &tmp_found);
+ ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
+ group_bh, bits_wanted,
+ &tmp_off, &tmp_found);
if (!ret) {
if (min_bits <= tmp_found) {
*bit_off = tmp_off;
@@ -892,29 +898,29 @@
int ret = -ENOSPC;
ocfs2_group_desc *bg = (ocfs2_group_desc *) group_bh->b_data;
- OCFS_ASSERT(min_bits == 1);
- OCFS_ASSERT(!ocfs2_is_cluster_bitmap(inode));
+ OCFS2_ASSERT(min_bits == 1);
+ OCFS2_ASSERT(!ocfs2_is_cluster_bitmap(inode));
if (bg->bg_free_bits_count)
- ret = ocfs_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
- group_bh, bits_wanted,
- bit_off, bits_found);
+ ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
+ group_bh, bits_wanted,
+ bit_off, bits_found);
return ret;
}
-static int ocfs_search_chain(ocfs2_alloc_context *ac,
- u32 bits_wanted,
- u32 min_bits,
- u16 *bit_off,
- unsigned int *num_bits,
- u64 *bg_blkno)
+static int ocfs2_search_chain(ocfs2_alloc_context *ac,
+ u32 bits_wanted,
+ u32 min_bits,
+ u16 *bit_off,
+ unsigned int *num_bits,
+ u64 *bg_blkno)
{
int status;
u16 chain, tmp_bits;
u32 tmp_used;
u64 next_group;
- ocfs_journal_handle *handle = ac->ac_handle;
+ ocfs2_journal_handle *handle = ac->ac_handle;
struct inode *alloc_inode = ac->ac_inode;
struct buffer_head *group_bh = NULL;
struct buffer_head *prev_group_bh = NULL;
@@ -926,9 +932,9 @@
mlog(0, "trying to alloc %u bits from chain %u, inode %"MLFu64"\n",
bits_wanted, chain, OCFS2_I(alloc_inode)->ip_blkno);
- status = ocfs_read_block(OCFS2_SB(alloc_inode->i_sb),
- cl->cl_recs[chain].c_blkno, &group_bh,
- OCFS_BH_CACHED, alloc_inode);
+ status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb),
+ cl->cl_recs[chain].c_blkno, &group_bh,
+ OCFS2_BH_CACHED, alloc_inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -952,9 +958,9 @@
next_group = bg->bg_next_group;
prev_group_bh = group_bh;
group_bh = NULL;
- status = ocfs_read_block(OCFS2_SB(alloc_inode->i_sb),
- next_group, &group_bh,
- OCFS_BH_CACHED, alloc_inode);
+ status = ocfs2_read_block(OCFS2_SB(alloc_inode->i_sb),
+ next_group, &group_bh,
+ OCFS2_BH_CACHED, alloc_inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -973,7 +979,7 @@
*num_bits = tmp_bits;
- OCFS_ASSERT(*num_bits);
+ OCFS2_ASSERT(*num_bits);
/*
* Keep track of previous block descriptor read. When
@@ -990,10 +996,10 @@
*/
if (ac->ac_allow_chain_relink &&
(prev_group_bh) &&
- (ocfs_block_group_reasonably_empty(bg, *num_bits))) {
- status = ocfs_relink_block_group(handle, alloc_inode,
- ac->ac_bh, group_bh,
- prev_group_bh, chain);
+ (ocfs2_block_group_reasonably_empty(bg, *num_bits))) {
+ status = ocfs2_relink_block_group(handle, alloc_inode,
+ ac->ac_bh, group_bh,
+ prev_group_bh, chain);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1002,10 +1008,10 @@
/* Ok, claim our bits now: set the info on dinode, chainlist
* and then the group */
- status = ocfs_journal_access(handle,
- alloc_inode,
- ac->ac_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle,
+ alloc_inode,
+ ac->ac_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1015,19 +1021,19 @@
fe->id1.bitmap1.i_used = cpu_to_le32(*num_bits + tmp_used);
cl->cl_recs[chain].c_free -= *num_bits;
- status = ocfs_journal_dirty(handle,
- ac->ac_bh);
+ status = ocfs2_journal_dirty(handle,
+ ac->ac_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_block_group_set_bits(handle,
- alloc_inode,
- bg,
- group_bh,
- *bit_off,
- *num_bits);
+ status = ocfs2_block_group_set_bits(handle,
+ alloc_inode,
+ bg,
+ group_bh,
+ *bit_off,
+ *num_bits);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1048,13 +1054,13 @@
}
/* will give out up to bits_wanted contiguous bits. */
-static int ocfs_claim_suballoc_bits(ocfs_super *osb,
- ocfs2_alloc_context *ac,
- u32 bits_wanted,
- u32 min_bits,
- u16 *bit_off,
- unsigned int *num_bits,
- u64 *bg_blkno)
+static int ocfs2_claim_suballoc_bits(ocfs2_super *osb,
+ ocfs2_alloc_context *ac,
+ u32 bits_wanted,
+ u32 min_bits,
+ u16 *bit_off,
+ unsigned int *num_bits,
+ u64 *bg_blkno)
{
int status;
u16 victim, i;
@@ -1063,13 +1069,13 @@
mlog_entry_void();
- OCFS_ASSERT(ac->ac_bits_given < ac->ac_bits_wanted);
- OCFS_ASSERT(bits_wanted <= (ac->ac_bits_wanted - ac->ac_bits_given));
- OCFS_ASSERT(ac->ac_bh);
+ OCFS2_ASSERT(ac->ac_bits_given < ac->ac_bits_wanted);
+ OCFS2_ASSERT(bits_wanted <= (ac->ac_bits_wanted - ac->ac_bits_given));
+ OCFS2_ASSERT(ac->ac_bh);
fe = (ocfs2_dinode *) ac->ac_bh->b_data;
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS_ASSERT_RO(le32_to_cpu(fe->id1.bitmap1.i_used) <
+ OCFS2_ASSERT_RO(le32_to_cpu(fe->id1.bitmap1.i_used) <
le32_to_cpu(fe->id1.bitmap1.i_total));
cl = (ocfs2_chain_list *) &fe->id2.i_chain;
@@ -1078,8 +1084,8 @@
ac->ac_chain = victim;
ac->ac_allow_chain_relink = 1;
- status = ocfs_search_chain(ac, bits_wanted, min_bits, bit_off,
- num_bits, bg_blkno);
+ status = ocfs2_search_chain(ac, bits_wanted, min_bits, bit_off,
+ num_bits, bg_blkno);
if (!status)
goto bail;
if (status < 0 && status != -ENOSPC) {
@@ -1102,9 +1108,9 @@
continue;
ac->ac_chain = i;
- status = ocfs_search_chain(ac, bits_wanted, min_bits,
- bit_off, num_bits,
- bg_blkno);
+ status = ocfs2_search_chain(ac, bits_wanted, min_bits,
+ bit_off, num_bits,
+ bg_blkno);
if (!status)
break;
if (status < 0 && status != -ENOSPC) {
@@ -1118,29 +1124,29 @@
return status;
}
-int ocfs_claim_metadata(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *ac,
- u32 bits_wanted,
- u16 *suballoc_bit_start,
- unsigned int *num_bits,
- u64 *blkno_start)
+int ocfs2_claim_metadata(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *ac,
+ u32 bits_wanted,
+ u16 *suballoc_bit_start,
+ unsigned int *num_bits,
+ u64 *blkno_start)
{
int status;
u64 bg_blkno;
- OCFS_ASSERT(ac);
- OCFS_ASSERT(ac->ac_bits_wanted >= (ac->ac_bits_given + bits_wanted));
- OCFS_ASSERT(ac->ac_which == OCFS_AC_USE_META);
- OCFS_ASSERT(ac->ac_handle == handle);
+ OCFS2_ASSERT(ac);
+ OCFS2_ASSERT(ac->ac_bits_wanted >= (ac->ac_bits_given + bits_wanted));
+ OCFS2_ASSERT(ac->ac_which == OCFS2_AC_USE_META);
+ OCFS2_ASSERT(ac->ac_handle == handle);
- status = ocfs_claim_suballoc_bits(osb,
- ac,
- bits_wanted,
- 1,
- suballoc_bit_start,
- num_bits,
- &bg_blkno);
+ status = ocfs2_claim_suballoc_bits(osb,
+ ac,
+ bits_wanted,
+ 1,
+ suballoc_bit_start,
+ num_bits,
+ &bg_blkno);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1155,11 +1161,11 @@
return status;
}
-int ocfs_claim_new_inode(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *ac,
- u16 *suballoc_bit,
- u64 *fe_blkno)
+int ocfs2_claim_new_inode(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *ac,
+ u16 *suballoc_bit,
+ u64 *fe_blkno)
{
int status;
unsigned int num_bits;
@@ -1167,26 +1173,26 @@
mlog_entry_void();
- OCFS_ASSERT(ac);
- OCFS_ASSERT(ac->ac_bits_given == 0);
- OCFS_ASSERT(ac->ac_bits_wanted == 1);
- OCFS_ASSERT(ac->ac_which == OCFS_AC_USE_INODE);
- OCFS_ASSERT(ac->ac_handle == handle);
+ OCFS2_ASSERT(ac);
+ OCFS2_ASSERT(ac->ac_bits_given == 0);
+ OCFS2_ASSERT(ac->ac_bits_wanted == 1);
+ OCFS2_ASSERT(ac->ac_which == OCFS2_AC_USE_INODE);
+ OCFS2_ASSERT(ac->ac_handle == handle);
- status = ocfs_claim_suballoc_bits(osb,
- ac,
- 1,
- 1,
- suballoc_bit,
- &num_bits,
- &bg_blkno);
+ status = ocfs2_claim_suballoc_bits(osb,
+ ac,
+ 1,
+ 1,
+ suballoc_bit,
+ &num_bits,
+ &bg_blkno);
if (status < 0) {
mlog_errno(status);
goto bail;
}
atomic_inc(&osb->alloc_stats.bg_allocs);
- OCFS_ASSERT(num_bits == 1);
+ OCFS2_ASSERT(num_bits == 1);
*fe_blkno = bg_blkno + (u64) (*suballoc_bit);
ac->ac_bits_given++;
@@ -1202,10 +1208,10 @@
u64 bg_blkno,
u16 bg_bit_off)
{
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
u32 cluster = 0;
- OCFS_ASSERT(ocfs2_is_cluster_bitmap(inode));
+ OCFS2_ASSERT(ocfs2_is_cluster_bitmap(inode));
if (bg_blkno != osb->first_cluster_group_blkno)
cluster = ocfs2_blocks_to_clusters(inode->i_sb, bg_blkno);
@@ -1218,10 +1224,10 @@
static inline u64 ocfs2_which_cluster_group(struct inode *inode,
u32 cluster)
{
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
u32 group_no;
- OCFS_ASSERT(ocfs2_is_cluster_bitmap(inode));
+ OCFS2_ASSERT(ocfs2_is_cluster_bitmap(inode));
group_no = cluster / osb->bitmap_cpg;
if (!group_no)
@@ -1237,10 +1243,10 @@
u64 *bg_blkno,
u16 *bg_bit_off)
{
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
u32 data_cluster = ocfs2_blocks_to_clusters(osb->sb, data_blkno);
- OCFS_ASSERT(ocfs2_is_cluster_bitmap(inode));
+ OCFS2_ASSERT(ocfs2_is_cluster_bitmap(inode));
*bg_blkno = ocfs2_which_cluster_group(inode,
data_cluster);
@@ -1258,12 +1264,12 @@
* contig. allocation, set to '1' to indicate we can deal with extents
* of any size.
*/
-int ocfs_claim_clusters(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *ac,
- u32 min_clusters,
- u32 *cluster_start,
- u32 *num_clusters)
+int ocfs2_claim_clusters(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *ac,
+ u32 min_clusters,
+ u32 *cluster_start,
+ u32 *num_clusters)
{
int status;
unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given;
@@ -1272,20 +1278,20 @@
mlog_entry_void();
- OCFS_ASSERT(ac);
- OCFS_ASSERT(ac->ac_bits_given < ac->ac_bits_wanted);
+ OCFS2_ASSERT(ac);
+ OCFS2_ASSERT(ac->ac_bits_given < ac->ac_bits_wanted);
- OCFS_ASSERT(ac->ac_which == OCFS_AC_USE_LOCAL
- || ac->ac_which == OCFS_AC_USE_MAIN);
- OCFS_ASSERT(ac->ac_handle == handle);
+ OCFS2_ASSERT(ac->ac_which == OCFS2_AC_USE_LOCAL
+ || ac->ac_which == OCFS2_AC_USE_MAIN);
+ OCFS2_ASSERT(ac->ac_handle == handle);
- if (ac->ac_which == OCFS_AC_USE_LOCAL) {
- status = ocfs_claim_local_alloc_bits(osb,
- handle,
- ac,
- bits_wanted,
- cluster_start,
- num_clusters);
+ if (ac->ac_which == OCFS2_AC_USE_LOCAL) {
+ status = ocfs2_claim_local_alloc_bits(osb,
+ handle,
+ ac,
+ bits_wanted,
+ cluster_start,
+ num_clusters);
if (!status)
atomic_inc(&osb->alloc_stats.local_data);
} else {
@@ -1301,13 +1307,13 @@
if (bits_wanted > (osb->bitmap_cpg - 1))
bits_wanted = osb->bitmap_cpg - 1;
- status = ocfs_claim_suballoc_bits(osb,
- ac,
- bits_wanted,
- min_clusters,
- &bg_bit_off,
- num_clusters,
- &bg_blkno);
+ status = ocfs2_claim_suballoc_bits(osb,
+ ac,
+ bits_wanted,
+ min_clusters,
+ &bg_bit_off,
+ num_clusters,
+ &bg_blkno);
if (!status) {
*cluster_start =
ocfs2_desc_bitmap_to_cluster_off(ac->ac_inode,
@@ -1329,16 +1335,16 @@
return status;
}
-static inline int ocfs_block_group_clear_bits(ocfs_journal_handle *handle,
- struct inode *alloc_inode,
- ocfs2_group_desc *bg,
- struct buffer_head *group_bh,
- unsigned int bit_off,
- unsigned int num_bits)
+static inline int ocfs2_block_group_clear_bits(ocfs2_journal_handle *handle,
+ struct inode *alloc_inode,
+ ocfs2_group_desc *bg,
+ struct buffer_head *group_bh,
+ unsigned int bit_off,
+ unsigned int num_bits)
{
int status;
unsigned int tmp;
- int journal_type = OCFS_JOURNAL_ACCESS_WRITE;
+ int journal_type = OCFS2_JOURNAL_ACCESS_WRITE;
ocfs2_group_desc *undo_bg = NULL;
mlog_entry_void();
@@ -1348,10 +1354,10 @@
mlog(0, "off = %u, num = %u\n", bit_off, num_bits);
if (ocfs2_is_cluster_bitmap(alloc_inode))
- journal_type = OCFS_JOURNAL_ACCESS_UNDO;
+ journal_type = OCFS2_JOURNAL_ACCESS_UNDO;
- status = ocfs_journal_access(handle, alloc_inode, group_bh,
- journal_type);
+ status = ocfs2_journal_access(handle, alloc_inode, group_bh,
+ journal_type);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1370,7 +1376,7 @@
}
bg->bg_free_bits_count += num_bits;
- status = ocfs_journal_dirty(handle, group_bh);
+ status = ocfs2_journal_dirty(handle, group_bh);
if (status < 0)
mlog_errno(status);
bail:
@@ -1380,16 +1386,16 @@
/*
* expects the suballoc inode to already be locked.
*/
-static int ocfs_free_suballoc_bits(ocfs_journal_handle *handle,
- struct inode *alloc_inode,
- struct buffer_head *alloc_bh,
- unsigned int start_bit,
- u64 bg_blkno,
- unsigned int count)
+static int ocfs2_free_suballoc_bits(ocfs2_journal_handle *handle,
+ struct inode *alloc_inode,
+ struct buffer_head *alloc_bh,
+ unsigned int start_bit,
+ u64 bg_blkno,
+ unsigned int count)
{
int status = 0;
u32 tmp_used;
- ocfs_super *osb = OCFS2_SB(alloc_inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(alloc_inode->i_sb);
ocfs2_dinode *fe = (ocfs2_dinode *) alloc_bh->b_data;
ocfs2_chain_list *cl = &fe->id2.i_chain;
struct buffer_head *group_bh = NULL;
@@ -1398,16 +1404,16 @@
mlog_entry_void();
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS_ASSERT((count + start_bit)
+ OCFS2_ASSERT((count + start_bit)
<= ((u32) cl->cl_cpg * (u32) cl->cl_bpc));
mlog(0, "suballocator %"MLFu64": freeing %u bits from group %"MLFu64
", starting at %u\n",
OCFS2_I(alloc_inode)->ip_blkno, count, bg_blkno,
start_bit);
-
- status = ocfs_read_block(osb, bg_blkno, &group_bh, OCFS_BH_CACHED,
- alloc_inode);
+
+ status = ocfs2_read_block(osb, bg_blkno, &group_bh, OCFS2_BH_CACHED,
+ alloc_inode);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1415,18 +1421,18 @@
group = (ocfs2_group_desc *) group_bh->b_data;
OCFS2_BUG_ON_INVALID_GROUP_DESC(group);
- OCFS_ASSERT((count + start_bit) <= group->bg_bits);
+ OCFS2_ASSERT((count + start_bit) <= group->bg_bits);
- status = ocfs_block_group_clear_bits(handle, alloc_inode,
- group, group_bh,
- start_bit, count);
+ status = ocfs2_block_group_clear_bits(handle, alloc_inode,
+ group, group_bh,
+ start_bit, count);
if (status < 0) {
mlog_errno(status);
goto bail;
}
- status = ocfs_journal_access(handle, alloc_inode, alloc_bh,
- OCFS_JOURNAL_ACCESS_WRITE);
+ status = ocfs2_journal_access(handle, alloc_inode, alloc_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1436,7 +1442,7 @@
tmp_used = le32_to_cpu(fe->id1.bitmap1.i_used);
fe->id1.bitmap1.i_used = cpu_to_le32(tmp_used - count);
- status = ocfs_journal_dirty(handle, alloc_bh);
+ status = ocfs2_journal_dirty(handle, alloc_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1450,40 +1456,40 @@
return status;
}
-static inline u64 ocfs_which_suballoc_group(u64 block, unsigned int bit)
+static inline u64 ocfs2_which_suballoc_group(u64 block, unsigned int bit)
{
u64 group = block - (u64) bit;
return group;
}
-int ocfs2_free_dinode(ocfs_journal_handle *handle,
+int ocfs2_free_dinode(ocfs2_journal_handle *handle,
struct inode *inode_alloc_inode,
struct buffer_head *inode_alloc_bh,
ocfs2_dinode *di)
{
u64 blk = di->i_blkno;
u16 bit = le16_to_cpu(di->i_suballoc_bit);
- u64 bg_blkno = ocfs_which_suballoc_group(blk, bit);
+ u64 bg_blkno = ocfs2_which_suballoc_group(blk, bit);
- return ocfs_free_suballoc_bits(handle, inode_alloc_inode,
- inode_alloc_bh, bit, bg_blkno, 1);
+ return ocfs2_free_suballoc_bits(handle, inode_alloc_inode,
+ inode_alloc_bh, bit, bg_blkno, 1);
}
-int ocfs2_free_extent_block(ocfs_journal_handle *handle,
+int ocfs2_free_extent_block(ocfs2_journal_handle *handle,
struct inode *eb_alloc_inode,
struct buffer_head *eb_alloc_bh,
ocfs2_extent_block *eb)
{
u64 blk = le64_to_cpu(eb->h_blkno);
u16 bit = le16_to_cpu(eb->h_suballoc_bit);
- u64 bg_blkno = ocfs_which_suballoc_group(blk, bit);
+ u64 bg_blkno = ocfs2_which_suballoc_group(blk, bit);
- return ocfs_free_suballoc_bits(handle, eb_alloc_inode, eb_alloc_bh,
- bit, bg_blkno, 1);
+ return ocfs2_free_suballoc_bits(handle, eb_alloc_inode, eb_alloc_bh,
+ bit, bg_blkno, 1);
}
-int ocfs_free_clusters(ocfs_journal_handle *handle,
+int ocfs2_free_clusters(ocfs2_journal_handle *handle,
struct inode *bitmap_inode,
struct buffer_head *bitmap_bh,
u64 start_blk,
@@ -1514,9 +1520,9 @@
mlog(0, "bg_blkno = %"MLFu64", bg_start_bit = %u\n",
bg_blkno, bg_start_bit);
- status = ocfs_free_suballoc_bits(handle, bitmap_inode, bitmap_bh,
- bg_start_bit, bg_blkno,
- num_clusters);
+ status = ocfs2_free_suballoc_bits(handle, bitmap_inode, bitmap_bh,
+ bg_start_bit, bg_blkno,
+ num_clusters);
if (status < 0)
mlog_errno(status);
@@ -1524,7 +1530,7 @@
return status;
}
-static inline void debug_bg(ocfs2_group_desc *bg)
+static inline void ocfs2_debug_bg(ocfs2_group_desc *bg)
{
printk("Block Group:\n");
printk("bg_signature: %s\n", bg->bg_signature);
@@ -1538,7 +1544,7 @@
printk("bg_blkno: %"MLFu64"\n", bg->bg_blkno);
}
-static inline void debug_suballoc_inode(ocfs2_dinode *fe)
+static inline void ocfs2_debug_suballoc_inode(ocfs2_dinode *fe)
{
int i;
Modified: trunk/fs/ocfs2/suballoc.h
===================================================================
--- trunk/fs/ocfs2/suballoc.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/suballoc.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -38,12 +38,12 @@
struct buffer_head *ac_bh; /* file entry bh */
u32 ac_bits_wanted;
u32 ac_bits_given;
-#define OCFS_AC_USE_LOCAL 1
-#define OCFS_AC_USE_MAIN 2
-#define OCFS_AC_USE_INODE 3
-#define OCFS_AC_USE_META 4
+#define OCFS2_AC_USE_LOCAL 1
+#define OCFS2_AC_USE_MAIN 2
+#define OCFS2_AC_USE_INODE 3
+#define OCFS2_AC_USE_META 4
u32 ac_which;
- ocfs_journal_handle *ac_handle;
+ ocfs2_journal_handle *ac_handle;
/* these are used by the chain search */
u16 ac_chain;
@@ -51,58 +51,58 @@
group_search_t *ac_group_search;
} ocfs2_alloc_context;
-void ocfs_free_alloc_context(ocfs2_alloc_context *ac);
-static inline int ocfs_alloc_context_bits_left(ocfs2_alloc_context *ac)
+void ocfs2_free_alloc_context(ocfs2_alloc_context *ac);
+static inline int ocfs2_alloc_context_bits_left(ocfs2_alloc_context *ac)
{
return ac->ac_bits_wanted - ac->ac_bits_given;
}
-int ocfs_reserve_new_metadata(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_dinode *fe,
- ocfs2_alloc_context **ac);
-int ocfs_reserve_new_inode(ocfs_super *osb,
- ocfs_journal_handle *handle,
+int ocfs2_reserve_new_metadata(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_dinode *fe,
+ ocfs2_alloc_context **ac);
+int ocfs2_reserve_new_inode(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context **ac);
+int ocfs2_reserve_clusters(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ u32 bits_wanted,
ocfs2_alloc_context **ac);
-int ocfs_reserve_clusters(ocfs_super *osb,
- ocfs_journal_handle *handle,
- u32 bits_wanted,
- ocfs2_alloc_context **ac);
-int ocfs_claim_metadata(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *ac,
- u32 bits_wanted,
- u16 *suballoc_bit_start,
- u32 *num_bits,
- u64 *blkno_start);
-int ocfs_claim_new_inode(ocfs_super *osb,
- ocfs_journal_handle *handle,
+int ocfs2_claim_metadata(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
ocfs2_alloc_context *ac,
- u16 *suballoc_bit,
- u64 *fe_blkno);
-int ocfs_claim_clusters(ocfs_super *osb,
- ocfs_journal_handle *handle,
- ocfs2_alloc_context *ac,
- u32 min_clusters,
- u32 *cluster_start,
- u32 *num_clusters);
+ u32 bits_wanted,
+ u16 *suballoc_bit_start,
+ u32 *num_bits,
+ u64 *blkno_start);
+int ocfs2_claim_new_inode(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *ac,
+ u16 *suballoc_bit,
+ u64 *fe_blkno);
+int ocfs2_claim_clusters(ocfs2_super *osb,
+ ocfs2_journal_handle *handle,
+ ocfs2_alloc_context *ac,
+ u32 min_clusters,
+ u32 *cluster_start,
+ u32 *num_clusters);
-int ocfs2_free_dinode(ocfs_journal_handle *handle,
+int ocfs2_free_dinode(ocfs2_journal_handle *handle,
struct inode *inode_alloc_inode,
struct buffer_head *inode_alloc_bh,
ocfs2_dinode *di);
-int ocfs2_free_extent_block(ocfs_journal_handle *handle,
+int ocfs2_free_extent_block(ocfs2_journal_handle *handle,
struct inode *eb_alloc_inode,
struct buffer_head *eb_alloc_bh,
ocfs2_extent_block *eb);
-int ocfs_free_clusters(ocfs_journal_handle *handle,
- struct inode *bitmap_inode,
- struct buffer_head *bitmap_bh,
- u64 start_blk,
- unsigned int num_clusters);
+int ocfs2_free_clusters(ocfs2_journal_handle *handle,
+ struct inode *bitmap_inode,
+ struct buffer_head *bitmap_bh,
+ u64 start_blk,
+ unsigned int num_clusters);
-static inline u32 ocfs2_cluster_from_desc(ocfs_super *osb,
+static inline u32 ocfs2_cluster_from_desc(ocfs2_super *osb,
u64 bg_blkno)
{
/* This should work for all block group descriptors as only
@@ -120,13 +120,13 @@
static inline int ocfs2_is_cluster_bitmap(struct inode *inode)
{
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
return osb->bitmap_blkno == OCFS2_I(inode)->ip_blkno;
}
/* This is for local alloc ONLY. Others should use the task-specific
* apis above. */
-int ocfs_reserve_cluster_bitmap_bits(ocfs_super *osb,
- ocfs2_alloc_context *ac);
+int ocfs2_reserve_cluster_bitmap_bits(ocfs2_super *osb,
+ ocfs2_alloc_context *ac);
#endif /* _CHAINALLOC_H_ */
Modified: trunk/fs/ocfs2/super.c
===================================================================
--- trunk/fs/ocfs2/super.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/super.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -80,46 +80,50 @@
MODULE_LICENSE("GPL");
static int ocfs2_parse_options(char *options, unsigned long *mount_opt);
-static void ocfs_put_super(struct super_block *sb);
-static int ocfs_mount_volume(struct super_block *sb, unsigned long mount_opt);
-static void ocfs_dismount_volume(struct super_block *sb, int mnt_err);
-static int ocfs_initialize_mem_caches(void);
-static void ocfs_free_mem_caches(void);
-static void ocfs_delete_osb(ocfs_super *osb);
+static void ocfs2_put_super(struct super_block *sb);
+static int ocfs2_mount_volume(struct super_block *sb, unsigned long mount_opt);
+static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err);
+static int ocfs2_initialize_mem_caches(void);
+static void ocfs2_free_mem_caches(void);
+static void ocfs2_delete_osb(ocfs2_super *osb);
-static int ocfs_statfs(struct super_block *sb, struct kstatfs *buf);
+static int ocfs2_statfs(struct super_block *sb, struct kstatfs *buf);
static int ocfs2_sync_fs(struct super_block *sb, int wait);
-static int ocfs_init_global_system_inodes(ocfs_super *osb);
-static int ocfs_init_local_system_inodes(ocfs_super *osb);
-static int ocfs_release_system_inodes(ocfs_super *osb);
-static int ocfs2_fill_local_node_info(ocfs_super *osb);
-static int ocfs_check_volume(ocfs_super *osb);
-static int ocfs_verify_volume(ocfs2_dinode *di, struct buffer_head *bh,
- u32 sectsize);
-static int ocfs_initialize_osb(ocfs_super *osb, struct buffer_head *bh);
-static int ocfs2_get_sector(struct super_block *sb, struct buffer_head **bh, int block, int sect_size);
-static void ocfs_write_super(struct super_block *sb);
+static int ocfs2_init_global_system_inodes(ocfs2_super *osb);
+static int ocfs2_init_local_system_inodes(ocfs2_super *osb);
+static int ocfs2_release_system_inodes(ocfs2_super *osb);
+static int ocfs2_fill_local_node_info(ocfs2_super *osb);
+static int ocfs2_check_volume(ocfs2_super *osb);
+static int ocfs2_verify_volume(ocfs2_dinode *di,
+ struct buffer_head *bh,
+ u32 sectsize);
+static int ocfs2_initialize_osb(ocfs2_super *osb, struct buffer_head *bh);
+static int ocfs2_get_sector(struct super_block *sb,
+ struct buffer_head **bh,
+ int block,
+ int sect_size);
+static void ocfs2_write_super(struct super_block *sb);
static struct inode *ocfs2_alloc_inode(struct super_block *sb);
static void ocfs2_destroy_inode(struct inode *inode);
static unsigned long long ocfs2_max_file_offset(unsigned int blockshift);
-static struct super_operations ocfs_sops = {
- .statfs = ocfs_statfs,
+static struct super_operations ocfs2_sops = {
+ .statfs = ocfs2_statfs,
.alloc_inode = ocfs2_alloc_inode,
.destroy_inode = ocfs2_destroy_inode,
.clear_inode = ocfs2_clear_inode,
.delete_inode = ocfs2_delete_inode,
.sync_fs = ocfs2_sync_fs,
- .write_super = ocfs_write_super,
- .put_super = ocfs_put_super,
+ .write_super = ocfs2_write_super,
+ .put_super = ocfs2_put_super,
};
-struct dentry *ocfs_get_parent(struct dentry *child);
-static struct export_operations ocfs_export_ops = {
- .get_parent = ocfs_get_parent,
+struct dentry *ocfs2_get_parent(struct dentry *child);
+static struct export_operations ocfs2_export_ops = {
+ .get_parent = ocfs2_get_parent,
};
enum {
@@ -137,7 +141,7 @@
/*
* write_super and sync_fs ripped right out of ext3.
*/
-static void ocfs_write_super(struct super_block *sb)
+static void ocfs2_write_super(struct super_block *sb)
{
if (down_trylock(&sb->s_lock) == 0)
BUG();
@@ -148,7 +152,7 @@
{
int status = 0;
tid_t target;
- ocfs_super *osb = OCFS2_SB(sb);
+ ocfs2_super *osb = OCFS2_SB(sb);
sb->s_dirt = 0;
@@ -168,10 +172,7 @@
return 0;
}
-/*
- * ocfs_init_global_system_inodes()
- */
-static int ocfs_init_global_system_inodes(ocfs_super *osb)
+static int ocfs2_init_global_system_inodes(ocfs2_super *osb)
{
struct inode *new = NULL;
int status = 0;
@@ -179,7 +180,7 @@
mlog_entry_void();
- new = ocfs_iget(osb, osb->root_blkno);
+ new = ocfs2_iget(osb, osb->root_blkno);
if (!new) {
status = -EINVAL;
mlog_errno(status);
@@ -187,7 +188,7 @@
}
osb->root_inode = new;
- new = ocfs_iget(osb, osb->system_dir_blkno);
+ new = ocfs2_iget(osb, osb->system_dir_blkno);
if (!new) {
status = -EINVAL;
mlog_errno(status);
@@ -197,9 +198,9 @@
for (i = OCFS2_FIRST_ONLINE_SYSTEM_INODE;
i <= OCFS2_LAST_GLOBAL_SYSTEM_INODE; i++) {
- new = ocfs_get_system_file_inode(osb, i, osb->slot_num);
+ new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
if (!new) {
- ocfs_release_system_inodes(osb);
+ ocfs2_release_system_inodes(osb);
status = -EINVAL;
mlog_errno(status);
/* FIXME: Should ERROR_RO_FS */
@@ -214,12 +215,9 @@
bail:
mlog_exit(status);
return status;
-} /* ocfs_init_global_system_inodes */
+}
-/*
- * ocfs_init_local_system_inodes()
- */
-static int ocfs_init_local_system_inodes(ocfs_super *osb)
+static int ocfs2_init_local_system_inodes(ocfs2_super *osb)
{
struct inode *new = NULL;
int status = 0;
@@ -227,28 +225,27 @@
mlog_entry_void();
- for (i = OCFS2_LAST_GLOBAL_SYSTEM_INODE + 1; i < NUM_SYSTEM_INODES ; i++) {
- new = ocfs_get_system_file_inode(osb, i, osb->slot_num);
+ for (i = OCFS2_LAST_GLOBAL_SYSTEM_INODE + 1;
+ i < NUM_SYSTEM_INODES;
+ i++) {
+ new = ocfs2_get_system_file_inode(osb, i, osb->slot_num);
if (!new) {
- ocfs_release_system_inodes(osb);
+ ocfs2_release_system_inodes(osb);
status = -EINVAL;
mlog(ML_ERROR, "status=%d, sysfile=%d, slot=%d\n",
status, i, osb->slot_num);
goto bail;
}
- // the array now has one ref, so drop this one
+ /* the array now has one ref, so drop this one */
iput(new);
}
bail:
mlog_exit(status);
return status;
-} /* ocfs_init_local_system_inodes */
+}
-/*
- * ocfs_release_system_inodes()
- */
-static int ocfs_release_system_inodes(ocfs_super *osb)
+static int ocfs2_release_system_inodes(ocfs2_super *osb)
{
int status = 0, i;
struct inode *inode;
@@ -277,7 +274,7 @@
mlog_exit(status);
return status;
-} /* ocfs_release_system_inodes */
+}
/* We're allocating fs objects, use GFP_NOFS */
static struct inode *ocfs2_alloc_inode(struct super_block *sb)
@@ -320,7 +317,7 @@
#if BITS_PER_LONG == 32
# if defined(CONFIG_LBD)
- OCFS_ASSERT(sizeof(sector_t) == 8);
+ OCFS2_ASSERT(sizeof(sector_t) == 8);
pagefactor = PAGE_CACHE_SIZE;
bitshift = BITS_PER_LONG;
# else
@@ -331,12 +328,12 @@
return (((unsigned long long)pagefactor) << bitshift) - 1;
}
-static int ocfs_fill_super(struct super_block *sb, void *data, int silent)
+static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
{
struct dentry *root;
int status;
struct inode *inode = NULL;
- ocfs_super *osb = NULL;
+ ocfs2_super *osb = NULL;
unsigned long mount_opt = 0;
mlog_entry("%p, %p, %i", sb, data, silent);
@@ -361,13 +358,13 @@
}
sb->s_magic = OCFS2_SUPER_MAGIC;
- sb->s_op = &ocfs_sops;
- sb->s_export_op = &ocfs_export_ops;
+ sb->s_op = &ocfs2_sops;
+ sb->s_export_op = &ocfs2_export_ops;
sb->s_flags |= MS_NOATIME;
sb->s_fs_info = NULL;
- status = ocfs_mount_volume(sb, mount_opt);
- /* ocfs_mount_volume may set osb even on error so we want to
+ status = ocfs2_mount_volume(sb, mount_opt);
+ /* ocfs2_mount_volume may set osb even on error so we want to
* pull it off for proper cleanup. */
osb = OCFS2_SB(sb);
if (osb && osb->root_inode)
@@ -418,22 +415,25 @@
if (osb) {
atomic_set(&osb->vol_state, VOLUME_DISABLED);
wake_up(&osb->osb_mount_event);
- ocfs_dismount_volume(sb, 1);
+ ocfs2_dismount_volume(sb, 1);
}
mlog_exit(status);
return status;
}
-static struct super_block *ocfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
+static struct super_block *ocfs2_get_sb(struct file_system_type *fs_type,
+ int flags,
+ const char *dev_name,
+ void *data)
{
- return get_sb_bdev(fs_type, flags, dev_name, data, ocfs_fill_super);
+ return get_sb_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super);
}
-static struct file_system_type ocfs_fs_type = {
+static struct file_system_type ocfs2_fs_type = {
.owner = THIS_MODULE,
.name = "ocfs2",
- .get_sb = ocfs_get_sb, /* is this called when we mount
+ .get_sb = ocfs2_get_sb, /* is this called when we mount
* the fs? */
.kill_sb = kill_block_super, /* set to the generic one
* right now, but do we
@@ -504,7 +504,7 @@
return -ENOMEM;
/* Initialize the memory slabs for oin and file entry */
- status = ocfs_initialize_mem_caches();
+ status = ocfs2_initialize_mem_caches();
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -515,18 +515,18 @@
spin_unlock(&ocfs2_globals_lock);
/* Initialize the proc interface */
- ocfs_proc_init();
+ ocfs2_proc_init();
leave:
if (status < 0) {
- ocfs_free_mem_caches();
+ ocfs2_free_mem_caches();
exit_ocfs2_extent_maps();
}
mlog_exit(status);
if (status >= 0) {
- return register_filesystem(&ocfs_fs_type);
+ return register_filesystem(&ocfs2_fs_type);
} else
return -1;
}
@@ -536,42 +536,31 @@
mlog_entry_void();
- ocfs_free_mem_caches();
+ ocfs2_free_mem_caches();
/* Deinit the proc interface */
- ocfs_proc_deinit();
+ ocfs2_proc_deinit();
- unregister_filesystem(&ocfs_fs_type);
+ unregister_filesystem(&ocfs2_fs_type);
exit_ocfs2_extent_maps();
mlog_exit_void();
}
-
-/*
- * ocfs_put_super()
- *
- */
-static void ocfs_put_super(struct super_block *sb)
+static void ocfs2_put_super(struct super_block *sb)
{
mlog_entry("(0x%p)\n", sb);
- ocfs_sync_blockdev(sb);
- ocfs_dismount_volume(sb, 0);
+ ocfs2_sync_blockdev(sb);
+ ocfs2_dismount_volume(sb, 0);
mlog_exit_void();
-} /* ocfs_put_super */
+}
-
-
-/*
- * ocfs_statfs()
- *
- */
-static int ocfs_statfs(struct super_block *sb, struct kstatfs *buf)
+static int ocfs2_statfs(struct super_block *sb, struct kstatfs *buf)
{
- ocfs_super *osb;
+ ocfs2_super *osb;
u32 numbits, freebits;
int status;
ocfs2_dinode *bm_lock;
@@ -582,9 +571,9 @@
osb = OCFS2_SB(sb);
- inode = ocfs_get_system_file_inode(osb,
- GLOBAL_BITMAP_SYSTEM_INODE,
- -1);
+ inode = ocfs2_get_system_file_inode(osb,
+ GLOBAL_BITMAP_SYSTEM_INODE,
+ -1);
if (!inode) {
mlog(ML_ERROR, "failed to get bitmap inode\n");
status = -EIO;
@@ -624,9 +613,11 @@
mlog_exit(status);
return status;
-} /* ocfs_statfs */
+}
-static void ocfs2_inode_init_once(void *data, kmem_cache_t *cachep, unsigned long flags)
+static void ocfs2_inode_init_once(void *data,
+ kmem_cache_t *cachep,
+ unsigned long flags)
{
struct ocfs2_inode_info *oi = data;
@@ -658,11 +649,7 @@
}
}
-/*
- * ocfs_initialize_mem_caches()
- *
- */
-static int ocfs_initialize_mem_caches(void)
+static int ocfs2_initialize_mem_caches(void)
{
ocfs2_inode_cachep = kmem_cache_create("ocfs2_inode_cache",
sizeof(struct ocfs2_inode_info),
@@ -672,28 +659,25 @@
return -ENOMEM;
ocfs2_lock_cache = kmem_cache_create("ocfs2_lock",
- sizeof(ocfs_journal_lock), 0,
+ sizeof(ocfs2_journal_lock), 0,
SLAB_NO_REAP|SLAB_HWCACHE_ALIGN,
NULL, NULL);
if (!ocfs2_lock_cache)
return -ENOMEM;
return 0;
-} /* ocfs_initialize_mem_caches */
+}
-/*
- * ocfs_free_mem_caches()
- *
- */
-static void ocfs_free_mem_caches(void)
+static void ocfs2_free_mem_caches(void)
{
if (ocfs2_inode_cachep)
kmem_cache_destroy(ocfs2_inode_cachep);
if (ocfs2_lock_cache)
kmem_cache_destroy(ocfs2_lock_cache);
- ocfs2_inode_cachep = ocfs2_lock_cache = NULL;
-} /* ocfs_free_mem_caches */
+ ocfs2_inode_cachep = NULL;
+ ocfs2_lock_cache = NULL;
+}
static int ocfs2_sb_probe(struct super_block *sb,
struct buffer_head **bh,
@@ -751,7 +735,9 @@
* the minimum clustersize.
*/
status = -EINVAL;
- for (blksize = *sector_size; blksize <= OCFS2_MAX_BLOCKSIZE; blksize <<= 1) {
+ for (blksize = *sector_size;
+ blksize <= OCFS2_MAX_BLOCKSIZE;
+ blksize <<= 1) {
tmpstat = ocfs2_get_sector(sb, bh,
OCFS2_SUPER_BLOCK_BLKNO,
blksize);
@@ -761,7 +747,7 @@
goto bail;
}
di = (ocfs2_dinode *) (*bh)->b_data;
- status = ocfs_verify_volume(di, *bh, blksize);
+ status = ocfs2_verify_volume(di, *bh, blksize);
if (status >= 0)
goto bail;
brelse(*bh);
@@ -774,7 +760,10 @@
return status;
}
-static int ocfs2_get_sector(struct super_block *sb, struct buffer_head **bh, int block, int sect_size)
+static int ocfs2_get_sector(struct super_block *sb,
+ struct buffer_head **bh,
+ int block,
+ int sect_size)
{
if (!sb_set_blocksize(sb, sect_size)) {
mlog(ML_ERROR, "unable to set blocksize\n");
@@ -796,7 +785,7 @@
}
/* ocfs2 1.0 only allows one cluster and node identity per kernel image. */
-static int ocfs2_fill_local_node_info(ocfs_super *osb)
+static int ocfs2_fill_local_node_info(ocfs2_super *osb)
{
int status;
@@ -816,15 +805,11 @@
return status;
}
-/*
- * ocfs_mount_volume()
- *
- */
-static int ocfs_mount_volume(struct super_block *sb, unsigned long mount_opt)
+static int ocfs2_mount_volume(struct super_block *sb, unsigned long mount_opt)
{
int status, sector_size;
int unlock_super = 0;
- ocfs_super *osb = NULL;
+ ocfs2_super *osb = NULL;
struct buffer_head *bh = NULL;
mlog_entry_void();
@@ -836,7 +821,7 @@
goto leave;
}
- osb = kcalloc(1, sizeof(ocfs_super), GFP_KERNEL);
+ osb = kcalloc(1, sizeof(ocfs2_super), GFP_KERNEL);
if (!osb) {
status = -ENOMEM;
mlog_errno(status);
@@ -848,13 +833,13 @@
osb->s_mount_opt = mount_opt;
- /* Save off for ocfs_rw_direct */
+ /* Save off for ocfs2_rw_direct */
osb->s_sectsize_bits = blksize_bits(sector_size);
if (!osb->s_sectsize_bits)
BUG();
/* s_blocksize was set in the probe */
- status = ocfs_initialize_osb(osb, bh);
+ status = ocfs2_initialize_osb(osb, bh);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -902,19 +887,19 @@
ocfs2_populate_mounted_map(osb);
/* load all node-local system inodes */
- status = ocfs_init_local_system_inodes(osb);
+ status = ocfs2_init_local_system_inodes(osb);
if (status < 0) {
mlog_errno(status);
goto leave;
}
/* Add proc entry for this volume */
- ocfs_proc_add_volume(osb);
+ ocfs2_proc_add_volume(osb);
/* Read the publish sector for this node and cleanup dirent being */
/* modified when we crashed. */
- mlog(0, "ocfs_check_volume...\n");
- status = ocfs_check_volume(osb);
+ mlog(0, "ocfs2_check_volume...\n");
+ status = ocfs2_check_volume(osb);
if (status < 0) {
mlog_errno(status);
goto leave;
@@ -943,36 +928,31 @@
brelse(bh);
mlog_exit(status);
return status;
-} /* ocfs_mount_volume */
+}
-
/* we can't grab the goofy sem lock from inside wait_event, so we use
* memory barriers to make sure that we'll see the null task before
* being woken up */
-static int ocfs2_recovery_thread_running(ocfs_super *osb)
+static int ocfs2_recovery_thread_running(ocfs2_super *osb)
{
mb();
return osb->recovery_thread_task != NULL;
}
-/*
- * ocfs_dismount_volume()
- *
- */
-static void ocfs_dismount_volume(struct super_block *sb, int mnt_err)
+static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err)
{
int tmp;
- ocfs_super *osb = NULL;
+ ocfs2_super *osb = NULL;
mlog_entry("(0x%p)\n", sb);
- OCFS_ASSERT(sb);
+ OCFS2_ASSERT(sb);
osb = OCFS2_SB(sb);
- OCFS_ASSERT(osb);
+ OCFS2_ASSERT(osb);
ocfs2_wait_for_okp_destruction(osb);
- ocfs_shutdown_local_alloc(osb);
+ ocfs2_shutdown_local_alloc(osb);
ocfs2_truncate_log_shutdown(osb);
@@ -988,12 +968,12 @@
* complete. */
flush_scheduled_work();
- ocfs_journal_shutdown(osb);
+ ocfs2_journal_shutdown(osb);
- ocfs_sync_blockdev(sb);
+ ocfs2_sync_blockdev(sb);
/* Remove the proc element for this volume */
- ocfs_proc_remove_volume(osb);
+ ocfs2_proc_remove_volume(osb);
/* No dlm means we've failed during mount, so skip all the
* steps which depended on that to complete. */
@@ -1014,7 +994,7 @@
ocfs2_super_unlock(osb, 1);
}
- ocfs_release_system_inodes(osb);
+ ocfs2_release_system_inodes(osb);
if (osb->dlm) {
ocfs2_unregister_net_handlers(osb);
@@ -1032,14 +1012,14 @@
printk("ocfs2: Unmounting device (%u,%u) on (node %d)\n",
MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev), osb->node_num);
- ocfs_delete_osb(osb);
+ ocfs2_delete_osb(osb);
kfree(osb);
sb->s_dev = 0;
sb->s_fs_info = NULL;
-} /* ocfs_dismount_volume */
+}
-static int osb_setup_uuid(ocfs_super *osb, const unsigned char *uuid,
- unsigned uuid_bytes)
+static int ocfs2_setup_osb_uuid(ocfs2_super *osb, const unsigned char *uuid,
+ unsigned uuid_bytes)
{
int i, ret;
char *ptr;
@@ -1064,18 +1044,14 @@
return 0;
}
-/*
- * ocfs_initialize_osb()
- *
- */
-static int ocfs_initialize_osb(ocfs_super *osb, struct buffer_head *bh)
+static int ocfs2_initialize_osb(ocfs2_super *osb, struct buffer_head *bh)
{
int status = 0;
int i;
ocfs2_dinode *di = NULL;
struct inode *inode = NULL;
struct buffer_head *bitmap_bh = NULL;
- ocfs_journal *journal;
+ ocfs2_journal *journal;
mlog_entry_void();
@@ -1184,21 +1160,21 @@
get_random_bytes(&osb->s_next_generation, sizeof(u32));
/* FIXME
- * This should be done in ocfs_journal_init(), but unknown
+ * This should be done in ocfs2_journal_init(), but unknown
* ordering issues will cause the filesystem to crash.
* If anyone wants to figure out what part of the code
- * refers to osb->journal before ocfs_journal_init() is run,
+ * refers to osb->journal before ocfs2_journal_init() is run,
* be my guest.
*/
/* initialize our journal structure */
- journal = kmalloc(sizeof(ocfs_journal), GFP_KERNEL);
+ journal = kmalloc(sizeof(ocfs2_journal), GFP_KERNEL);
if (!journal) {
mlog(ML_ERROR, "unable to alloc journal\n");
status = -ENOMEM;
goto bail;
}
- memset(journal, 0, sizeof(ocfs_journal));
+ memset(journal, 0, sizeof(ocfs2_journal));
osb->journal = journal;
journal->j_osb = osb;
@@ -1209,7 +1185,7 @@
journal->j_trans_id = (unsigned long) 1;
INIT_LIST_HEAD(&journal->j_la_cleanups);
INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery, osb);
- journal->j_state = OCFS_JOURNAL_FREE;
+ journal->j_state = OCFS2_JOURNAL_FREE;
/* get some pseudo constants for clustersize bits */
osb->s_clustersize_bits =
@@ -1225,7 +1201,7 @@
goto bail;
}
- if (ocfs2_clusters_to_blocks(osb->sb, di->i_clusters - 1)
+ if (ocfs2_clusters_to_blocks(osb->sb, di->i_clusters - 1)
> (u32)~0UL) {
mlog(ML_ERROR, "Volume might try to write to blocks beyond "
"what jbd can address in 32 bits.\n");
@@ -1233,8 +1209,8 @@
goto bail;
}
- if (osb_setup_uuid(osb, di->id2.i_super.s_uuid,
- sizeof(di->id2.i_super.s_uuid))) {
+ if (ocfs2_setup_osb_uuid(osb, di->id2.i_super.s_uuid,
+ sizeof(di->id2.i_super.s_uuid))) {
mlog(ML_ERROR, "Out of memory trying to setup our uuid.\n");
status = -ENOMEM;
goto bail;
@@ -1255,7 +1231,7 @@
atomic_set(&osb->vol_state, VOLUME_INIT);
/* load root, system_dir, and all global system inodes */
- status = ocfs_init_global_system_inodes(osb);
+ status = ocfs2_init_global_system_inodes(osb);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -1264,7 +1240,8 @@
/*
* global bitmap
*/
- inode = ocfs_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE, -1);
+ inode = ocfs2_get_system_file_inode(osb,
+ GLOBAL_BITMAP_SYSTEM_INODE, -1);
if (!inode) {
status = -EINVAL;
mlog_errno(status);
@@ -1273,7 +1250,8 @@
osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;
- status = ocfs_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0, inode);
+ status = ocfs2_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0,
+ inode);
iput(inode);
if (status < 0) {
mlog_errno(status);
@@ -1297,7 +1275,7 @@
/* The Global Link List is mainted for the whole driver . */
spin_lock(&ocfs2_globals_lock);
osb->osb_id = osb_id;
- if (osb_id < OCFS_MAX_OSB_ID)
+ if (osb_id < OCFS2_MAX_OSB_ID)
osb_id++;
else {
mlog(ML_ERROR, "Too many volumes mounted\n");
@@ -1308,16 +1286,15 @@
bail:
mlog_exit(status);
return status;
-} /* ocfs_initialize_osb */
+}
/*
- * ocfs_verify_volume()
* will return: -EAGAIN if it is ok to keep searching for superblocks
* -EINVAL if there is a bad superblock
* 0 on success
*/
-static int ocfs_verify_volume(ocfs2_dinode *di, struct buffer_head *bh,
- u32 blksz)
+static int ocfs2_verify_volume(ocfs2_dinode *di, struct buffer_head *bh,
+ u32 blksz)
{
int status = -EAGAIN;
@@ -1367,13 +1344,9 @@
mlog_exit(status);
return status;
-} /* ocfs_verify_volume */
+}
-/*
- * ocfs_check_volume()
- *
- */
-static int ocfs_check_volume(ocfs_super *osb)
+static int ocfs2_check_volume(ocfs2_super *osb)
{
int status = 0;
int dirty;
@@ -1384,7 +1357,7 @@
mlog_entry_void();
/* Init our journal object. */
- status = ocfs_journal_init(osb->journal, &dirty);
+ status = ocfs2_journal_init(osb->journal, &dirty);
if (status < 0) {
mlog(ML_ERROR, "Could not initialize journal!\n");
goto finally;
@@ -1394,7 +1367,7 @@
* recover anything. Otherwise, journal_load will do that
* dirty work for us :) */
if (!dirty) {
- status = ocfs_journal_wipe(osb->journal, 0);
+ status = ocfs2_journal_wipe(osb->journal, 0);
if (status < 0) {
mlog_errno(status);
goto finally;
@@ -1405,13 +1378,13 @@
}
/* will play back anything left in the journal. */
- ocfs_journal_load(osb->journal);
+ ocfs2_journal_load(osb->journal);
if (dirty) {
/* recover my local alloc if we didn't unmount cleanly. */
- status = ocfs_begin_local_alloc_recovery(osb,
- osb->slot_num,
- &local_alloc);
+ status = ocfs2_begin_local_alloc_recovery(osb,
+ osb->slot_num,
+ &local_alloc);
if (status < 0) {
mlog_errno(status);
goto finally;
@@ -1422,7 +1395,7 @@
mlog(0, "Journal loaded.\n");
- status = ocfs_load_local_alloc(osb);
+ status = ocfs2_load_local_alloc(osb);
if (status < 0) {
mlog_errno(status);
goto finally;
@@ -1449,18 +1422,16 @@
mlog_exit(status);
return status;
-} /* ocfs_check_volume */
+}
/*
- * ocfs_delete_osb()
- *
* The routine gets called from dismount or close whenever a dismount on
* volume is requested and the osb open count becomes 1.
* It will remove the osb from the global list and also free up all the
* initialized resources and fileobject.
*/
-static void ocfs_delete_osb(ocfs_super *osb)
+static void ocfs2_delete_osb(ocfs2_super *osb)
{
mlog_entry_void();
@@ -1471,18 +1442,17 @@
/* FIXME
* This belongs in journal shutdown, but because we have to
- * allocate osb->journal at the start of ocfs_initalize_osb(),
+ * allocate osb->journal at the start of ocfs2_initalize_osb(),
* we free it here.
*/
kfree(osb->journal);
if (osb->local_alloc_copy)
kfree(osb->local_alloc_copy);
kfree(osb->uuid_str);
- memset(osb, 0, sizeof(ocfs_super));
+ memset(osb, 0, sizeof(ocfs2_super));
mlog_exit_void();
-} /* ocfs_delete_osb */
+}
-
module_init(ocfs2_init);
module_exit(ocfs2_exit);
Modified: trunk/fs/ocfs2/super.h
===================================================================
--- trunk/fs/ocfs2/super.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/super.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,6 +26,7 @@
#ifndef OCFS2_SUPER_H
#define OCFS2_SUPER_H
-int ocfs_publish_get_mount_state(ocfs_super *osb, int node_num);
+int ocfs2_publish_get_mount_state(ocfs2_super *osb,
+ int node_num);
#endif /* OCFS2_SUPER_H */
Modified: trunk/fs/ocfs2/symlink.c
===================================================================
--- trunk/fs/ocfs2/symlink.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/symlink.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -28,7 +28,7 @@
*
* Portions Copyright (C) 2001 Compaq Computer Corporation
*
- * ocfs2 symlink handling code for CDSL support
+ * ocfs2 symlink handling code, including CDSL support
*
* Copyright (C) 2004, 2005 Oracle.
*
@@ -54,14 +54,19 @@
#include "buffer_head_io.h"
-struct ocfs_symlink_ops {
+struct ocfs2_symlink_ops {
const char *name;
const unsigned int len;
unsigned int (*subst_fn) (char *str, void *data);
};
-static unsigned int ocfs_link_size(struct ocfs_symlink_ops *ops, char *str, struct inode *inode);
-static void ocfs_link_expand(struct ocfs_symlink_ops *ops, char *out, char *in, struct inode *inode);
+static unsigned int ocfs2_link_size(struct ocfs2_symlink_ops *ops,
+ char *str,
+ struct inode *inode);
+static void ocfs2_link_expand(struct ocfs2_symlink_ops *ops,
+ char *out,
+ char *in,
+ struct inode *inode);
static char *ocfs2_fast_symlink_getlink(struct inode *inode,
struct buffer_head **bh);
static int ocfs2_readlink(struct dentry *dentry,
@@ -140,7 +145,7 @@
unsigned int l;
char buf[10];
struct inode *inode = data;
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
l = sprintf(buf, "%lu", (unsigned long)osb->node_num);
@@ -201,7 +206,7 @@
return l;
}
-static struct ocfs_symlink_ops symlink_ops[] = {
+static struct ocfs2_symlink_ops symlink_ops[] = {
{"hostname}", 9, sym_hostname},
{"mach}", 5, sym_machine},
{"os}", 3, sym_os},
@@ -215,15 +220,17 @@
/* CDSL code - end
**/
-static char *my_page_getlink(struct dentry * dentry, struct page **ppage);
+static char *ocfs2_page_getlink(struct dentry * dentry,
+ struct page **ppage);
/* get the link contents into pagecache */
-static char *my_page_getlink(struct dentry * dentry, struct page **ppage)
+static char *ocfs2_page_getlink(struct dentry * dentry,
+ struct page **ppage)
{
struct page * page;
struct address_space *mapping = dentry->d_inode->i_mapping;
- page = read_cache_page(mapping, 0, (filler_t *)mapping->a_ops->readpage,
- NULL);
+ page = read_cache_page(mapping, 0,
+ (filler_t *)mapping->a_ops->readpage, NULL);
if (IS_ERR(page))
goto sync_fail;
wait_on_page_locked(page);
@@ -249,11 +256,11 @@
mlog_entry_void();
- status = ocfs_read_block(OCFS2_SB(inode->i_sb),
- OCFS2_I(inode)->ip_blkno,
- bh,
- OCFS_BH_CACHED,
- inode);
+ status = ocfs2_read_block(OCFS2_SB(inode->i_sb),
+ OCFS2_I(inode)->ip_blkno,
+ bh,
+ OCFS2_BH_CACHED,
+ inode);
if (status < 0) {
mlog_errno(status);
link = ERR_PTR(status);
@@ -268,7 +275,7 @@
return link;
}
-static int ocfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+static int ocfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
{
struct inode *inode = dentry->d_inode;
struct page *page = NULL;
@@ -279,20 +286,20 @@
if (ocfs2_inode_is_fast_symlink(inode))
orig_link = ocfs2_fast_symlink_getlink(inode, &bh);
else
- orig_link = my_page_getlink(dentry, &page);
+ orig_link = ocfs2_page_getlink(dentry, &page);
if (IS_ERR(orig_link)) {
res = PTR_ERR(orig_link);
goto out;
}
- len = ocfs_link_size(symlink_ops, orig_link, inode);
+ len = ocfs2_link_size(symlink_ops, orig_link, inode);
new_link = kmalloc(len, GFP_KERNEL);
if (new_link == NULL) {
res = ENOMEM;
goto out;
}
- ocfs_link_expand(symlink_ops, new_link, orig_link, inode);
+ ocfs2_link_expand(symlink_ops, new_link, orig_link, inode);
res = vfs_follow_link(nd, new_link);
out:
if (page) {
@@ -308,7 +315,7 @@
/**
- *** ocfs_link_expand - Expand a context sensitive symlink
+ *** ocfs2_link_expand - Expand a context sensitive symlink
*** @ops: The symlink substitution operations table
*** @out: Buffer to place result in
*** @in: Buffer to get symlink from
@@ -316,7 +323,7 @@
*** Returns: 0 or error code
***/
-static void ocfs_link_expand(struct ocfs_symlink_ops *ops, char *out, char *in, struct inode *inode)
+static void ocfs2_link_expand(struct ocfs2_symlink_ops *ops, char *out, char *in, struct inode *inode)
{
unsigned int i;
@@ -339,7 +346,7 @@
/**
- *** ocfs_link_size - Return expanded size required to store a symlink
+ *** ocfs2_link_size - Return expanded size required to store a symlink
*** @str: The symlink
*** @ops: The symlink substitution operations table
***
@@ -347,7 +354,7 @@
***/
-static unsigned int ocfs_link_size(struct ocfs_symlink_ops *ops, char *str, struct inode *inode)
+static unsigned int ocfs2_link_size(struct ocfs2_symlink_ops *ops, char *str, struct inode *inode)
{
unsigned int len = 0;
unsigned int i;
@@ -395,13 +402,13 @@
return ret;
}
-struct inode_operations ocfs_symlink_inode_operations = {
+struct inode_operations ocfs2_symlink_inode_operations = {
.readlink = page_readlink,
- .follow_link = ocfs_follow_link,
- .getattr = ocfs_getattr,
+ .follow_link = ocfs2_follow_link,
+ .getattr = ocfs2_getattr,
};
-struct inode_operations ocfs_fast_symlink_inode_operations = {
+struct inode_operations ocfs2_fast_symlink_inode_operations = {
.readlink = ocfs2_readlink,
- .follow_link = ocfs_follow_link,
- .getattr = ocfs_getattr,
+ .follow_link = ocfs2_follow_link,
+ .getattr = ocfs2_getattr,
};
Modified: trunk/fs/ocfs2/symlink.h
===================================================================
--- trunk/fs/ocfs2/symlink.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/symlink.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,8 +26,8 @@
#ifndef OCFS2_SYMLINK_H
#define OCFS2_SYMLINK_H
-extern struct inode_operations ocfs_symlink_inode_operations;
-extern struct inode_operations ocfs_fast_symlink_inode_operations;
+extern struct inode_operations ocfs2_symlink_inode_operations;
+extern struct inode_operations ocfs2_fast_symlink_inode_operations;
/*
* Test whether an inode is a fast symlink.
Modified: trunk/fs/ocfs2/sysfile.c
===================================================================
--- trunk/fs/ocfs2/sysfile.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/sysfile.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -42,10 +42,14 @@
#include "buffer_head_io.h"
-static struct inode * _ocfs_get_system_file_inode(ocfs_super *osb, int type, u32 slot);
+static struct inode * _ocfs2_get_system_file_inode(ocfs2_super *osb,
+ int type,
+ u32 slot);
static inline int is_global_system_inode(int type);
-static inline int is_in_system_inode_array(ocfs_super *osb, int type, u32 slot);
+static inline int is_in_system_inode_array(ocfs2_super *osb,
+ int type,
+ u32 slot);
static inline int is_global_system_inode(int type)
{
@@ -53,13 +57,16 @@
type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE;
}
-static inline int is_in_system_inode_array(ocfs_super *osb, int type, u32 slot)
+static inline int is_in_system_inode_array(ocfs2_super *osb,
+ int type,
+ u32 slot)
{
return slot == osb->slot_num || is_global_system_inode(type);
}
-struct inode *ocfs_get_system_file_inode(ocfs_super *osb, int type,
- u32 slot)
+struct inode *ocfs2_get_system_file_inode(ocfs2_super *osb,
+ int type,
+ u32 slot)
{
struct inode *inode = NULL;
struct inode **arr = NULL;
@@ -78,7 +85,7 @@
}
/* this gets one ref thru iget */
- inode = _ocfs_get_system_file_inode(osb, type, slot);
+ inode = _ocfs2_get_system_file_inode(osb, type, slot);
/* add one more if putting into array for first time */
if (arr && inode) {
@@ -89,7 +96,9 @@
return inode;
}
-static struct inode * _ocfs_get_system_file_inode(ocfs_super *osb, int type, u32 slot)
+static struct inode * _ocfs2_get_system_file_inode(ocfs2_super *osb,
+ int type,
+ u32 slot)
{
char namebuf[40];
struct inode *inode = NULL;
@@ -102,14 +111,14 @@
sizeof(namebuf),
type, slot);
- status = ocfs_find_files_on_disk(osb, namebuf, strlen(namebuf),
- &blkno, osb->sys_root_inode,
- 0, &dirent_bh, &de);
+ status = ocfs2_find_files_on_disk(osb, namebuf, strlen(namebuf),
+ &blkno, osb->sys_root_inode,
+ 0, &dirent_bh, &de);
if (status < 0) {
goto bail;
}
- inode = ocfs_iget(osb, blkno);
+ inode = ocfs2_iget(osb, blkno);
if (!inode) {
mlog(ML_ERROR, "Could not create inode!\n");
goto bail;
Modified: trunk/fs/ocfs2/sysfile.h
===================================================================
--- trunk/fs/ocfs2/sysfile.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/sysfile.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -26,6 +26,8 @@
#ifndef OCFS2_SYSFILE_H
#define OCFS2_SYSFILE_H
-struct inode * ocfs_get_system_file_inode(ocfs_super *osb, int type, u32 slot);
+struct inode * ocfs2_get_system_file_inode(ocfs2_super *osb,
+ int type,
+ u32 slot);
#endif /* OCFS2_SYSFILE_H */
Modified: trunk/fs/ocfs2/vote.c
===================================================================
--- trunk/fs/ocfs2/vote.c 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/vote.c 2005-06-02 03:50:59 UTC (rev 2356)
@@ -119,7 +119,7 @@
struct list_head n_list;
u32 n_response_id;
wait_queue_head_t n_event;
- ocfs_node_map n_node_map;
+ ocfs2_node_map n_node_map;
int n_response; /* an agreggate response. 0 if
* all nodes are go, < 0 on any
* negative response from any
@@ -127,29 +127,28 @@
struct ocfs2_net_response_cb *n_callback;
} ocfs2_net_wait_ctxt;
-
-static void ocfs2_process_mount_request(ocfs_super *osb,
+static void ocfs2_process_mount_request(ocfs2_super *osb,
unsigned int node_num)
{
mlog(0, "MOUNT vote from node %u\n", node_num);
/* The other node only sends us this message when he has an EX
* on the superblock, so our recovery threads (if having been
* launched) are waiting on it.*/
- ocfs_recovery_map_clear(osb, node_num);
- ocfs_node_map_set_bit(osb, &osb->mounted_map, node_num);
+ ocfs2_recovery_map_clear(osb, node_num);
+ ocfs2_node_map_set_bit(osb, &osb->mounted_map, node_num);
/* We clear the umount map here because a node may have been
* previously mounted, safely unmounted but never stopped
* heartbeating - in which case we'd have a stale entry. */
- ocfs_node_map_clear_bit(osb, &osb->umount_map, node_num);
+ ocfs2_node_map_clear_bit(osb, &osb->umount_map, node_num);
}
-static void ocfs2_process_umount_request(ocfs_super *osb,
+static void ocfs2_process_umount_request(ocfs2_super *osb,
unsigned int node_num)
{
mlog(0, "UMOUNT vote from node %u\n", node_num);
- ocfs_node_map_clear_bit(osb, &osb->mounted_map, node_num);
- ocfs_node_map_set_bit(osb, &osb->umount_map, node_num);
+ ocfs2_node_map_clear_bit(osb, &osb->mounted_map, node_num);
+ ocfs2_node_map_set_bit(osb, &osb->umount_map, node_num);
}
static int ocfs2_process_delete_request(struct inode *inode,
@@ -255,7 +254,7 @@
}
}
-static void ocfs2_process_vote(ocfs_super *osb,
+static void ocfs2_process_vote(ocfs2_super *osb,
ocfs2_vote_msg *msg)
{
int net_status, vote_response;
@@ -309,7 +308,7 @@
goto respond;
/* If we get here, then the request is against an inode. */
- inode = ocfs_ilookup(osb, blkno);
+ inode = ocfs2_ilookup(osb, blkno);
/* Not finding the inode is perfectly valid - it means we're
* not interested in what the other node is about to do to it
@@ -319,7 +318,7 @@
if (!inode)
goto respond;
- OCFS_ASSERT(inode->i_generation == generation);
+ OCFS2_ASSERT(inode->i_generation == generation);
switch (request) {
case OCFS2_VOTE_REQ_DELETE:
@@ -370,7 +369,7 @@
iput(inode);
}
-static void ocfs2_vote_thread_do_work(ocfs_super *osb)
+static void ocfs2_vote_thread_do_work(ocfs2_super *osb)
{
unsigned long processed;
ocfs2_lock_res *lockres;
@@ -385,7 +384,7 @@
processed = osb->blocked_lock_count;
while (processed) {
- OCFS_ASSERT(!list_empty(&osb->blocked_lock_list));
+ OCFS2_ASSERT(!list_empty(&osb->blocked_lock_list));
lockres = list_entry(osb->blocked_lock_list.next,
ocfs2_lock_res, l_blocked_list);
@@ -393,7 +392,7 @@
osb->blocked_lock_count--;
spin_unlock(&osb->vote_task_lock);
- OCFS_ASSERT(processed);
+ OCFS2_ASSERT(processed);
processed--;
ocfs2_process_blocked_lock(osb, lockres);
@@ -402,7 +401,7 @@
}
while (osb->vote_count) {
- OCFS_ASSERT(!list_empty(&osb->vote_list));
+ OCFS2_ASSERT(!list_empty(&osb->vote_list));
work = list_entry(osb->vote_list.next,
ocfs2_vote_work, w_list);
list_del(&work->w_list);
@@ -419,7 +418,7 @@
mlog_exit_void();
}
-static int ocfs2_vote_thread_lists_empty(ocfs_super *osb)
+static int ocfs2_vote_thread_lists_empty(ocfs2_super *osb)
{
int empty = 0;
@@ -432,7 +431,7 @@
return empty;
}
-static int ocfs2_vote_thread_should_wake(ocfs_super *osb)
+static int ocfs2_vote_thread_should_wake(ocfs2_super *osb)
{
int should_wake = 0;
@@ -447,7 +446,7 @@
int ocfs2_vote_thread(void *arg)
{
int status = 0;
- ocfs_super *osb = arg;
+ ocfs2_super *osb = arg;
/* only quit once we've been asked to stop and there is no more
* work available */
@@ -480,14 +479,14 @@
INIT_LIST_HEAD(&w->n_list);
init_waitqueue_head(&w->n_event);
- ocfs_node_map_init(&w->n_node_map);
+ ocfs2_node_map_init(&w->n_node_map);
w->n_response_id = response_id;
w->n_callback = NULL;
bail:
return w;
}
-static unsigned int ocfs2_new_response_id(ocfs_super *osb)
+static unsigned int ocfs2_new_response_id(ocfs2_super *osb)
{
unsigned int ret;
@@ -498,7 +497,7 @@
return ret;
}
-static void ocfs2_dequeue_net_wait_ctxt(ocfs_super *osb,
+static void ocfs2_dequeue_net_wait_ctxt(ocfs2_super *osb,
ocfs2_net_wait_ctxt *w)
{
spin_lock(&osb->net_response_lock);
@@ -506,7 +505,7 @@
spin_unlock(&osb->net_response_lock);
}
-static void ocfs2_queue_net_wait_ctxt(ocfs_super *osb,
+static void ocfs2_queue_net_wait_ctxt(ocfs2_super *osb,
ocfs2_net_wait_ctxt *w)
{
spin_lock(&osb->net_response_lock);
@@ -515,20 +514,20 @@
spin_unlock(&osb->net_response_lock);
}
-static void __ocfs2_mark_node_responded(ocfs_super *osb,
+static void __ocfs2_mark_node_responded(ocfs2_super *osb,
ocfs2_net_wait_ctxt *w,
int node_num)
{
assert_spin_locked(&osb->net_response_lock);
- ocfs_node_map_clear_bit(osb, &w->n_node_map, node_num);
- if (ocfs_node_map_is_empty(osb, &w->n_node_map))
+ ocfs2_node_map_clear_bit(osb, &w->n_node_map, node_num);
+ if (ocfs2_node_map_is_empty(osb, &w->n_node_map))
wake_up(&w->n_event);
}
/* Intended to be called from the node down callback, we fake remove
* the node from all our response contexts */
-void ocfs2_remove_node_from_vote_queues(ocfs_super *osb,
+void ocfs2_remove_node_from_vote_queues(ocfs2_super *osb,
int node_num)
{
struct list_head *p;
@@ -545,7 +544,7 @@
spin_unlock(&osb->net_response_lock);
}
-static int ocfs2_broadcast_vote(ocfs_super *osb,
+static int ocfs2_broadcast_vote(ocfs2_super *osb,
ocfs2_vote_msg *request,
unsigned int response_id,
int *response,
@@ -569,12 +568,12 @@
* in n_response which we need anyway... */
ocfs2_queue_net_wait_ctxt(osb, w);
- i = ocfs_node_map_iterate(osb, &osb->mounted_map, 0);
+ i = ocfs2_node_map_iterate(osb, &osb->mounted_map, 0);
while (i != O2NM_INVALID_NODE_NUM) {
if (i != osb->node_num) {
mlog(0, "trying to send request to node %i\n", i);
- ocfs_node_map_set_bit(osb, &w->n_node_map, i);
+ ocfs2_node_map_set_bit(osb, &w->n_node_map, i);
remote_err = 0;
status = o2net_send_message(OCFS2_MESSAGE_TYPE_VOTE,
@@ -601,12 +600,12 @@
}
}
i++;
- i = ocfs_node_map_iterate(osb, &osb->mounted_map, i);
+ i = ocfs2_node_map_iterate(osb, &osb->mounted_map, i);
mlog(0, "next is %d, i am %d\n", i, osb->node_num);
}
mlog(0, "done sending, now waiting on responses...\n");
- wait_event(w->n_event, ocfs_node_map_is_empty(osb, &w->n_node_map));
+ wait_event(w->n_event, ocfs2_node_map_is_empty(osb, &w->n_node_map));
ocfs2_dequeue_net_wait_ctxt(osb, w);
dequeued = 1;
@@ -624,7 +623,7 @@
return status;
}
-static int ocfs2_do_request_vote(ocfs_super *osb,
+static int ocfs2_do_request_vote(ocfs2_super *osb,
u64 blkno,
unsigned int generation,
enum ocfs2_vote_request type,
@@ -636,7 +635,7 @@
ocfs2_vote_msg *request = NULL;
ocfs2_msg_hdr *hdr;
- OCFS_ASSERT(ocfs2_is_valid_vote_request(type));
+ OCFS2_ASSERT(ocfs2_is_valid_vote_request(type));
request = kmalloc(sizeof(*request), GFP_KERNEL);
if (!request) {
@@ -677,9 +676,9 @@
struct ocfs2_net_response_cb *callback)
{
int status;
- ocfs_super *osb = OCFS2_SB(inode->i_sb);
+ ocfs2_super *osb = OCFS2_SB(inode->i_sb);
- if (ocfs_inode_is_new(inode))
+ if (ocfs2_inode_is_new(inode))
return 0;
status = -EAGAIN;
@@ -694,7 +693,7 @@
}
status = 0;
- if (!ocfs_node_map_is_only(osb, &osb->mounted_map,
+ if (!ocfs2_node_map_is_only(osb, &osb->mounted_map,
osb->node_num))
status = ocfs2_do_request_vote(osb,
OCFS2_I(inode)->ip_blkno,
@@ -778,7 +777,7 @@
NULL);
}
-int ocfs2_request_mount_vote(ocfs_super *osb)
+int ocfs2_request_mount_vote(ocfs2_super *osb)
{
int status;
@@ -787,8 +786,8 @@
if (signal_pending(current))
return -ERESTARTSYS;
- if (ocfs_node_map_is_only(osb, &osb->mounted_map,
- osb->node_num))
+ if (ocfs2_node_map_is_only(osb, &osb->mounted_map,
+ osb->node_num))
return 0;
status = ocfs2_do_request_vote(osb, 0ULL, 0,
@@ -798,7 +797,7 @@
return status;
}
-int ocfs2_request_umount_vote(ocfs_super *osb)
+int ocfs2_request_umount_vote(ocfs2_super *osb)
{
int status;
@@ -807,8 +806,8 @@
/* Do not check signals on this vote... We really want
* this one to go all the way through. */
- if (ocfs_node_map_is_only(osb, &osb->mounted_map,
- osb->node_num))
+ if (ocfs2_node_map_is_only(osb, &osb->mounted_map,
+ osb->node_num))
return 0;
status = ocfs2_do_request_vote(osb, 0ULL, 0,
@@ -819,7 +818,7 @@
}
/* TODO: This should eventually be a hash table! */
-static ocfs2_net_wait_ctxt * __ocfs2_find_net_wait_ctxt(ocfs_super *osb,
+static ocfs2_net_wait_ctxt * __ocfs2_find_net_wait_ctxt(ocfs2_super *osb,
u32 response_id)
{
struct list_head *p;
@@ -862,7 +861,7 @@
{
unsigned int response_id, node_num;
int response_status;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
ocfs2_response_msg *resp;
ocfs2_net_wait_ctxt * w;
struct ocfs2_net_response_cb *resp_cb;
@@ -915,7 +914,7 @@
void *data)
{
int status;
- ocfs_super *osb = data;
+ ocfs2_super *osb = data;
ocfs2_vote_work *work;
work = kmalloc(sizeof(ocfs2_vote_work), GFP_KERNEL);
@@ -950,7 +949,7 @@
return status;
}
-void ocfs2_unregister_net_handlers(ocfs_super *osb)
+void ocfs2_unregister_net_handlers(ocfs2_super *osb)
{
if (!osb->net_key)
return;
@@ -963,7 +962,7 @@
osb->net_key = 0;
}
-int ocfs2_register_net_handlers(ocfs_super *osb)
+int ocfs2_register_net_handlers(ocfs2_super *osb)
{
int i = OCFS2_VOL_UUID_LEN - sizeof(osb->net_key);
int status = 0;
@@ -998,4 +997,3 @@
return status;
}
-
Modified: trunk/fs/ocfs2/vote.h
===================================================================
--- trunk/fs/ocfs2/vote.h 2005-06-02 01:15:53 UTC (rev 2355)
+++ trunk/fs/ocfs2/vote.h 2005-06-02 03:50:59 UTC (rev 2356)
@@ -28,7 +28,7 @@
#define VOTE_H
int ocfs2_vote_thread(void *arg);
-static inline void ocfs2_kick_vote_thread(ocfs_super *osb)
+static inline void ocfs2_kick_vote_thread(ocfs2_super *osb)
{
spin_lock(&osb->vote_task_lock);
/* make sure the voting thread gets a swipe at whatever changes
@@ -42,11 +42,11 @@
int ocfs2_request_unlink_vote(struct inode *inode,
unsigned int nlink);
int ocfs2_request_rename_vote(struct inode *inode);
-int ocfs2_request_mount_vote(ocfs_super *osb);
-int ocfs2_request_umount_vote(ocfs_super *osb);
-int ocfs2_register_net_handlers(ocfs_super *osb);
-void ocfs2_unregister_net_handlers(ocfs_super *osb);
+int ocfs2_request_mount_vote(ocfs2_super *osb);
+int ocfs2_request_umount_vote(ocfs2_super *osb);
+int ocfs2_register_net_handlers(ocfs2_super *osb);
+void ocfs2_unregister_net_handlers(ocfs2_super *osb);
-void ocfs2_remove_node_from_vote_queues(ocfs_super *osb,
+void ocfs2_remove_node_from_vote_queues(ocfs2_super *osb,
int node_num);
#endif
More information about the Ocfs2-commits
mailing list