From: Mark Fasheh <mfasheh@suse.com>
To: linux-kernel@vger.kernel.org
Cc: joel.becker@oracle.com, ocfs2-devel@oss.oracle.com,
linux-fsdevel@vger.kernel.org, Mark Fasheh <mfasheh@suse.com>
Subject: [PATCH 22/39] ocfs2: Prefix the extent tree operations structure.
Date: Wed, 24 Sep 2008 15:01:03 -0700 [thread overview]
Message-ID: <1222293680-15451-23-git-send-email-mfasheh@suse.com> (raw)
In-Reply-To: <1222293680-15451-1-git-send-email-mfasheh@suse.com>
From: Joel Becker <joel.becker@oracle.com>
The ocfs2_extent_tree_operations structure gains a field prefix on its
members. The ->eo_sanity_check() operation gains a wrapper function for
completeness. All of the extent tree operation wrappers gain a
consistent name (ocfs2_et_*()).
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
---
fs/ocfs2/alloc.c | 85 +++++++++++++++++++++++++++++------------------------
1 files changed, 46 insertions(+), 39 deletions(-)
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 16879bd..9fe49f2 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -65,12 +65,13 @@
struct ocfs2_extent_tree;
struct ocfs2_extent_tree_operations {
- void (*set_last_eb_blk) (struct ocfs2_extent_tree *et, u64 blkno);
- u64 (*get_last_eb_blk) (struct ocfs2_extent_tree *et);
- void (*update_clusters) (struct inode *inode,
- struct ocfs2_extent_tree *et,
- u32 new_clusters);
- int (*sanity_check) (struct inode *inode, struct ocfs2_extent_tree *et);
+ void (*eo_set_last_eb_blk)(struct ocfs2_extent_tree *et,
+ u64 blkno);
+ u64 (*eo_get_last_eb_blk)(struct ocfs2_extent_tree *et);
+ void (*eo_update_clusters)(struct inode *inode,
+ struct ocfs2_extent_tree *et,
+ u32 new_clusters);
+ int (*eo_sanity_check)(struct inode *inode, struct ocfs2_extent_tree *et);
};
struct ocfs2_extent_tree {
@@ -132,10 +133,10 @@ static int ocfs2_dinode_sanity_check(struct inode *inode,
}
static struct ocfs2_extent_tree_operations ocfs2_dinode_et_ops = {
- .set_last_eb_blk = ocfs2_dinode_set_last_eb_blk,
- .get_last_eb_blk = ocfs2_dinode_get_last_eb_blk,
- .update_clusters = ocfs2_dinode_update_clusters,
- .sanity_check = ocfs2_dinode_sanity_check,
+ .eo_set_last_eb_blk = ocfs2_dinode_set_last_eb_blk,
+ .eo_get_last_eb_blk = ocfs2_dinode_get_last_eb_blk,
+ .eo_update_clusters = ocfs2_dinode_update_clusters,
+ .eo_sanity_check = ocfs2_dinode_sanity_check,
};
static void ocfs2_xattr_value_set_last_eb_blk(struct ocfs2_extent_tree *et,
@@ -172,10 +173,10 @@ static int ocfs2_xattr_value_sanity_check(struct inode *inode,
}
static struct ocfs2_extent_tree_operations ocfs2_xattr_et_ops = {
- .set_last_eb_blk = ocfs2_xattr_value_set_last_eb_blk,
- .get_last_eb_blk = ocfs2_xattr_value_get_last_eb_blk,
- .update_clusters = ocfs2_xattr_value_update_clusters,
- .sanity_check = ocfs2_xattr_value_sanity_check,
+ .eo_set_last_eb_blk = ocfs2_xattr_value_set_last_eb_blk,
+ .eo_get_last_eb_blk = ocfs2_xattr_value_get_last_eb_blk,
+ .eo_update_clusters = ocfs2_xattr_value_update_clusters,
+ .eo_sanity_check = ocfs2_xattr_value_sanity_check,
};
static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et,
@@ -214,10 +215,10 @@ static int ocfs2_xattr_tree_sanity_check(struct inode *inode,
}
static struct ocfs2_extent_tree_operations ocfs2_xattr_tree_et_ops = {
- .set_last_eb_blk = ocfs2_xattr_tree_set_last_eb_blk,
- .get_last_eb_blk = ocfs2_xattr_tree_get_last_eb_blk,
- .update_clusters = ocfs2_xattr_tree_update_clusters,
- .sanity_check = ocfs2_xattr_tree_sanity_check,
+ .eo_set_last_eb_blk = ocfs2_xattr_tree_set_last_eb_blk,
+ .eo_get_last_eb_blk = ocfs2_xattr_tree_get_last_eb_blk,
+ .eo_update_clusters = ocfs2_xattr_tree_update_clusters,
+ .eo_sanity_check = ocfs2_xattr_tree_sanity_check,
};
static struct ocfs2_extent_tree*
@@ -265,22 +266,28 @@ static void ocfs2_free_extent_tree(struct ocfs2_extent_tree *et)
}
}
-static inline void ocfs2_set_last_eb_blk(struct ocfs2_extent_tree *et,
- u64 new_last_eb_blk)
+static inline void ocfs2_et_set_last_eb_blk(struct ocfs2_extent_tree *et,
+ u64 new_last_eb_blk)
{
- et->eops->set_last_eb_blk(et, new_last_eb_blk);
+ et->eops->eo_set_last_eb_blk(et, new_last_eb_blk);
}
-static inline u64 ocfs2_get_last_eb_blk(struct ocfs2_extent_tree *et)
+static inline u64 ocfs2_et_get_last_eb_blk(struct ocfs2_extent_tree *et)
{
- return et->eops->get_last_eb_blk(et);
+ return et->eops->eo_get_last_eb_blk(et);
}
-static inline void ocfs2_update_clusters(struct inode *inode,
- struct ocfs2_extent_tree *et,
- u32 clusters)
+static inline void ocfs2_et_update_clusters(struct inode *inode,
+ struct ocfs2_extent_tree *et,
+ u32 clusters)
+{
+ et->eops->eo_update_clusters(inode, et, clusters);
+}
+
+static inline int ocfs2_et_sanity_check(struct inode *inode,
+ struct ocfs2_extent_tree *et)
{
- et->eops->update_clusters(inode, et, clusters);
+ return et->eops->eo_sanity_check(inode, et);
}
static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc);
@@ -913,7 +920,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
/* fe needs a new last extent block pointer, as does the
* next_leaf on the previously last-extent-block. */
- ocfs2_set_last_eb_blk(et, new_last_eb_blk);
+ ocfs2_et_set_last_eb_blk(et, new_last_eb_blk);
eb = (struct ocfs2_extent_block *) (*last_eb_bh)->b_data;
eb->h_next_leaf_blk = cpu_to_le64(new_last_eb_blk);
@@ -1029,7 +1036,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
/* If this is our 1st tree depth shift, then last_eb_blk
* becomes the allocated extent block */
if (root_el->l_tree_depth == cpu_to_le16(1))
- ocfs2_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
+ ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
status = ocfs2_journal_dirty(handle, et->root_bh);
if (status < 0) {
@@ -2436,7 +2443,7 @@ static int ocfs2_rotate_subtree_left(struct inode *inode, handle_t *handle,
ocfs2_update_edge_lengths(inode, handle, left_path);
eb = (struct ocfs2_extent_block *)path_leaf_bh(left_path)->b_data;
- ocfs2_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
+ ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
/*
* Removal of the extent in the left leaf was skipped
@@ -2697,7 +2704,7 @@ static int ocfs2_remove_rightmost_path(struct inode *inode, handle_t *handle,
struct ocfs2_extent_list *el;
- ret = et->eops->sanity_check(inode, et);
+ ret = ocfs2_et_sanity_check(inode, et);
if (ret)
goto out;
/*
@@ -2756,7 +2763,7 @@ static int ocfs2_remove_rightmost_path(struct inode *inode, handle_t *handle,
ocfs2_update_edge_lengths(inode, handle, left_path);
eb = (struct ocfs2_extent_block *)path_leaf_bh(left_path)->b_data;
- ocfs2_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
+ ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
} else {
/*
* 'path' is also the leftmost path which
@@ -2772,7 +2779,7 @@ static int ocfs2_remove_rightmost_path(struct inode *inode, handle_t *handle,
el->l_next_free_rec = 0;
memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
- ocfs2_set_last_eb_blk(et, 0);
+ ocfs2_et_set_last_eb_blk(et, 0);
}
ocfs2_journal_dirty(handle, path_root_bh(path));
@@ -3989,8 +3996,8 @@ static int ocfs2_do_insert_extent(struct inode *inode,
out_update_clusters:
if (type->ins_split == SPLIT_NONE)
- ocfs2_update_clusters(inode, et,
- le16_to_cpu(insert_rec->e_leaf_clusters));
+ ocfs2_et_update_clusters(inode, et,
+ le16_to_cpu(insert_rec->e_leaf_clusters));
ret = ocfs2_journal_dirty(handle, et->root_bh);
if (ret)
@@ -4238,7 +4245,7 @@ static int ocfs2_figure_insert_type(struct inode *inode,
* may want it later.
*/
ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
- ocfs2_get_last_eb_blk(et), &bh,
+ ocfs2_et_get_last_eb_blk(et), &bh,
OCFS2_BH_CACHED, inode);
if (ret) {
mlog_exit(ret);
@@ -4315,7 +4322,7 @@ static int ocfs2_figure_insert_type(struct inode *inode,
* the case that we're doing a tail append, so maybe we can
* take advantage of that information somehow.
*/
- if (ocfs2_get_last_eb_blk(et) ==
+ if (ocfs2_et_get_last_eb_blk(et) ==
path_leaf_bh(path)->b_blocknr) {
/*
* Ok, ocfs2_find_path() returned us the rightmost
@@ -4823,7 +4830,7 @@ static int __ocfs2_mark_extent_written(struct inode *inode,
struct ocfs2_extent_block *eb;
ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
- ocfs2_get_last_eb_blk(et),
+ ocfs2_et_get_last_eb_blk(et),
&last_eb_bh, OCFS2_BH_CACHED, inode);
if (ret) {
mlog_exit(ret);
@@ -4990,7 +4997,7 @@ static int ocfs2_split_tree(struct inode *inode, struct ocfs2_extent_tree *et,
depth = path->p_tree_depth;
if (depth > 0) {
ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
- ocfs2_get_last_eb_blk(et),
+ ocfs2_et_get_last_eb_blk(et),
&last_eb_bh, OCFS2_BH_CACHED, inode);
if (ret < 0) {
mlog_errno(ret);
--
1.5.4.5
next prev parent reply other threads:[~2008-09-24 22:07 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 22:00 [PATCH 0/39] Ocfs2 updates for 2.6.28 Mark Fasheh
2008-09-24 22:00 ` [PATCH 01/39] ocfs2: POSIX file locks support Mark Fasheh
2008-10-02 6:11 ` Andrew Morton
2008-10-07 20:09 ` Mark Fasheh
2008-09-24 22:00 ` [PATCH 02/39] ocfs2: Track local alloc bits internally Mark Fasheh
2008-09-24 22:00 ` [PATCH 03/39] ocfs2: throttle back local alloc when low on disk space Mark Fasheh
2008-10-02 6:11 ` Andrew Morton
2008-09-24 22:00 ` [PATCH 04/39] ocfs2: track local alloc state via debugfs Mark Fasheh
2008-10-02 6:11 ` Andrew Morton
2008-10-07 20:10 ` Mark Fasheh
2008-09-24 22:00 ` [PATCH 05/39] ocfs2: Modify ocfs2_num_free_extents for future xattr usage Mark Fasheh
2008-09-24 22:00 ` [PATCH 06/39] ocfs2: Use ocfs2_extent_list instead of ocfs2_dinode Mark Fasheh
2008-09-24 22:00 ` [PATCH 07/39] ocfs2: Abstract ocfs2_extent_tree in b-tree operations Mark Fasheh
2008-09-24 22:00 ` [PATCH 08/39] ocfs2: Make high level btree extend code generic Mark Fasheh
2008-09-24 22:00 ` [PATCH 09/39] ocfs2: Add the basic xattr disk layout in ocfs2_fs.h Mark Fasheh
2008-09-24 22:00 ` [PATCH 10/39] ocfs2: Add helper function in uptodate.c for removing xattr clusters Mark Fasheh
2008-10-02 6:11 ` Andrew Morton
2008-10-07 20:18 ` Mark Fasheh
2008-09-24 22:00 ` [PATCH 11/39] ocfs2: Add extent tree operation for xattr value btrees Mark Fasheh
2008-10-02 6:12 ` Andrew Morton
2008-10-07 20:19 ` Mark Fasheh
2008-10-02 6:12 ` Andrew Morton
2008-10-07 21:19 ` Mark Fasheh
2008-09-24 22:00 ` [PATCH 12/39] ocfs2: reserve inline space for extended attribute Mark Fasheh
2008-09-24 22:00 ` [PATCH 13/39] ocfs2: Add extended attribute support Mark Fasheh
2008-10-02 6:12 ` Andrew Morton
2008-10-07 20:22 ` Mark Fasheh
2008-10-02 8:16 ` [Ocfs2-devel] " Christoph Hellwig
2008-10-07 22:08 ` Mark Fasheh
2008-10-08 1:56 ` Tiger Yang
2008-10-08 13:16 ` Christoph Hellwig
2008-10-08 13:34 ` Christoph Hellwig
2008-10-08 14:04 ` Tao Ma
2008-10-09 0:38 ` Mark Fasheh
2008-10-08 13:22 ` Christoph Hellwig
2008-09-24 22:00 ` [PATCH 14/39] ocfs2: Add xattr index tree operations Mark Fasheh
2008-09-24 22:00 ` [PATCH 15/39] ocfs2: Add xattr bucket iteration for large numbers of EAs Mark Fasheh
2008-09-24 22:00 ` [PATCH 16/39] ocfs2: Add xattr lookup code xattr btrees Mark Fasheh
2008-09-24 22:00 ` [PATCH 17/39] ocfs2: Optionally limit extent size in ocfs2_insert_extent() Mark Fasheh
2008-09-24 22:00 ` [PATCH 18/39] ocfs2: Enable xattr set in index btree Mark Fasheh
2008-09-24 22:01 ` [PATCH 19/39] ocfs2: Delete all xattr buckets during inode removal Mark Fasheh
2008-09-24 22:01 ` [PATCH 20/39] ocfs2: Add incompatible flag for extended attribute Mark Fasheh
2008-09-24 22:01 ` [PATCH 21/39] ocfs2: fix printk format warnings Mark Fasheh
2008-09-24 22:01 ` Mark Fasheh [this message]
2008-09-24 22:01 ` [PATCH 23/39] ocfs2: Prefix the ocfs2_extent_tree structure Mark Fasheh
2008-09-24 22:01 ` [PATCH 24/39] ocfs2: Make ocfs2_extent_tree get/put instead of alloc Mark Fasheh
2008-09-24 22:01 ` [PATCH 25/39] ocfs2: Make 'private' into 'object' on ocfs2_extent_tree Mark Fasheh
2008-09-24 22:01 ` [PATCH 26/39] ocfs2: Provide the get_root_el() method to ocfs2_extent_tree_operations Mark Fasheh
2008-09-24 22:01 ` [PATCH 27/39] ocfs2: Use struct ocfs2_extent_tree in ocfs2_num_free_extents() Mark Fasheh
2008-09-24 22:01 ` [PATCH 28/39] ocfs2: Determine an extent tree's max_leaf_clusters in an et_op Mark Fasheh
2008-09-24 22:01 ` [PATCH 29/39] ocfs2: Create specific get_extent_tree functions Mark Fasheh
2008-09-24 22:01 ` [PATCH 30/39] ocfs2: Add an insertion check to ocfs2_extent_tree_operations Mark Fasheh
2008-09-24 22:01 ` [PATCH 31/39] ocfs2: Make ocfs2_extent_tree the first-class representation of a tree Mark Fasheh
2008-09-24 22:01 ` [PATCH 32/39] ocfs2: Comment struct ocfs2_extent_tree_operations Mark Fasheh
2008-09-24 22:01 ` [PATCH 33/39] ocfs2: Change ocfs2_get_*_extent_tree() to ocfs2_init_*_extent_tree() Mark Fasheh
2008-09-24 22:01 ` [PATCH 34/39] ocfs2: bug-fix for journal extend in xattr Mark Fasheh
2008-09-24 22:01 ` [PATCH 35/39] ocfs2: Resolve deadlock in ocfs2_xattr_free_block Mark Fasheh
2008-09-24 22:01 ` [PATCH 36/39] ocfs2: Limit inode allocation to 32bits Mark Fasheh
2008-09-24 22:01 ` [PATCH 37/39] ocfs2: Add the 'inode64' mount option Mark Fasheh
2008-09-24 22:01 ` [PATCH 38/39] ocfs2: Switch over to JBD2 Mark Fasheh
2008-09-24 22:01 ` [PATCH 39/39] ocfs2: Add xattr mount option in ocfs2_show_options() Mark Fasheh
2008-09-28 5:16 ` [PATCH 0/39] Ocfs2 updates for 2.6.28 Tao Ma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1222293680-15451-23-git-send-email-mfasheh@suse.com \
--to=mfasheh@suse.com \
--cc=joel.becker@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®