Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165112
b: refs/heads/master
c: e73a819
h: refs/heads/master
v: v3
  • Loading branch information
Tao Ma authored and Joel Becker committed Sep 23, 2009
1 parent 0f47467 commit 644e33b
Show file tree
Hide file tree
Showing 5 changed files with 1,074 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2e9f6082b5ff099978774d5c0148e062344c2f9
refs/heads/master: e73a819db9c2d6c4065b7cab7374709b6939e8f1
15 changes: 8 additions & 7 deletions trunk/fs/ocfs2/extent_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@ static int ocfs2_search_for_hole_index(struct ocfs2_extent_list *el,
* eb_bh is NULL. Otherwise, eb_bh should point to the extent block
* containing el.
*/
static int ocfs2_figure_hole_clusters(struct inode *inode,
struct ocfs2_extent_list *el,
struct buffer_head *eb_bh,
u32 v_cluster,
u32 *num_clusters)
int ocfs2_figure_hole_clusters(struct ocfs2_caching_info *ci,
struct ocfs2_extent_list *el,
struct buffer_head *eb_bh,
u32 v_cluster,
u32 *num_clusters)
{
int ret, i;
struct buffer_head *next_eb_bh = NULL;
Expand All @@ -375,7 +375,7 @@ static int ocfs2_figure_hole_clusters(struct inode *inode,
if (le64_to_cpu(eb->h_next_leaf_blk) == 0ULL)
goto no_more_extents;

ret = ocfs2_read_extent_block(INODE_CACHE(inode),
ret = ocfs2_read_extent_block(ci,
le64_to_cpu(eb->h_next_leaf_blk),
&next_eb_bh);
if (ret) {
Expand Down Expand Up @@ -456,7 +456,8 @@ static int ocfs2_get_clusters_nocache(struct inode *inode,
* field.
*/
if (hole_len) {
ret = ocfs2_figure_hole_clusters(inode, el, eb_bh,
ret = ocfs2_figure_hole_clusters(INODE_CACHE(inode),
el, eb_bh,
v_cluster, &len);
if (ret) {
mlog_errno(ret);
Expand Down
5 changes: 5 additions & 0 deletions trunk/fs/ocfs2/extent_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ int ocfs2_read_virt_blocks(struct inode *inode, u64 v_block, int nr,
struct buffer_head *bhs[], int flags,
int (*validate)(struct super_block *sb,
struct buffer_head *bh));
int ocfs2_figure_hole_clusters(struct ocfs2_caching_info *ci,
struct ocfs2_extent_list *el,
struct buffer_head *eb_bh,
u32 v_cluster,
u32 *num_clusters);
static inline int ocfs2_read_virt_block(struct inode *inode, u64 v_block,
struct buffer_head **bh,
int (*validate)(struct super_block *sb,
Expand Down
7 changes: 7 additions & 0 deletions trunk/fs/ocfs2/ocfs2_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@ struct ocfs2_refcount_rec {
__le32 r_refcount; /* Reference count of this extent */
/*10*/
};
#define OCFS2_32BIT_POS_MASK (0xffffffffULL)

#define OCFS2_REFCOUNT_LEAF_FL (0x00000001)
#define OCFS2_REFCOUNT_TREE_FL (0x00000002)
Expand Down Expand Up @@ -1394,6 +1395,12 @@ static inline u16 ocfs2_refcount_recs_per_rb(struct super_block *sb)

return size / sizeof(struct ocfs2_refcount_rec);
}

static inline u32
ocfs2_get_ref_rec_low_cpos(const struct ocfs2_refcount_rec *rec)
{
return le64_to_cpu(rec->r_cpos) & OCFS2_32BIT_POS_MASK;
}
#else
static inline int ocfs2_fast_symlink_chars(int blocksize)
{
Expand Down
Loading

0 comments on commit 644e33b

Please sign in to comment.