Displaying 8 results from an estimated 8 matches for "block_pattern".
2015 Oct 19
1
Re: [PATCH 2/2] Include resize2fs_P into vfs_min_size.
...1 100644
> --- a/daemon/ext2.c
> +++ b/daemon/ext2.c
> @@ -279,8 +279,34 @@ do_resize2fs_M (const char *device)
> return 0;
> }
>
> +static int32_t
> +get_block_size (const char *device)
> +{
> + CLEANUP_FREE_STRING_LIST char **params = NULL;
> + const char *block_pattern = "Block size";
> + size_t i;
> + int32_t block_size;
> +
> + params = do_tune2fs_l (device);
This works, yes, although maybe there should be a way to run tune2fs -l
and traverse its output to either build a return hash (i.e. what
do_tune2fs_l currently does) or just looku...
2015 Oct 16
0
[PATCH 2/2] Include resize2fs_P into get_min_size.
...t a/daemon/ext2.c b/daemon/ext2.c
index 0cd6a66..fcf39de 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -279,8 +279,31 @@ do_resize2fs_M (const char *device)
return 0;
}
+static int32_t
+get_block_size (const char *device)
+{
+ CLEANUP_FREE_STRING_LIST char **params = NULL;
+ const char *block_pattern = "Block size";
+ size_t i;
+ int32_t block_size;
+
+ params = do_tune2fs_l (device);
+ if (params == NULL)
+ return -1;
+
+ for (i = 0; params[i] != NULL; i += 2) {
+ if ((!strcmp (params[i], block_pattern))) {
+ if (sscanf (params[i + 1], "%" SCNd32, &block...
2015 Oct 19
0
[PATCH 2/2] Include resize2fs_P into vfs_min_size.
...t a/daemon/ext2.c b/daemon/ext2.c
index 0cd6a66..f00e081 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -279,8 +279,34 @@ do_resize2fs_M (const char *device)
return 0;
}
+static int32_t
+get_block_size (const char *device)
+{
+ CLEANUP_FREE_STRING_LIST char **params = NULL;
+ const char *block_pattern = "Block size";
+ size_t i;
+ int32_t block_size;
+
+ params = do_tune2fs_l (device);
+ if (params == NULL)
+ return -1;
+
+ for (i = 0; params[i] != NULL; i += 2) {
+ if ((!strcmp (params[i], block_pattern))) {
+ if (sscanf (params[i + 1], "%" SCNd32, &block...
2015 Oct 20
0
[PATCHv3 2/2] Include resize2fs_P into vfs_min_size.
...ot;c-ctype.h"
#include "actions.h"
+#include "xstrtol.h"
#define MAX_ARGS 128
@@ -279,15 +280,41 @@ do_resize2fs_M (const char *device)
return 0;
}
+static long
+get_block_size (const char *device)
+{
+ CLEANUP_FREE_STRING_LIST char **params = NULL;
+ const char *block_pattern = "Block size";
+ size_t i;
+ long block_size;
+
+ params = do_tune2fs_l (device);
+ if (params == NULL)
+ return -1;
+
+ for (i = 0; params[i] != NULL; i += 2) {
+ if (STREQ (params[i], block_pattern)) {
+ if (xstrtol (params[i + 1], NULL, 10, &block_size, NULL) != LO...
2015 Oct 16
4
[PATCH 0/2] Introduce get_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments.
Maybe you can suggest a better name for API?
Maxim Perevedentsev (2):
New API: get_min_size
Include resize2fs_P into get_min_size.
daemon/Makefile.am | 1 +
daemon/daemon.h | 2 ++
daemon/ext2.c | 37 ++++++++++++++++++++++++----
daemon/fs-min-size.c | 49 +++++++++++++++++++++++++++++++++++++
daemon/ntfs.c | 68
2015 Oct 19
5
[PATCHv2 0/2] Introduce vfs_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments.
Difference to v1:
Added reply_with_error where necessary.
Changed name get_min_size -> vfs_min_size.
Maxim Perevedentsev (2):
New API: vfs_min_size
Include resize2fs_P into vfs_min_size.
daemon/Makefile.am | 1 +
daemon/daemon.h | 2 ++
daemon/ext2.c | 45 ++++++++++++++++++++++++++-----
daemon/fs-min-size.c | 49
2015 Oct 20
4
[PATCHv3 0/2] Introduce vfs_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments.
Difference to v1:
Added reply_with_error where necessary.
Changed name get_min_size -> vfs_min_size.
Difference to v2:
Changed name to vfs_minimum_size.
Changed parsing to xstrtol + STR* macros where possible.
Maxim Perevedentsev (2):
New API: vfs_min_size
Include resize2fs_P into vfs_min_size.
daemon/Makefile.am | 1 +
2015 Oct 20
8
[PATCHv4 0/2] Introduce vfs_minimum_size API to get minimum filesystem size.
Tried to make it in accordance with your comments.
Difference to v1:
Added reply_with_error where necessary.
Changed name get_min_size -> vfs_min_size.
Difference to v2:
Changed name to vfs_minimum_size.
Changed parsing to xstrtol + STR* macros where possible.
Difference to v3:
Decapitalize error messages.
Maxim Perevedentsev (2):
New API: vfs_minimum_size
Include resize2fs_P into