aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dir-item.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-05 10:38:44 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-05 10:38:44 -0400
commit5f26f772e5c4e833ffcb0599f54deda466d2a3e5 (patch)
tree2ef0183b42e2bd51feff52c2e6f97570514907b9 /fs/btrfs/dir-item.c
parentbae45de03c4d54a9893dedf8a015beb2608b896a (diff)
Btrfs: more inode indexed directory work
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/dir-item.c')
-rw-r--r--fs/btrfs/dir-item.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
index 2a87e23ac9c9..62d0c0916a73 100644
--- a/fs/btrfs/dir-item.c
+++ b/fs/btrfs/dir-item.c
@@ -80,6 +80,24 @@ int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
80 return ret; 80 return ret;
81} 81}
82 82
83int btrfs_lookup_dir_index_item(struct btrfs_trans_handle *trans,
84 struct btrfs_root *root,
85 struct btrfs_path *path, u64 dir,
86 u64 objectid, int mod)
87{
88 int ret;
89 struct btrfs_key key;
90 int ins_len = mod < 0 ? -1 : 0;
91 int cow = mod != 0;
92
93 key.objectid = dir;
94 key.flags = 0;
95 btrfs_set_key_type(&key, BTRFS_DIR_INDEX_KEY);
96 key.offset = objectid;
97 ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow);
98 return ret;
99}
100
83int btrfs_match_dir_item_name(struct btrfs_root *root, 101int btrfs_match_dir_item_name(struct btrfs_root *root,
84 struct btrfs_path *path, 102 struct btrfs_path *path,
85 const char *name, int name_len) 103 const char *name, int name_len)