Displaying 6 results from an estimated 6 matches for "tmpdisk_trim".
2020 Apr 09
0
[PATCH nbdkit v2 3/3] tmpdisk: Implement this plugin using fileops.
...Kernel >= 4.9 fails
- * with EOPNOTSUPP in this case. Normalize errno to simplify callers.
- */
- errno = EOPNOTSUPP;
- }
- return r;
-}
-
-static bool
-is_enotsup (int err)
-{
- return err == ENOTSUP || err == EOPNOTSUPP;
-}
-#endif
-
-/* Punch a hole in the file. */
-static int
-tmpdisk_trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
-{
-#ifdef FALLOC_FL_PUNCH_HOLE
- struct handle *h = handle;
- int r;
-
- if (h->can_punch_hole) {
- r = do_fallocate (h->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
- offset, count);
- if (r ==...
2020 Mar 17
0
Re: [PATCH nbdkit v2] New tmpdisk plugin.
...+/* This plugin deliberately provides a null flush operation, because
> + * all of the disks created are temporary.
> + */
> +static int
> +tmpdisk_flush (void *handle, uint32_t flags)
> +{
> + return 0;
As does this.
> +/* Punch a hole in the file. */
> +static int
> +tmpdisk_trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
> +{
> +#ifdef FALLOC_FL_PUNCH_HOLE
> + struct handle *h = handle;
> + int r;
> +
> + if (h->can_punch_hole) {
> + r = do_fallocate (h->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> +...
2020 Mar 17
2
[PATCH nbdkit v2] New tmpdisk plugin.
...Kernel >= 4.9 fails
+ * with EOPNOTSUPP in this case. Normalize errno to simplify callers.
+ */
+ errno = EOPNOTSUPP;
+ }
+ return r;
+}
+
+static bool
+is_enotsup (int err)
+{
+ return err == ENOTSUP || err == EOPNOTSUPP;
+}
+#endif
+
+/* Punch a hole in the file. */
+static int
+tmpdisk_trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
+{
+#ifdef FALLOC_FL_PUNCH_HOLE
+ struct handle *h = handle;
+ int r;
+
+ if (h->can_punch_hole) {
+ r = do_fallocate (h->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
+ offset, count);
+ if (r ==...
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.