summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.h
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2008-10-03 23:32:11 +0200
committerTheodore Ts'o <tytso@mit.edu>2008-10-03 23:32:11 +0200
commit00dc417fa3e763345b34ccb6034d72de76eea0a1 (patch)
treec50da655dbd6747499f4516280f323b90214af62 /fs/ocfs2/alloc.h
parentvfs: vfs-level fiemap interface (diff)
downloadlinux-00dc417fa3e763345b34ccb6034d72de76eea0a1.tar.xz
linux-00dc417fa3e763345b34ccb6034d72de76eea0a1.zip
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
Diffstat (limited to 'fs/ocfs2/alloc.h')
-rw-r--r--fs/ocfs2/alloc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h
index 42ff94bd8011..60cd3d59230c 100644
--- a/fs/ocfs2/alloc.h
+++ b/fs/ocfs2/alloc.h
@@ -146,4 +146,13 @@ static inline unsigned int ocfs2_rec_clusters(struct ocfs2_extent_list *el,
return le16_to_cpu(rec->e_leaf_clusters);
}
+/*
+ * This is only valid for leaf nodes, which are the only ones that can
+ * have empty extents anyway.
+ */
+static inline int ocfs2_is_empty_extent(struct ocfs2_extent_rec *rec)
+{
+ return !rec->e_leaf_clusters;
+}
+
#endif /* OCFS2_ALLOC_H */