Displaying 15 results from an estimated 15 matches for "btrfs_set_key_typ".
Did you mean:
btrfs_set_key_type
2008 Jul 20
26
[PATCH] NFS support for btrfs - v2
...ngth itself for the type */
+ return len;
+
+}
+
+static struct dentry * btrfs_get_dentry(struct super_block *sb,
+ u64 objectid, u64 root_objectid, u32 generation)
+{
+ struct btrfs_root *root;
+ struct inode *inode;
+ struct dentry *result;
+ struct btrfs_key key;
+
+ key.objectid = objectid;
+ btrfs_set_key_type(&key, BTRFS_INODE_REF_KEY);
+ key.offset = 0;
+
+ root = btrfs_lookup_fs_root(btrfs_sb(sb)->fs_info, root_objectid);
+ inode = btrfs_iget(sb, &key, root, NULL);
+ if (IS_ERR(inode))
+ return (void *)inode;
+
+ if(generation != inode->i_generation) {
+ iput(inode);
+ return ERR_PTR...
2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
...y;
+ struct btrfs_dir_item *dir_item;
+ struct btrfs_path *path;
+ struct btrfs_key key;
+ struct extent_buffer *leaf;
+ unsigned long name_ptr;
+ const char *name = ".orphandir";
+ int name_len = strlen(name);
+ int ret = 0;
+ u32 data_size;
+
+ key.objectid = root->inode->i_ino;
+ btrfs_set_key_type(&key, BTRFS_ORPHAN_DIR_ITEM_KEY);
+ key.offset = btrfs_name_hash(name, name_len);
+ path = btrfs_alloc_path();
+ data_size = sizeof(*dir_item) + name_len;
+ dir_item = insert_with_overflow(trans, root, path, &key,
+ data_size, name, name_len);
+ if (IS_ERR(dir_item)) {
+ ret = PTR_ERR...
2008 Aug 28
0
[PATCH] btrfs: cleanup d_obtain_alias useage
...y *btrfs_get_parent(struct dentry *child)
{
struct inode *dir = child->d_inode;
- struct inode *inode;
- struct dentry *parent;
struct btrfs_root *root = BTRFS_I(dir)->root;
struct btrfs_key key;
struct btrfs_path *path;
@@ -203,13 +196,7 @@ static struct dentry *btrfs_get_parent(s
btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY);
key.offset = 0;
- inode = btrfs_iget(root->fs_info->sb, &key, root, NULL);
-
- parent = d_obtain_alias(inode);
- if (!parent)
- parent = ERR_PTR(-ENOMEM);
-
- return parent;
+ return d_obtain_alias(btrfs_iget(root->fs_info->sb, &key, root,...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...th,
const char *name, u16 name_len,
const void *data, u16 data_len)
{
@@ -81,13 +84,13 @@ int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans,
BUG_ON(name_len + data_len > BTRFS_MAX_XATTR_SIZE(root));
- key.objectid = objectid;
+ key.objectid = btrfs_ino(inode);
btrfs_set_key_type(&key, BTRFS_XATTR_ITEM_KEY);
key.offset = btrfs_name_hash(name, name_len);
data_size = sizeof(*dir_item) + name_len + data_len;
- dir_item = insert_with_overflow(trans, root, path, &key, data_size,
- name, name_len);
+ dir_item = insert_with_overflow(trans, root, inode, path, &am...
2008 Jan 07
1
[PATCH]Add rollback support for the converter
...extent_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
u64 bytenr, u64 num_bytes)
{
@@ -726,8 +739,8 @@ static int lookup_extent_ref(struct btrf
btrfs_init_path(&path);
key.objectid = bytenr;
- key.type = BTRFS_EXTENT_ITEM_KEY;
key.offset = num_bytes;
+ btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY);
ret = btrfs_search_slot(trans, root->fs_info->extent_root,
&key, &path, 0, 0);
btrfs_release_path(root, &path);
@@ -738,6 +751,9 @@ static int lookup_extent_ref(struct btrf
* Construct a range of ext2fs image file.
* scan block alloc...
2010 Mar 20
2
[PATCH 4/4] btrfs-convert: split into convert/.
...(dirent->name, dotdot, dirent->name_len)) {
- if (dirent->name_len == 2) {
- BUG_ON(idata->parent != 0);
- idata->parent = objectid;
- }
- return 0;
- }
- if (dirent->inode < EXT2_GOOD_OLD_FIRST_INO)
- return 0;
-
- location.objectid = objectid;
- location.offset = 0;
- btrfs_set_key_type(&location, BTRFS_INODE_ITEM_KEY);
-
- file_type = dirent->file_type;
- BUG_ON(file_type > EXT2_FT_SYMLINK);
- ret = btrfs_insert_dir_item(idata->trans, idata->root,
- dirent->name, dirent->name_len,
- idata->objectid, &location,
- filetype_conversi...
2013 Mar 15
0
[PATCH] Btrfs-progs: add skinny metadata support to progs V3
...-git a/extent-tree.c b/extent-tree.c
index 85f5670..eede633 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -115,7 +115,8 @@ static int cache_block_group(struct btrfs_root *root,
last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET);
key.objectid = last;
key.offset = 0;
- btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY);
+ key.type = 0;
+
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0)
goto err;
@@ -142,14 +143,18 @@ static int cache_block_group(struct btrfs_root *root,
break;
}
- if (btrfs_key_type(&key) == BTRFS_EXTENT_ITEM_KEY) {...
2009 Nov 12
0
[PATCH 05/12] Btrfs: Avoid orphan inodes cleanup during replaying log
...fs_root *root)
struct inode *inode;
int ret = 0, nr_unlink = 0, nr_truncate = 0;
- path = btrfs_alloc_path();
- if (!path)
+ if (!xchg(&root->clean_orphans, 0))
return;
+
+ path = btrfs_alloc_path();
+ BUG_ON(!path);
path->reada = -1;
key.objectid = BTRFS_ORPHAN_OBJECTID;
btrfs_set_key_type(&key, BTRFS_ORPHAN_ITEM_KEY);
key.offset = (u64)-1;
-
while (1) {
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0) {
@@ -3293,6 +3294,11 @@ void btrfs_delete_inode(struct inode *inode)
}
btrfs_wait_ordered_range(inode, 0, (u64)-1);
+ if (root->fs_...
2009 Jul 07
0
[PATCH] speed up snapshot dropping
...:39:08.452836151 +0800
@@ -715,7 +715,8 @@ static noinline int create_pending_snaps
memcpy(new_root_item, &root->root_item, sizeof(*new_root_item));
key.objectid = objectid;
- key.offset = 0;
+ /* record when the snapshot was created in key.offset */
+ key.offset = trans->transid;
btrfs_set_key_type(&key, BTRFS_ROOT_ITEM_KEY);
old = btrfs_lock_root_node(root);
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
2011 Mar 23
0
[PATCH] Btrfs: cleanup some BUG_ON()
...nux-2.6.38.new/fs/btrfs/file-item.c 2011-03-23 11:28:09.000000000 +0900
@@ -48,7 +48,8 @@ int btrfs_insert_file_extent(struct btrf
struct extent_buffer *leaf;
path = btrfs_alloc_path();
- BUG_ON(!path);
+ if (!path)
+ return -ENOMEM;
file_key.objectid = objectid;
file_key.offset = pos;
btrfs_set_key_type(&file_key, BTRFS_EXTENT_DATA_KEY);
diff -urNp linux-2.6.38/fs/btrfs/inode-map.c linux-2.6.38.new/fs/btrfs/inode-map.c
--- linux-2.6.38/fs/btrfs/inode-map.c 2011-03-15 10:20:32.000000000 +0900
+++ linux-2.6.38.new/fs/btrfs/inode-map.c 2011-03-23 11:28:09.000000000 +0900
@@ -30,7 +30,8 @@ int bt...
2008 Oct 10
1
[PATCH] fix enospc when there is plenty of space
...ruct btrfs_block_group_cache *block_group = NULL;
int chunk_alloc_done = 0;
int empty_cluster = 2 * 1024 * 1024;
int allowed_chunk_alloc = 0;
+ struct list_head *head = NULL, *cur = NULL;
+ int loop = 0;
+ struct btrfs_space_info *space_info;
WARN_ON(num_bytes < root->sectorsize);
btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY);
+ ins->objectid = 0;
+ ins->offset = 0;
if (orig_root->ref_cows || empty_size)
allowed_chunk_alloc = 1;
@@ -2239,152 +2199,132 @@ static int noinline find_free_extent(struct btrfs_trans_handle *trans,
else
empty_size += empty_cluster;
}
-
sea...
2012 Mar 20
13
[PATCH 0 of 3 v2] PV-GRUB: add support for ext4 and btrfs
Hi,
The following patches add support for ext4 and btrfs to
PV-GRUB. These patches are taken nearly verbatim from those provided
by Fedora and Gentoo.
We''ve been using these patches for the PV-GRUB images available in EC2
for some time now with no problems.
Changes from v1:
- Makefile has been changed to check the exit code from patch
- The btrfs patch has been rebased to apply
2009 Nov 12
0
[PATCH 03/12] Btrfs: Rewrite btrfs_drop_extents
...p;& !encryption)
- ret = btrfs_truncate_item(trans, root, path,
- new_size, 0);
- BUG_ON(ret);
- }
- /* create bookend, splitting the extent in two */
- if (bookend && found_extent) {
- struct btrfs_key ins;
- ins.objectid = inode->i_ino;
- ins.offset = end;
- btrfs_set_key_type(&ins, BTRFS_EXTENT_DATA_KEY);
- btrfs_release_path(root, path);
- path->leave_spinning = 1;
- ret = btrfs_insert_empty_item(trans, root, path, &ins,
- sizeof(*extent));
- BUG_ON(ret);
+ search_start = extent_end;
+ /*
+ * | ---- range to drop ----- |
+ *...
2011 May 11
8
[PATCH 1/4] Btrfs: map the node block when looking for readahead targets
If we have particularly full nodes, we could call btrfs_node_blockptr up to 32
times, which is 32 pairs of kmap/kunmap, which _sucks_. So go ahead and map the
extent buffer while we look for readahead targets. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
---
fs/btrfs/ctree.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...um_bytes, u64 flags)
+{
+ struct btrfs_path *path;
+ int ret;
+ struct btrfs_key key;
+ struct extent_buffer *l;
+ struct btrfs_extent_item *item;
+
+ WARN_ON(num_bytes < root->sectorsize);
+ path = btrfs_alloc_path();
+ path->reada = 1;
+ key.objectid = bytenr;
+ key.offset = num_bytes;
+ btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY);
+ ret = btrfs_search_slot(trans, root->fs_info->extent_root, &key, path,
+ 0, 0);
+ if (ret < 0)
+ goto out;
+ if (ret != 0) {
+ btrfs_print_leaf(root, path->nodes[0]);
+ printk("failed to find block number %Lu\n", bytenr);
+ BUG()...