summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-23 15:56:19 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-23 15:56:19 -0400
commit7f5c15160e1436a53d01f9190db11c2a3a4d788a (patch)
treeae9894ab743aca4ff4c1f50ada5a5ed665a88c21 /fs/btrfs/ctree.h
parentdf2ce34c8801af8e00c7f82435fcb1e4b45a2759 (diff)
downloadop-kernel-dev-7f5c15160e1436a53d01f9190db11c2a3a4d788a.zip
op-kernel-dev-7f5c15160e1436a53d01f9190db11c2a3a4d788a.tar.gz
Add generation number to btrfs_header, readdir fixes, hash collision fixes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 983e3cc..96cec63 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -52,6 +52,7 @@ struct btrfs_key {
struct btrfs_header {
u8 fsid[16]; /* FS specific uuid */
__le64 blocknr; /* which block this node is supposed to live in */
+ __le64 generation;
__le64 parentid; /* objectid of the tree root */
__le32 csum;
__le32 ham;
@@ -600,6 +601,17 @@ static inline void btrfs_set_header_blocknr(struct btrfs_header *h, u64 blocknr)
h->blocknr = cpu_to_le64(blocknr);
}
+static inline u64 btrfs_header_generation(struct btrfs_header *h)
+{
+ return le64_to_cpu(h->generation);
+}
+
+static inline void btrfs_set_header_generation(struct btrfs_header *h,
+ u64 val)
+{
+ h->generation = cpu_to_le64(val);
+}
+
static inline u64 btrfs_header_parentid(struct btrfs_header *h)
{
return le64_to_cpu(h->parentid);
@@ -839,7 +851,7 @@ int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
*root, struct btrfs_path *path, u64 dir,
const char *name, int name_len, int mod);
int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path,
- char *name, int name_len);
+ const char *name, int name_len);
int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
struct btrfs_root *fs_root,
u64 dirid, u64 *objectid);
OpenPOWER on IntegriCloud