Skip to content

Commit 00dc417

Browse files
Mark Fashehtytso
authored andcommitted
ocfs2: fiemap support
Plug ocfs2 into ->fiemap. Some portions of ocfs2_get_clusters() had to be refactored so that the extent cache can be skipped in favor of going directly to the on-disk records. This makes it easier for us to determine which extent is the last one in the btree. Also, I'm not sure we want to be caching fiemap lookups anyway as they're not directly related to data read/write. Signed-off-by: Mark Fasheh <mfasheh@suse.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: ocfs2-devel@oss.oracle.com Cc: linux-fsdevel@vger.kernel.org
1 parent c4b929b commit 00dc417

5 files changed

Lines changed: 306 additions & 62 deletions

File tree

‎fs/ocfs2/alloc.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -989,15 +989,6 @@ static int ocfs2_grow_tree(struct inode *inode, handle_t *handle,
989989
return ret;
990990
}
991991

992-
/*
993-
* This is only valid for leaf nodes, which are the only ones that can
994-
* have empty extents anyway.
995-
*/
996-
static inline int ocfs2_is_empty_extent(struct ocfs2_extent_rec *rec)
997-
{
998-
return !rec->e_leaf_clusters;
999-
}
1000-
1001992
/*
1002993
* This function will discard the rightmost extent record.
1003994
*/

‎fs/ocfs2/alloc.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,13 @@ static inline unsigned int ocfs2_rec_clusters(struct ocfs2_extent_list *el,
146146
return le16_to_cpu(rec->e_leaf_clusters);
147147
}
148148

149+
/*
150+
* This is only valid for leaf nodes, which are the only ones that can
151+
* have empty extents anyway.
152+
*/
153+
static inline int ocfs2_is_empty_extent(struct ocfs2_extent_rec *rec)
154+
{
155+
return !rec->e_leaf_clusters;
156+
}
157+
149158
#endif /* OCFS2_ALLOC_H */

0 commit comments

Comments
 (0)