Displaying 20 results from an estimated 64 matches for "num_devices".
2011 Nov 01
0
[PATCH] Btrfs-progs: change the way mkfs picks raid profiles
...btrfs_trans_handle *trans,
static int create_raid_groups(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 data_profile,
- u64 metadata_profile, int mixed)
+ int data_profile_opt, u64 metadata_profile,
+ int metadata_profile_opt, int mixed)
{
u64 num_devices = btrfs_super_num_devices(&root->fs_info->super_copy);
u64 allowed;
int ret;
+ /*
+ * Set default profiles according to number of added devices.
+ * For mixed groups defaults are single/single.
+ */
+ if (!metadata_profile_opt && !mixed) {
+ metadata_profile = (num_devic...
2007 Jul 10
1
Simple table generation question
...I'm
currently using a table of measurements I read in from a CSV file to
generate training and validation data set tables for future use in a machine
learning algorithm using the code:
#generate probabilities to divide up training / validation data sets
randomly
device_Prob_Vector <- runif(num_Devices)
#NULL-initialize training and validation sets. This seems like a bit of a
hack...
training_Set <- measurements[0]
validation_Set <- measurements[0]
#divide up the training and validation data sets from measurements.
for ( i in 1:num_Devices)
{
if ( device_Prob_Vector[i] > 0.5 )...
2013 Oct 25
8
[PATCH] btrfs: add framework to read fs info from btrfs-control
...case BTRFS_IOC_DEVICES_READY:
+ vol = memdup_user((void __user *)arg, sizeof(*vol));
+ if (IS_ERR(vol))
+ return PTR_ERR(vol);
ret = btrfs_scan_one_device(vol->name, FMODE_READ,
&btrfs_fs_type, &fs_devices);
+ kfree(vol);
if (ret)
break;
ret = !(fs_devices->num_devices == fs_devices->total_devices);
break;
+ case BTRFS_IOC_GET_FSLIST:
+ ret = btrfs_ioc_get_fslist(argp);
+ break;
}
- kfree(vol);
return ret;
}
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index fe0f2ef..a7b8f26 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -628...
2009 Aug 05
3
RAID[56] with arbitrary numbers of "parity" stripes.
...K) |
+ nr_spares << 56;
+ }
}
static void set_block_group_readonly(struct btrfs_block_group_cache *cache)
@@ -2643,27 +2653,27 @@ static void set_block_group_readonly(struct btrfs_block_group_cache *cache)
u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags)
{
u64 num_devices = root->fs_info->fs_devices->rw_devices;
+ u64 num_spares = flags >> 56;
u64 tmp;
/* First, mask out the RAID levels which aren''t possible */
if (num_devices == 1)
flags &= ~(BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID0 |
- BTRFS_BLOCK_GROUP_RAID5);...
2013 Mar 02
1
[PATCH] btrfs: return EPERM in btrfs_rm_device()
...), 4 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 5cbb7f4..3e1586c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1392,14 +1392,14 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
if ((all_avail & BTRFS_BLOCK_GROUP_RAID10) && num_devices <= 4) {
printk(KERN_ERR "btrfs: unable to go below four devices "
"on raid10\n");
- ret = -EINVAL;
+ ret = -EPERM;
goto out;
}
if ((all_avail & BTRFS_BLOCK_GROUP_RAID1) && num_devices <= 2) {
printk(KERN_ERR "btrfs: unable to go...
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"
-
2012 Sep 25
3
[PATCH] Btrfs: limit thread pool size when remounting
...&fs_info->submit_workers, new_pool_size);
- btrfs_set_max_workers(&fs_info->caching_workers, new_pool_size);
- btrfs_set_max_workers(&fs_info->fixup_workers, new_pool_size);
+ btrfs_set_max_workers(&fs_info->submit_workers,
+ min_t(u64, fs_info->fs_devices->num_devices,
+ new_pool_size));
+ btrfs_set_max_workers(&fs_info->caching_workers, min(2, new_pool_size));
+ btrfs_set_max_workers(&fs_info->fixup_workers, min(1, new_pool_size));
btrfs_set_max_workers(&fs_info->endio_workers, new_pool_size);
btrfs_set_max_workers(&fs_info-...
2011 Apr 20
4
[PATCH 1/5] Btrfs: fix bh leak on __btrfs_open_devices path
''bh'' is forgot to release if no error is detected
Signed-off-by: Xiao Guangrong <xiaoguangrong@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
2009 Aug 05
0
[PATCH node] Provides a workaround for HP CCISS devices.
...gs)"
devices=$(echo $devices | tr ' ' '\n' | sort -u | xargs)
+ # FIXME: workaround for dealing with cciss devices
+ for dev in $(ls /dev/cciss/); do
+ if [[ ! $dev =~ p[0-9]+\$ ]]; then
+ devices="$devices /dev/cciss/$dev"
+ fi
+ done
+
local num_devices=$(echo "$devices" | wc -w)
# If there's only one device, use it.
case $num_devices in
--
1.6.2.5
2010 Dec 05
1
[PATCH 4/5][REPOST][BTRFS-PROGS] Avoid to scan cdrom and floppy
...*/
+ rule++;
+ }else{
+ res = 1; /* if match, the device is ok */
+ }
+
+ if( !fnmatch(rule, dev, 0 ) )
+ return res;
+
+ }
+ return 1;
+}
+
+int btrfs_scan_block_devices(int run_ioctl, int checklist)
+{
+
+ struct stat st;
+ int ret;
+ int fd;
+ struct btrfs_fs_devices *tmp_devices;
+ u64 num_devices;
+ FILE *proc_partitions;
+ int i;
+ char buf[1024];
+ char name[100], fullpath[110];
+
+ if(checklist)
+ init_device_checklist(BTRFSDEVICELIST);
+
+ proc_partitions = fopen("/proc/partitions","r");
+ if (!proc_partitions) {
+ fprintf(stderr, "Unable to open ''/pr...
2010 Sep 28
18
[PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem
...vice;
+ struct list_head *devices;
+ int alloc_size = 0;
+ int ret = 0;
+
+ if (copy_from_user(&di_args,
+ (struct btrfs_ioctl_disk_info_args __user *)arg,
+ sizeof(di_args)))
+ return -EFAULT;
+
+ mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
+ if (!di_args.num_devices) {
+ di_args.num_devices = root->fs_info->fs_devices->num_devices;
+ goto out;
+ }
+ alloc_size = sizeof(u64) * di_args.num_devices;
+
+ di_args.num_devices = 0;
+
+ /*
+ * If we have more than 4k worth of space to hold a bunch of u64''s,
+ * somebody is misbehaving.
+ */
+ if...
2009 Jul 10
0
[PATCH node] This is a follow-on patch for bz#507455.
...|| devices="$devices $block_dev"
+ fi
done
# FIXME: workaround for detecting virtio block devices
devices="$devices $(ls /dev/vd? 2> /dev/null | xargs)"
devices=$(echo $devices | tr ' ' '\n' | sort -u | xargs)
- local num_devices=$(echo "$devices" | wc -w)
- # If there's only one device, use it.
- case $num_devices in
- 0) warn "ERROR: found no usable block device"; return 1;;
- 1) echo "$devices"; return 0;;
- *) ;; # found more than one
+ if [ -n "$devic...
2009 Jul 01
1
Replacement patch for bz#507455
This patch includes a fix to no longer list devices with 0 bytes
of storage, such as removeable media devices with no media present.
2013 Mar 21
4
[PATCH] btrfs-progs: make btrfs dev scan multi path aware
...p;& errno != ENOMEDIUM &&
+ 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(fullpat...
2009 Aug 26
0
btrfsctl -a doesn't find my btrfs
...systems
failed to read /dev/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, &a...
2013 Aug 29
0
[PATCH] Btrfs: don't use an async starter for most of our workers
..._workers(&fs_info->flush_workers, "flush_delalloc",
- fs_info->thread_pool_size,
- &fs_info->generic_worker);
+ fs_info->thread_pool_size, NULL);
btrfs_init_workers(&fs_info->submit_workers, "submit",
min_t(u64, fs_devices->num_devices,
- fs_info->thread_pool_size),
- &fs_info->generic_worker);
+ fs_info->thread_pool_size), NULL);
btrfs_init_workers(&fs_info->caching_workers, "cache",
- 2, &fs_info->generic_worker);
+ fs_info->thread_pool_size, NULL);
/* a h...
2010 Apr 03
1
[PATCH] btrfs support
...eration;
+ __le64 root;
+ __le64 chunk_root;
+ __le64 log_root;
+
+ /* this will help find the new super based on the log root */
+ __le64 log_root_transid;
+ __le64 total_bytes;
+ __le64 bytes_used;
+ __le64 root_dir_objectid;
+ __le64 num_devices;
+ __le32 sectorsize;
+ __le32 nodesize;
+ __le32 leafsize;
+ __le32 stripesize;
+ __le32 sys_chunk_array_size;
+ __le64 chunk_root_generation;
+ __le64 compat_flags;
+ __le64 compat_ro_flags;
+ __le64 incompat_flags;
+ __le16 cs...
2015 Dec 24
0
[PATCH v2] btrfs: Fix logical to physical block address mapping
...s)
{
struct btrfs_info * const bfs = fs->fs_info;
+ struct btrfs_disk_key ignore_key;
struct btrfs_disk_key search_key;
struct btrfs_chunk *chunk;
- struct btrfs_chunk_map_item item;
struct btrfs_path path;
if (!(bfs->sb.flags & BTRFS_SUPER_FLAG_METADUMP)) {
if (bfs->sb.num_devices > 1)
printf("warning: only support single device btrfs\n");
+
+ ignore_key.objectid = BTRFS_DEV_ITEMS_OBJECTID;
+ ignore_key.type = BTRFS_DEV_ITEM_KEY;
+
/* read chunk from chunk_tree */
search_key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
search_key.type = BTRFS_CHUNK...
2015 Dec 27
0
[PATCH v3] btrfs: Fix logical to physical block address mapping
...s)
{
struct btrfs_info * const bfs = fs->fs_info;
+ struct btrfs_disk_key ignore_key;
struct btrfs_disk_key search_key;
struct btrfs_chunk *chunk;
- struct btrfs_chunk_map_item item;
struct btrfs_path path;
if (!(bfs->sb.flags & BTRFS_SUPER_FLAG_METADUMP)) {
if (bfs->sb.num_devices > 1)
printf("warning: only support single device btrfs\n");
+
+ ignore_key.objectid = BTRFS_DEV_ITEMS_OBJECTID;
+ ignore_key.type = BTRFS_DEV_ITEM_KEY;
+
/* read chunk from chunk_tree */
search_key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
search_key.type = BTRFS_CHUNK...
2015 Dec 24
4
[PATCH] btrfs: Fix logical to physical block address mapping
The current btrfs support did not handled multiple stripes stored in
chunk items, hence skipping the physical addresses that were needed to
do the mapping.
Besides, the chunk tree may contain DEV_ITEM keys which store
information on all of the underlying block devices, so we must skip them
instead of finishing lookup.
The bug was reproduced with btrfs-progs v4.2.2.
Cc: Gene Cumm <gene.cumm