search for: tar_pread

Displaying 11 results from an estimated 11 matches for "tar_pread".

Did you mean: bar_read
2020 Aug 27
0
[nbdkit PATCH 1/2] filters: Add .export_description wrappers
...ig, - .config_complete = tar_config_complete, - .config_help = tar_config_help, - .thread_model = tar_thread_model, - .open = tar_open, - .close = tar_close, - .prepare = tar_prepare, - .get_size = tar_get_size, - .pread = tar_pread, - .pwrite = tar_pwrite, - .trim = tar_trim, - .zero = tar_zero, - .extents = tar_extents, - .cache = tar_cache, + .name = "tar", + .longname = "nbdkit tar filter", + .config =...
2020 Jun 28
2
Re: [PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
...(void *handle) > +{ > + return 1; > +} > + > +static int > +tar_can_cache (void *handle) > +{ > + /* Let nbdkit call pread to populate the file system cache. */ > + return NBDKIT_CACHE_EMULATE; > +} > + > +/* Read data from the file. */ > +static int > +tar_pread (void *handle, void *buf, uint32_t count, uint64_t offs) This should be identical to file plugin, on? can we reuse the same code for reading files? > +{ > + struct handle *h = handle; > + > + offs += offset; > + > + while (count > 0) { > + ssize_t r = pread (h->fd...
2020 Jun 28
0
Re: [PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
...e string instead of using > argv directly? Convenience basically. The alternative is to fork and exec the tar command in a subprocess, while reading from a pipe that we have created, which is a pain to write correctly. > > +/* Read data from the file. */ > > +static int > > +tar_pread (void *handle, void *buf, uint32_t count, uint64_t offs) > > This should be identical to file plugin, on? can we reuse the same code > for reading files? Yes and no. A few months ago I actually had a proposal to unify all the "file-like" plugins. I believe the latest posted v...
2020 Sep 01
1
Re: [nbdkit PATCH 1/2] filters: Add .export_description wrappers
...fig_complete, > - .config_help = tar_config_help, > - .thread_model = tar_thread_model, > - .open = tar_open, > - .close = tar_close, > - .prepare = tar_prepare, > - .get_size = tar_get_size, > - .pread = tar_pread, > - .pwrite = tar_pwrite, > - .trim = tar_trim, > - .zero = tar_zero, > - .extents = tar_extents, > - .cache = tar_cache, > + .name = "tar", > + .longname = "nbdkit tar fil...
2020 Jun 28
5
[PATCH nbdkit 0/2] tar: Rewrite the tar plugin (again), this time in C.
For context see these threads: https://lists.gnu.org/archive/html/qemu-discuss/2020-06/threads.html#00053 https://lists.gnu.org/archive/html/qemu-block/2020-06/threads.html#01496 Rich.
2020 Jul 06
2
Re: [PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
...; > +} Needs a tweak if we add exportname=on > + > +static int > +tar_can_cache (void *handle) > +{ > + /* Let nbdkit call pread to populate the file system cache. */ > + return NBDKIT_CACHE_EMULATE; > +} > + > +/* Read data from the file. */ > +static int > +tar_pread (void *handle, void *buf, uint32_t count, uint64_t offs) > +{ > + struct handle *h = handle; > + > + offs += offset; > + > + while (count > 0) { > + ssize_t r = pread (h->fd, buf, count, offs); > + if (r == -1) { > + nbdkit_error ("pread: %m"...
2020 Jul 07
3
[PATCH nbdkit] tar as a filter.
For review only, this needs some clean up and more tests. My eyes are going cross-eyed looking at the calculate_offset_of_entry function, so time to take a break ... Rich.
2020 Aug 27
4
[nbdkit PATCH 0/2] ext2 export list tweaks
Applies on top of my pending series for the exportname filter, addressing one of the todo's in that cover letter. Eric Blake (2): filters: Add .export_description wrappers ext2: Supply .list_exports and .default_export filters/ext2/nbdkit-ext2-filter.pod | 3 +- tests/Makefile.am | 16 +++- filters/ext2/ext2.c | 125 +++++++++++++++++++---------
2020 Jun 28
0
[PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
...ame data over multiple connections. */ +static int +tar_can_multi_conn (void *handle) +{ + return 1; +} + +static int +tar_can_cache (void *handle) +{ + /* Let nbdkit call pread to populate the file system cache. */ + return NBDKIT_CACHE_EMULATE; +} + +/* Read data from the file. */ +static int +tar_pread (void *handle, void *buf, uint32_t count, uint64_t offs) +{ + struct handle *h = handle; + + offs += offset; + + while (count > 0) { + ssize_t r = pread (h->fd, buf, count, offs); + if (r == -1) { + nbdkit_error ("pread: %m"); + return -1; + } + if (r == 0)...
2020 Jul 07
0
[PATCH nbdkit] New filter: tar.
...>offset = offset; + h->size = size; + return 0; +} + +/* Get the file size. */ +static int64_t +tar_get_size (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle) +{ + struct handle *h = handle; + return h->size; +} + +/* Read data from the file. */ +static int +tar_pread (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle, void *buf, uint32_t count, uint64_t offs, + uint32_t flags, int *err) +{ + struct handle *h = handle; + return next_ops->pread (nxdata, buf, count, offs + h->offset, flags, err); +} + +/* Write data to the...
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by improving libnbd to better test things, which in turn surfaced some major memory leak problems in nbdsh that are now fixed). Many of the patches are minor rebases from v2, with the biggest changes being fallout from: - patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export - overall: this missed 1.22, so update