search for: tmpdisk_pwrit

Displaying 6 results from an estimated 6 matches for "tmpdisk_pwrit".

Did you mean: tmpdisk_pwrite
2020 Apr 09
0
[PATCH nbdkit v2 3/3] tmpdisk: Implement this plugin using fileops.
...{ - nbdkit_error ("pread: %m"); - return -1; - } - if (r == 0) { - nbdkit_error ("pread: unexpected end of file"); - return -1; - } - buf += r; - count -= r; - offset += r; - } - - return 0; -} - -/* Write data to the file. */ -static int -tmpdisk_pwrite (void *handle, const void *buf, - uint32_t count, uint64_t offset, - uint32_t flags) -{ - struct handle *h = handle; - - while (count > 0) { - ssize_t r = pwrite (h->fd, buf, count, offset); - if (r == -1) { - nbdkit_error ("pwrite: %m");...
2020 Mar 17
0
Re: [PATCH nbdkit v2] New tmpdisk plugin.
...es it is always cleaned up. > + */ > + unlink (disk); I like this aspect. It does mean that 'du' won't find the space hogs under $TMPDIR (lsof or similar will be needed), but I don't see that as a show-stopper. > +/* Write data to the file. */ > +static int > +tmpdisk_pwrite (void *handle, const void *buf, > + uint32_t count, uint64_t offset, > + uint32_t flags) > +{ > + struct handle *h = handle; > + > + while (count > 0) { > + ssize_t r = pwrite (h->fd, buf, count, offset); > + if (r == -1) { > +...
2020 Mar 17
2
[PATCH nbdkit v2] New tmpdisk plugin.
...{ + nbdkit_error ("pread: %m"); + return -1; + } + if (r == 0) { + nbdkit_error ("pread: unexpected end of file"); + return -1; + } + buf += r; + count -= r; + offset += r; + } + + return 0; +} + +/* Write data to the file. */ +static int +tmpdisk_pwrite (void *handle, const void *buf, + uint32_t count, uint64_t offset, + uint32_t flags) +{ + struct handle *h = handle; + + while (count > 0) { + ssize_t r = pwrite (h->fd, buf, count, offset); + if (r == -1) { + nbdkit_error ("pwrite: %m");...
2020 Mar 16
1
[PATCH nbdkit] New tmpdisk plugin.
Unfinished (needs tests). This is my attempt to make a "remote tmpfs" plugin as outlined in this prior email: https://www.redhat.com/archives/libguestfs/2020-March/msg00134.html Although it would be possible to construct something a bit like this using existing plugins and filters (perhaps with some new features in those filters) I think it may be nicer to have a dedicated plugin for
2020 Mar 17
2
[PATCH nbdkit v3] New tmpdisk plugin.
v2 was here: https://www.redhat.com/archives/libguestfs/2020-March/msg00154.html v3: - Micro-optimize tmpdir. - Quote $disk in default command shell fragment. - Don't redirect mkfs output to /dev/null. Instead use exec </dev/null >/dev/null before the shell fragment. We may want to do this in other places where we run external shell scripts, or more generally for all
2020 Apr 09
6
[PATCH nbdkit v2 0/3] Implement fileops.
Needs some work still, see in particular the commit message for patch 3. Rich.