Thread (15 messages) 15 messages, 3 authors, 2021-11-09

Re: [PATCH v4 3/4] btrfs: add force_chunk_alloc sysfs entry to force allocation

From: Nikolay Borisov <hidden>
Date: 2021-11-05 10:04:44


On 29.10.21 г. 21:39, Stefan Roesch wrote:
quoted hunk ↗ jump to hunk
This adds the force_chunk_alloc sysfs entry to be able to force a
storage allocation. This is a debugging and test feature and is
enabled with the CONFIG_BTRFS_DEBUG configuration option.

It is stored at
/sys/fs/btrfs/<uuid>/allocation/<block_type>/force_chunk_alloc.
---
 fs/btrfs/sysfs.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 3b0bcbc2ed2e..983c53b76aa6 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -771,6 +771,64 @@ static ssize_t btrfs_chunk_size_store(struct kobject *kobj,
 	return val;
 }
 
+#ifdef CONFIG_BTRFS_DEBUG
+/*
+ * Return if space info force allocation chunk flag is set.
nit: Well this is a dummy function which simply returns 0. I guess what
makes sense is to simply make the show op a NULL, i wonder if sysfs can
handle this gracefully though.

<snip>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help