Displaying 7 results from an estimated 7 matches for "estimate_size".
Did you mean:
estimated_size
2019 Feb 22
1
Re: [PATCH nbdkit v3 4/4] Add linuxdisk plugin.
...gt; mke2fs ‘-d’ option thus allowing the implementation to be very small
> and simple, with all the hard work done by mke2fs.
>
> Although there is some overlap with nbdkit-iso-plugin and
> nbdkit-floppy-plugin, the implementations and use cases of all three
> +static int64_t
> +estimate_size (void)
> +{
>
> + r = pclose (fp);
> + if (r == -1) {
> + nbdkit_error ("pclose: %m");
> + free (line);
> + return -1;
> + }
> + if (WIFEXITED (r) && WEXITSTATUS (r) != 0) {
> + nbdkit_error ("du command failed with exit code %d...
2019 Feb 22
0
[PATCH nbdkit v3 4/4] Add linuxdisk plugin.
...>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include <nbdkit-plugin.h>
+
+#include "minmax.h"
+#include "rounding.h"
+#include "utils.h"
+
+#include "virtual-disk.h"
+
+static int64_t estimate_size (void);
+static int mke2fs (const char *filename);
+
+int
+create_filesystem (struct virtual_disk *disk)
+{
+ const char *tmpdir;
+ char *filename = NULL;
+ int fd = -1;
+
+ /* Estimate the filesystem size and compute the final virtual size
+ * of the disk. We only need to do this if the use...
2019 Feb 19
2
Re: [PATCH nbdkit 4/4] Add linuxdisk plugin.
...estimate the size of the filesystem quickly.
> + *
> + * Typical output from ‘du -cs dir1 dir2’ is:
> + *
> + * 12345 dir1
> + * 34567 dir2
> + * 46912 total
> + *
> + * We ignore everything except the first number on the last line.
> + */
> +static int64_t
> +estimate_size (void)
> +{
> + fprintf (fp, "du -c -k -s");
'du -c' is not specified by POSIX, but is reasonable to expect (we can't
build this plugin without ext2 support, which implies we are probably on
a Linux system to begin with). If so, should we rely on having GNU
coreutils...
2019 Feb 22
5
[PATCH nbdkit v3 0/4] Add linuxdisk plugin.
For v3 I reimplemented this using mke2fs -d. This obviously makes the
implementation a whole lot simpler, but cannot support multiple
directory merging.
Patches 1-3 are the same as before. I've also reproduced the notes
from v2 below.
v2:
- Fix inconsistent tab/space.
- All 3 plugins now contain a block of text pointing to the
other 2 plugins.
- TMDIR -> TMPDIR
- Unlink the
2019 Feb 19
0
[PATCH nbdkit 4/4] Add linuxdisk plugin.
...* These fields are only populated once the file has been created
+ * in the target filesystem.
+ */
+ ext2_ino_t ino; /* Inode. */
+ int ino_flags; /* Inode flags. */
+ const char *type; /* File type (used only for debugging). */
+};
+
+static int64_t estimate_size (void);
+static int mke2fs (const char *filename);
+static int visit (const char *dir, ext2_filsys fs, ext2_ino_t dir_ino,
+ struct file **files, size_t *nr_files);
+static int compare_inodes (const void *f1, const void *f2);
+static int e2mkdir (ext2_filsys fs, ext2_ino_t dir_ino,...
2019 Feb 19
7
[PATCH nbdkit 0/4] New plugin: Add linuxdisk plugin.
Turns out Japanese trains are good for coding!
In supermin we have a bunch of code to create the libguestfs
appliance. It creates it directly using libext2fs (part of
e2fsprogs). We can use the same technique to create ext2 virtual
disks in nbdkit, which is what this new plugin does. Why a new plugin
instead of modifying the floppy plugin? See the 4/4 commit message
for an explanation.
The
2019 Feb 19
6
[PATCH nbdkit v2 0/5] Add linuxdisk plugin.
Another interesting thing you can do with this plugin:
https://rwmj.wordpress.com/2019/02/19/nbdkit-linuxdisk-plugin/
v2:
- Fix inconsistent tab/space.
- All 3 plugins now contain a block of text pointing to the
other 2 plugins.
- TMDIR -> TMPDIR
- Unlink the temporary file and other cleanups along error paths.
- fclose -> pclose, and check the return value for errors.
-