summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode-map.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-10-15 16:14:19 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:56 -0400
commit5f39d397dfbe140a14edecd4e73c34ce23c4f9ee (patch)
tree280561e4b68d573590557dd27df656869eed8023 /fs/btrfs/inode-map.c
parent50b78c24d594e6985f36a9a8d8e2fb74e1664e90 (diff)
downloadlinux-5f39d397dfbe140a14edecd4e73c34ce23c4f9ee.tar.gz
linux-5f39d397dfbe140a14edecd4e73c34ce23c4f9ee.tar.bz2
linux-5f39d397dfbe140a14edecd4e73c34ce23c4f9ee.zip
Btrfs: Create extent_buffer interface for large blocksizes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode-map.c')
-rw-r--r--fs/btrfs/inode-map.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c
index 405470866254..ab74977adf5c 100644
--- a/fs/btrfs/inode-map.c
+++ b/fs/btrfs/inode-map.c
@@ -24,8 +24,9 @@ int btrfs_find_highest_inode(struct btrfs_root *root, u64 *objectid)
{
struct btrfs_path *path;
int ret;
- struct btrfs_leaf *l;
+ struct extent_buffer *l;
struct btrfs_key search_key;
+ struct btrfs_key found_key;
int slot;
path = btrfs_alloc_path();
@@ -39,8 +40,9 @@ int btrfs_find_highest_inode(struct btrfs_root *root, u64 *objectid)
BUG_ON(ret == 0);
if (path->slots[0] > 0) {
slot = path->slots[0] - 1;
- l = btrfs_buffer_leaf(path->nodes[0]);
- *objectid = btrfs_disk_key_objectid(&l->items[slot].key);
+ l = path->nodes[0];
+ btrfs_item_key_to_cpu(l, &found_key, slot);
+ *objectid = found_key.objectid;
} else {
*objectid = BTRFS_FIRST_FREE_OBJECTID;
}
@@ -64,13 +66,12 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
int slot = 0;
u64 last_ino = 0;
int start_found;
- struct btrfs_leaf *l;
+ struct extent_buffer *l;
struct btrfs_key search_key;
u64 search_start = dirid;
path = btrfs_alloc_path();
BUG_ON(!path);
- search_key.flags = 0;
search_start = root->last_inode_alloc;
search_start = max(search_start, BTRFS_FIRST_FREE_OBJECTID);
search_key.objectid = search_start;
@@ -86,9 +87,9 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
path->slots[0]--;
while (1) {
- l = btrfs_buffer_leaf(path->nodes[0]);
+ l = path->nodes[0];
slot = path->slots[0];
- if (slot >= btrfs_header_nritems(&l->header)) {
+ if (slot >= btrfs_header_nritems(l)) {
ret = btrfs_next_leaf(root, path);
if (ret == 0)
continue;
@@ -103,7 +104,7 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
last_ino : search_start;
goto found;
}
- btrfs_disk_key_to_cpu(&key, &l->items[slot].key);
+ btrfs_item_key_to_cpu(l, &key, slot);
if (key.objectid >= search_start) {
if (start_found) {
if (last_ino < search_start)