summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason2007-03-23 20:56:19 +0100
committerDavid Woodhouse2007-03-23 20:56:19 +0100
commit7f5c15160e1436a53d01f9190db11c2a3a4d788a (patch)
treeae9894ab743aca4ff4c1f50ada5a5ed665a88c21 /fs/btrfs/ctree.h
parentBtrfs: properly set new buffers for new blocks up to date (diff)
downloadkernel-qcow2-linux-7f5c15160e1436a53d01f9190db11c2a3a4d788a.tar.gz
kernel-qcow2-linux-7f5c15160e1436a53d01f9190db11c2a3a4d788a.tar.xz
kernel-qcow2-linux-7f5c15160e1436a53d01f9190db11c2a3a4d788a.zip
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 983e3cc9ae9f..96cec6352f12 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);