search for: resize2fs_p

Displaying 18 results from an estimated 18 matches for "resize2fs_p".

2015 Oct 14
1
[PATCH v2] New API: resize2fs_P
...14 ++++++++++++++ src/MAX_PROC_NR | 2 +- 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/daemon/ext2.c b/daemon/ext2.c index ebaf0f0..0cd6a66 100644 --- a/daemon/ext2.c +++ b/daemon/ext2.c @@ -279,6 +279,41 @@ do_resize2fs_M (const char *device) return 0; } +int64_t +do_resize2fs_P (const char *device) +{ + CLEANUP_FREE char *err = NULL, *out = NULL; + CLEANUP_FREE_STRING_LIST char **lines = NULL; + int r; + size_t i; + char *p; + int64_t ret; + const char *pattern = "Estimated minimum size of the filesystem: "; + + r = command (&out, &err, str_resiz...
2015 Oct 16
0
[PATCH 2/2] Include resize2fs_P into get_min_size.
...(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_size) != 1) + return -1; + return block_size; + } + } + + return -1; +} + int64_t -do_resize2fs_P (const char *device) +ext_get_min_size (const char *device) { CLEANUP_FREE char *err = NULL, *out = NULL; CLEANUP_FREE_STRING_LIST char **lines = NULL; @@ -288,6 +311,7 @@ do_resize2fs_P (const char *device) size_t i; char *p; int64_t ret; + int32_t block_size; const char *patte...
2015 Oct 19
0
[PATCH 2/2] Include resize2fs_P into vfs_min_size.
...+ 1], "%" SCNd32, &block_size) != 1) { + reply_with_error("Cannot parse block size"); + return -1; + } + return block_size; + } + } + + reply_with_error("No block size in tune2fs_l output. Check format.") + return -1; +} + int64_t -do_resize2fs_P (const char *device) +ext_min_size (const char *device) { CLEANUP_FREE char *err = NULL, *out = NULL; CLEANUP_FREE_STRING_LIST char **lines = NULL; @@ -288,6 +314,7 @@ do_resize2fs_P (const char *device) size_t i; char *p; int64_t ret; + int32_t block_size; const char *pattern =...
2015 Oct 20
0
[PATCHv3 2/2] Include resize2fs_P into vfs_min_size.
...NULL, 10, &block_size, NULL) != LONGINT_OK) { + reply_with_error ("Cannot parse block size"); + return -1; + } + return block_size; + } + } + + reply_with_error ("Missing 'Block size' in tune2fs_l output"); + return -1; +} + int64_t -do_resize2fs_P (const char *device) +ext_minimum_size (const char *device) { CLEANUP_FREE char *err = NULL, *out = NULL; CLEANUP_FREE_STRING_LIST char **lines = NULL; int r; size_t i; - char *p; int64_t ret; + long block_size; const char *pattern = "Estimated minimum size of the filesyst...
2015 Oct 13
0
Re: [PATCH] New API: resize2fs_P
...es changed, 46 insertions(+), 1 deletion(-) > > diff --git a/daemon/ext2.c b/daemon/ext2.c > index ebaf0f0..3dae40f 100644 > --- a/daemon/ext2.c > +++ b/daemon/ext2.c > @@ -279,6 +279,41 @@ do_resize2fs_M (const char *device) > return 0; > } > > +int64_t > +do_resize2fs_P (const char *device) > +{ > + CLEANUP_FREE char *err = NULL, *out = NULL; > + CLEANUP_FREE_STRING_LIST char **lines = NULL; > + int r; > + size_t i; > + char *p; > + int64_t ret; > + char pattern[] = "Estimated minimum size of the filesystem: "; > + >...
2015 Oct 19
1
Re: [PATCH 2/2] Include resize2fs_P into vfs_min_size.
...return -1; > + } > + return block_size; > + } > + } > + > + reply_with_error("No block size in tune2fs_l output. Check format.") "missing 'Block size' in tune2fs_l output" > + return -1; > +} > + > int64_t > -do_resize2fs_P (const char *device) > +ext_min_size (const char *device) > { > CLEANUP_FREE char *err = NULL, *out = NULL; > CLEANUP_FREE_STRING_LIST char **lines = NULL; > @@ -288,6 +314,7 @@ do_resize2fs_P (const char *device) > size_t i; > char *p; > int64_t ret; > +...
2015 Oct 14
0
Re: [PATCH] New API: resize2fs_P
On Tue, Oct 13, 2015 at 06:26:25PM +0300, Maxim Perevedentsev wrote: Another couple of things ... > + char pattern[] = "Estimated minimum size of the filesystem: "; This should be 'const char *pattern'. > + if ((p = strstr (lines[i], pattern))) { > + if (sscanf (p + strlen(pattern), "%" SCNu64, &ret) != 1) > + return -1; > +
2015 Oct 14
0
Re: [PATCH] New API: resize2fs_P
Hi, On Wednesday 14 October 2015 12:53:26 Maxim Perevedentsev wrote: > This multiplication may confuse users who got used to "normal" resize2fs > -P behavior (blocks) due to the name of API command. > I'm going to implement similar functionality for other filesystems > (ntfs, btrfs, xfs). Then please implement a single function for all these filesystems, just like
2015 Oct 13
4
[PATCH] New API: resize2fs_P
...ml | 10 ++++++++++ src/MAX_PROC_NR | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/daemon/ext2.c b/daemon/ext2.c index ebaf0f0..3dae40f 100644 --- a/daemon/ext2.c +++ b/daemon/ext2.c @@ -279,6 +279,41 @@ do_resize2fs_M (const char *device) return 0; } +int64_t +do_resize2fs_P (const char *device) +{ + CLEANUP_FREE char *err = NULL, *out = NULL; + CLEANUP_FREE_STRING_LIST char **lines = NULL; + int r; + size_t i; + char *p; + int64_t ret; + char pattern[] = "Estimated minimum size of the filesystem: "; + + r = command (&out, &err, str_resize2fs,...
2015 Oct 14
2
Re: [PATCH] New API: resize2fs_P
> There's a case for multiplying the return size by the block size of > the filesystem, thus returning the size in bytes. It might make the > API easier to use. Not sure how hard that is, or whether it actually > makes the API easier to use. > > Rich. This multiplication may confuse users who got used to "normal" resize2fs -P behavior (blocks) due to the name of
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 ++++++++++++++++++++++++++++++++++ daemon/ntfs.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions....
2015 Oct 20
8
[PATCHv4 0/2] Introduce vfs_minimum_size API to get minimum filesystem size.
...ply_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 vfs_minimum_size. daemon/Makefile.am | 1 + daemon/daemon.h | 2 ++ daemon/ext2.c | 62 ++++++++++++++++++++++++++++++++----- daemon/fs-min-size.c | 49 +++++++++++++++++++++++++++++ daemon/ntfs.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/act...
2015 Oct 20
1
[PATCHv3 0/2] Introduce vfs_min_size API to get minimum filesystem size.
...ance 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 + daemon/daemon.h | 2 ++ daemon/ext2.c | 62 ++++++++++++++++++++++++++++++++----- daemon/fs-min-size.c | 49 +++++++++++++++++++++++++++++ daemon/ntfs.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions...
2015 Oct 20
4
[PATCHv3 0/2] Introduce vfs_min_size API to get minimum filesystem size.
...ance 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 + daemon/daemon.h | 2 ++ daemon/ext2.c | 62 ++++++++++++++++++++++++++++++++----- daemon/fs-min-size.c | 49 +++++++++++++++++++++++++++++ daemon/ntfs.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions...
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 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions....
2015 Oct 16
2
[PATCH] New API: ntfsresize_info
Get minimum size of NTFS filesystem in bytes. This is used primarily for shrinking images. In case of a full images ntfsresize returns error code and does not print minimum size. So we calculate it manually by rounding 'volume size' up to 'cluster size'. --- daemon/ntfs.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 17 +++++++++++++
2015 Oct 16
0
Re: [PATCH] New API: ntfsresize_info
...es. > > In case of a full images ntfsresize returns error code and does not print minimum size. > So we calculate it manually by rounding 'volume size' up to 'cluster size'. NACK to a separate API per-filesystem. As I said in a previous email, please turn the newly added resize2fs_P into a generic API for getting the minimum size of a filesystem, either bytes or blocks. See for example set_label and set_uuid. Thanks, -- Pino Toscano
2015 Oct 20
0
Re: [PATCHv4 0/2] Introduce vfs_minimum_size API to get minimum filesystem size.
...ze -> 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 vfs_minimum_size. > > daemon/Makefile.am | 1 + > daemon/daemon.h | 2 ++ > daemon/ext2.c | 62 ++++++++++++++++++++++++++++++++----- > daemon/fs-min-size.c | 49 +++++++++++++++++++++++++++++ > daemon/ntfs.c | 87 +++++++++++++++++++++++++++++++++++++...