Displaying 13 results from an estimated 13 matches for "btrfs_super_info_offset".
2008 Jan 07
1
[PATCH]Add rollback support for the converter
...xt2fs.
+ * Migrate super block to it's default position and zero 0 ~ 16k
*/
-static int migrate_super_block(struct btrfs_root *root, u64 sb_offset)
-{
- int ret = -1;
- struct extent_buffer *old_eb;
- struct extent_buffer *sb_buffer;
- struct btrfs_trans_handle *trans;
-
- BUG_ON(sb_offset != BTRFS_SUPER_INFO_OFFSET);
- sb_buffer = read_tree_block(root, sb_offset, 512);
- if (!sb_buffer)
- goto fail;
- memset_extent_buffer(sb_buffer, 0, 0, sb_buffer->len);
- old_eb = root->fs_info->sb_buffer;
- root->fs_info->sb_buffer = sb_buffer;
- btrfs_set_super_bytenr(&root->fs_info->super_copy,...
2013 Mar 21
4
[PATCH] btrfs-progs: make btrfs dev scan multi path aware
...IUM &&
+ errno != EBUSY)
fprintf(stderr, "failed to read %s: %s\n",
fullpath, strerror(errno));
continue;
}
+ close(fd);
+
+ fd = open(fullpath, O_RDONLY);
ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,
&num_devices,
BTRFS_SUPER_INFO_OFFSET);
+ close(fd);
+
if (ret == 0 && run_ioctl > 0) {
btrfs_register_one_device(fullpath);
}
- close(fd);
}
if (!list_empty(&pending_list)) {
free(pending);
@@ -1442,19 +1449,29 @@ scan_again:
continue;
}
- fd = open(fullpath, O_RDONLY);
+ /* This will fail...
2009 Aug 26
0
btrfsctl -a doesn't find my btrfs
...sr0
I''m using btrfs-progs-unstable version
4f89b6eb0718ade63152791db32794da78fbba70. Am I doing something wrong or
misinterpreting how btrfsctl works?
I notice that "-a" does a:
ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,
&num_devices,
BTRFS_SUPER_INFO_OFFSET);
Whereas "-A" does a:
fd = open("/dev/btrfs-control", O_RDWR);
if (fd < 0) {
perror("failed to open /dev/btrfs-control");
exit(1);
}
Followed by a:
ret = ioctl(fd, BTRFS_IOC_SCAN_DEV, &args);
Should "-a" be taught t...
2009 Dec 21
0
[PATCH] btrfsctl: scan device and exit without using ioctl
...f (stderr, "failed to open %s: %s\n",
+ path, strerror (errno));
+ } else {
+
+ ret = btrfs_scan_one_device (fd, path, &fs_devices,
+ &dev_count,
+ BTRFS_SUPER_INFO_OFFSET);
+
+ close (fd);
+ }
+
+ return ret;
+}
+
int main(int ac, char **av)
{
char *fname = NULL;
@@ -201,12 +227,16 @@ int main(int ac, char **av)
fname = av[ac - 1];
if (command == BTRFS_IOC_SCAN_DEV) {
- fd = open("/dev/btrfs-control", O_RDWR);
- if...
2010 May 11
0
[PATCH 4/5] btrfs: don't cache empty block groups during mount
...OMEM;
- exclude_super_stripes(extent_root, block_group);
- spin_lock(&block_group->space_info->lock);
- block_group->space_info->bytes_super += block_group->bytes_super;
- spin_unlock(&block_group->space_info->lock);
-
last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET);
/*
@@ -7499,6 +7541,7 @@ int btrfs_free_block_groups(struct btrfs
if (block_group->cached == BTRFS_CACHE_STARTED)
wait_block_group_cache_done(block_group);
+ free_excluded_extents(info->extent_root, block_group);
btrfs_remove_free_space_cache(block_group);
btrfs_put_bloc...
2013 Sep 05
3
[PATCH v2 0/3] btrfs-progs: prevent mkfs from aborting with small volume
Here are 3 patches to avoid undesired aborts of mkfs.btrfs.
These are based on top of Chris''s btrfs-progs.git:
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
Thanks,
H.Seto
Hidetoshi Seto (3):
btrfs-progs: error if device for mkfs is too small
btrfs-progs: error if device have no space to make primary chunks
btrfs-progs: calculate available
2010 Dec 05
1
[PATCH 4/5][REPOST][BTRFS-PROGS] Avoid to scan cdrom and floppy
...cklist && !test_device(fullpath)){
+ continue;
+ }
+ fd = open(fullpath, O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "failed to read %s\n", fullpath);
+ continue;
+ }
+ ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,
+ &num_devices,
+ BTRFS_SUPER_INFO_OFFSET);
+ if (ret == 0 && run_ioctl > 0) {
+ btrfs_register_one_device(fullpath);
+ }
+ close(fd);
+ }
+
+ fclose(proc_partitions);
+ return 0;
+}
+
+int btrfs_scan_one_dir_checklist(char *dirname, int run_ioctl, int checklist)
{
DIR *dirp = NULL;
struct dirent *dirent;
@@ -848,6 +10...
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...ons(-)
diff --git a/extlinux/btrfs.h b/extlinux/btrfs.h
index 39a861a..be0c24e 100644
--- a/extlinux/btrfs.h
+++ b/extlinux/btrfs.h
@@ -1,6 +1,9 @@
#ifndef _BTRFS_H_
#define _BTRFS_H_
+#include <asm/types.h>
+#include <linux/ioctl.h>
+
#define BTRFS_SUPER_MAGIC 0x9123683E
#define BTRFS_SUPER_INFO_OFFSET (64 * 1024)
#define BTRFS_SUPER_INFO_SIZE 4096
@@ -8,6 +11,40 @@
#define BTRFS_CSUM_SIZE 32
#define BTRFS_FSID_SIZE 16
+typedef __u64 u64;
+typedef __u32 u32;
+typedef __u16 u16;
+typedef __u8 u8;
+typedef u64 __le64;
+typedef u16 __le16;
+
+#define BTRFS_ROOT_BACKREF_KEY 144
+#define BTRFS_R...
2013 Apr 03
0
[PATCH] Btrfs-progs: add a free space cache checker to fsck
...ct btrfs_block_group_cache *cache)
+{
+ struct btrfs_path *path;
+ struct extent_buffer *leaf;
+ struct btrfs_key key;
+ u64 last;
+ int ret = 0;
+
+ path = btrfs_alloc_path();
+ if (!path)
+ return -ENOMEM;
+
+ root = root->fs_info->extent_root;
+
+ last = max_t(u64, cache->key.objectid, BTRFS_SUPER_INFO_OFFSET);
+
+ key.objectid = last;
+ key.offset = 0;
+ key.type = BTRFS_EXTENT_ITEM_KEY;
+
+ ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
+ if (ret < 0)
+ return ret;
+ while (1) {
+ if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) {
+ ret = btrfs_next_leaf(root, pa...
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
2013 Mar 15
0
[PATCH] Btrfs-progs: add skinny metadata support to progs V3
...ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
diff --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;
}...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...OMEM;
exclude_super_stripes(extent_root, block_group);
+ spin_lock(&block_group->space_info->lock);
+ block_group->space_info->bytes_super += block_group->bytes_super;
+ spin_unlock(&block_group->space_info->lock);
last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET);
@@ -2069,7 +2073,11 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
if (root == root->fs_info->extent_root)
root = root->fs_info->tree_root;
+ BUG_ON(IS_ERR(trans));
delayed_refs = &trans->transaction->delayed_refs;
+ if (!delayed_refs->num_entr...
2011 Jul 18
5
[PATCH v3 0/5] btrfs-progs: scrub interface
This is the next patch series for scrub userland tools.
Change log v1->v2:
- commands now reachable as "btrfs scrub ..." instead of "btrfs filesystem
scrub ..."
- ability to scrub a single device instead of a whole file system
- superfluous command line options removed
- resume is now a separate command ("scrub resume") instead of "scrub start -r"
-