search for: btrfs_fs_devic

Displaying 20 results from an estimated 33 matches for "btrfs_fs_devic".

Did you mean: btrfs_fs_devices
2013 Jun 25
3
[PATCH] btrfs-progs: avoid memory leak in btrfs_close_devices
...int device_list_add(const char *path, return 0; } +static void btrfs_close_device(struct btrfs_device *device) +{ + close(device->fd); + device->fd = -1; + device->writeable = 0; + if (device->name) + kfree(device->name); + kfree(device); +} + int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) { struct btrfs_fs_devices *seed_devices; @@ -161,17 +171,17 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) again: list_for_each(cur, &fs_devices->devices) { device = list_entry(cur, struct btrfs_device, dev_list); - close(device->fd); - devi...
2011 Apr 20
4
[PATCH 1/5] Btrfs: fix bh leak on __btrfs_open_devices path
...rong@cn.fujitsu.com> --- fs/btrfs/volumes.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 8b9fb8c..69fc902 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -631,6 +631,7 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, list_add(&device->dev_alloc_list, &fs_devices->alloc_list); } + brelse(bh); continue; error_brelse: -- 1.7.4.4
2011 Sep 13
5
[PATCH] btrfs: trivial fix, a potential memory leak in btrfs_parse_early_options()
...s changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 15634d4..16f31e1 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -406,7 +406,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, u64 *subvol_rootid, struct btrfs_fs_devices **fs_devices) { substring_t args[MAX_OPT_ARGS]; - char *opts, *orig, *p; + char *device_name, *opts, *orig, *p; int error = 0; int intarg; @@ -457,8 +457,14 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, } break;...
2009 Nov 14
2
[PATCH] btrfs-progs: Check mount status of multidevice filesystems
.../volumes.c +++ b/volumes.c @@ -29,6 +29,7 @@ #include "transaction.h" #include "print-tree.h" #include "volumes.h" +#include "utils.h" struct stripe { struct btrfs_device *dev; @@ -164,7 +165,7 @@ again: return 0; } -int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, int flags) +int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, int flags, int check_mount) { int fd; struct list_head *head = &fs_devices->devices; @@ -175,6 +176,19 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, int flags) list_for_each(cur, he...
2010 Dec 05
1
[PATCH 4/5][REPOST][BTRFS-PROGS] Avoid to scan cdrom and floppy
...1,7 @@ int do_scan(int argc, char **argv) return 10; } - for( i = 1 ; i < argc ; i++ ){ + for( i = devstart ; i < argc ; i++ ){ struct btrfs_ioctl_vol_args args; int ret; @@ -666,15 +680,30 @@ int do_show_filesystem(int argc, char **argv) struct list_head *all_uuids; struct btrfs_fs_devices *fs_devices; struct list_head *cur_uuid; - char *search = argv[1]; + char *search=0; int ret; + int checklist = 1; + int searchstart = 1; - ret = btrfs_scan_one_dir("/dev", 0); + if( argc >= 2 && !strcmp(argv[1],"--all-devices")){ + checklist = 0; + searchst...
2009 Jan 16
4
[PATCH] Btrfs: simplify iteration codes
...ev_list); + list_for_each_entry(dev, head, dev_list) { if (dev->devid == devid && (!uuid || !memcmp(dev->uuid, uuid, BTRFS_UUID_SIZE))) { return dev; @@ -118,11 +116,9 @@ static noinline struct btrfs_device *__find_device(struct list_head *head, static noinline struct btrfs_fs_devices *find_fsid(u8 *fsid) { - struct list_head *cur; struct btrfs_fs_devices *fs_devices; - list_for_each(cur, &fs_uuids) { - fs_devices = list_entry(cur, struct btrfs_fs_devices, list); + list_for_each_entry(fs_devices, &fs_uuids, list) { if (memcmp(fsid, fs_devices->fsid, BTRFS_F...
2013 Oct 25
8
[PATCH] btrfs: add framework to read fs info from btrfs-control
...ULT; + + kfree(fslist_arg); + return ret; +} + /* * used by btrfsctl to scan devices when no FS is mounted */ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - struct btrfs_ioctl_vol_args *vol; + struct btrfs_ioctl_vol_args *vol = NULL; struct btrfs_fs_devices *fs_devices; int ret = -ENOTTY; + void __user *argp = (void __user *)arg; if (!capable(CAP_SYS_ADMIN)) return -EPERM; - vol = memdup_user((void __user *)arg, sizeof(*vol)); - if (IS_ERR(vol)) - return PTR_ERR(vol); - switch (cmd) { case BTRFS_IOC_SCAN_DEV: + vol = memdup_user((vo...
2011 Apr 06
3
[PATCH V2] Btrfs: fix subvolume mount by name problem when default mount subvolume is set
...case Opt_subvolid: + case Opt_subvolrootid: case Opt_device: /* * These are parsed by btrfs_parse_early_options @@ -385,7 +387,7 @@ out: */ static int btrfs_parse_early_options(const char *options, fmode_t flags, void *holder, char **subvol_name, u64 *subvol_objectid, - struct btrfs_fs_devices **fs_devices) + u64 *subvol_rootid, struct btrfs_fs_devices **fs_devices) { substring_t args[MAX_OPT_ARGS]; char *opts, *orig, *p; @@ -426,6 +428,18 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, *subvol_objectid = intarg; } break; + case Opt_subv...
2008 Jun 10
1
[PATCH, RFC] btrfs: allow scanning multiple devices during mount
...ed on much later in the mount process and * only when we need to allocate a new super block. */ -static int btrfs_parse_early_options(const char *options, - char **subvol_name) +static int btrfs_parse_early_options(const char *options, int flags, + void *holder, char **subvol_name, + struct btrfs_fs_devices **fs_devices) { substring_t args[MAX_OPT_ARGS]; char *opts, *p; @@ -240,11 +243,18 @@ static int btrfs_parse_early_options(con case Opt_subvol: *subvol_name = match_strdup(&args[0]); break; + case Opt_device: + error = btrfs_scan_one_device(match_strdup(&args[0]), +...
2011 May 02
5
[PATCH v3 0/3] btrfs: quasi-round-robin for chunk allocation
In a multi device setup, the chunk allocator currently always allocates chunks on the devices in the same order. This leads to a very uneven distribution, especially with RAID1 or RAID10 and an uneven number of devices. This patch always sorts the devices before allocating, and allocates the stripes on the devices with the most available space, as long as there is enough space available. In a low
2011 Apr 12
3
[PATCH v2 0/3] btrfs: quasi-round-robin for chunk allocation
In a multi device setup, the chunk allocator currently always allocates chunks on the devices in the same order. This leads to a very uneven distribution, especially with RAID1 or RAID10 and an uneven number of devices. This patch always sorts the devices before allocating, and allocates the stripes on the devices with the most available space, as long as there is enough space available. In a low
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" -
2013 Mar 09
4
[PATCH] use rcu_barrier() to wait for bdev puts at unmount
...ated putting it into close_ctree(); I don''t know if there'' anything else to wait for. Thoughts? diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 5cbb7f4..258316a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -680,6 +680,7 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) __btrfs_close_devices(fs_devices); free_fs_devices(fs_devices); } + rcu_barrier(); return ret; } -- 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...
2011 Dec 09
10
[PATCH 0/3] Btrfs: add IO error device stats
The goal is to detect when drives start to get an increased error rate, when drives should be replaced soon. Therefore statistic counters are added that count IO errors (read, write and flush). Additionally, the software detected errors like checksum errors and corrupted blocks are counted. An ioctl interface is added to get the device statistic counters. A second ioctl is added to atomically get
2009 Dec 21
0
[PATCH] btrfsctl: scan device and exit without using ioctl
...uot;version.h" +#include "disk-io.h" +#include "volumes.h" #ifdef __CHECKER__ #define BLKGETSIZE64 0 @@ -88,6 +90,30 @@ static int open_file_or_dir(const char *fname) } return fd; } + +int btrfs_scan_file (const char *path) +{ + int ret = -1; + struct btrfs_fs_devices *fs_devices = NULL; + u64 dev_count = 0; + int fd = -1; + + fd = open (path, O_RDONLY); + if (fd < 0) { + fprintf (stderr, "failed to open %s: %s\n", + path, strerror (errno)); + } else { + + ret...
2013 Sep 01
0
[PATCH] btrfs: use list_for_each_entry_safe() when delete items
...++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 78b8717..1d1b595 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -616,13 +616,13 @@ static void free_device(struct rcu_head *head) static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices) { - struct btrfs_device *device; + struct btrfs_device *device, *next; if (--fs_devices->opened > 0) return 0; mutex_lock(&fs_devices->device_list_mutex); - list_for_each_entry(device, &fs_devices->devices, dev_list) { + list_for_each_entry_safe(device...
2012 May 07
0
[PATCH V2] btrfs: fix message printing
...quot;btrfs: misc_deregister failed for control device\n"); } static int __init init_btrfs_fs(void) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 1411b99..79b603d 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -619,7 +619,7 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, bdev = blkdev_get_by_path(device->name, flags, holder); if (IS_ERR(bdev)) { - printk(KERN_INFO "open %s failed\n", device->name); + printk(KERN_INFO "btrfs: open %s failed\n", device->name); goto error; } filemap_write_and_wait(bdev-...
2011 Aug 06
0
help recover from unmountable btrfs
...+ (unsigned long long)eb->dev_bytenr + + offsetof (struct btrfs_header, generation)); ret = 1; out: clear_extent_buffer_uptodate(io_tree, eb); diff --git a/volumes.c b/volumes.c index 7671855..c30a3ba 100644 --- a/volumes.c +++ b/volumes.c @@ -188,6 +188,9 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, int flags) device->fd = fd; if (flags == O_RDWR) device->writeable = 1; + fprintf(stderr, "Device %llu (%s) opened in fd %i\n", + (unsigned long long)device->devid, + device->name, device->fd); } return 0; fail: -- 1.7.4.4 -- Alexandre...
2012 May 25
6
[PATCH v5 0/3] Btrfs: add IO error device stats
Changes v1-v2: - Remove restriction that BTRFS_IOC_GET_DEVICE_STATS is a privileged operation - Cast u64 to unsigned long long for printf() Changes v2-v3: - Rebased on Chris'' current master Changes v3-v4: - Add padding at end of ioctl structure Changes v4-v5: - The statistic members in the ioctl are now organized as an array of 64 bit values. Symbolic names for the array indexes
2012 Jan 11
12
[PATCH 00/11] Btrfs: some patches for 3.3
The biggest one is a fix for fstrim, and there''s a fix for on-disk free space cache. Others are small fixes and cleanups. The last three have been sent weeks ago. The patchset is also available in this repo: git://repo.or.cz/linux-btrfs-devel.git for-chris Note there''s a small confict with Al Viro''s vfs changes. Li Zefan (11): Btrfs: add pinned extents to