Displaying 13 results from an estimated 13 matches for "tar_open".
Did you mean:
tap_open
2020 Aug 27
0
[nbdkit PATCH 1/2] filters: Add .export_description wrappers
...lter filter = {
- .name = "tar",
- .longname = "nbdkit tar filter",
- .config = tar_config,
- .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...
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 Sep 01
1
Re: [nbdkit PATCH 1/2] filters: Add .export_description wrappers
...= "tar",
> - .longname = "nbdkit tar filter",
> - .config = tar_config,
> - .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,
> - .exten...
2020 Jul 06
2
Re: [PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
...+ if (offset >= INT64_MAX || size >= INT64_MAX) {
> + nbdkit_error ("internal error: calculated offset and size are wrong");
> + return -1;
> + }
> +
> + return 0;
> +}
> +
> +struct handle {
> + int fd;
> +};
> +
> +static void *
> +tar_open (int readonly)
> +{
> + struct handle *h;
> +
> + assert (offset > 0); /* Cannot be zero because of tar header. */
> +
> + h = calloc (1, sizeof *h);
> + if (h == NULL) {
> + nbdkit_error ("calloc: %m");
> + return NULL;
> + }
> + h->...
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
2
Re: [PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
...+ if (offset >= INT64_MAX || size >= INT64_MAX) {
> + nbdkit_error ("internal error: calculated offset and size are wrong");
> + return -1;
> + }
> +
> + return 0;
> +}
> +
> +struct handle {
> + int fd;
> +};
> +
> +static void *
> +tar_open (int readonly)
> +{
> + struct handle *h;
> +
> + assert (offset > 0); /* Cannot be zero because of tar header. */
> +
> + h = calloc (1, sizeof *h);
> + if (h == NULL) {
> + nbdkit_error ("calloc: %m");
> + return NULL;
> + }
> + h->...
2020 Jun 28
0
[PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
...heck it doesn't exceed
+ * the size of the tar file.
+ */
+ if (offset >= INT64_MAX || size >= INT64_MAX) {
+ nbdkit_error ("internal error: calculated offset and size are wrong");
+ return -1;
+ }
+
+ return 0;
+}
+
+struct handle {
+ int fd;
+};
+
+static void *
+tar_open (int readonly)
+{
+ struct handle *h;
+
+ assert (offset > 0); /* Cannot be zero because of tar header. */
+
+ h = calloc (1, sizeof *h);
+ if (h == NULL) {
+ nbdkit_error ("calloc: %m");
+ return NULL;
+ }
+ h->fd = open (tarfile, (readonly ? O_RDONLY : O_RDWR) | O_...
2020 Jul 07
0
[PATCH nbdkit] New filter: tar.
...quot;
+
+static int
+tar_thread_model (void)
+{
+ return NBDKIT_THREAD_MODEL_PARALLEL;
+}
+
+struct handle {
+ /* These are copied from the globals during tar_prepare, so that we
+ * don't have to keep grabbing the lock on each request.
+ */
+ uint64_t offset, size;
+};
+
+static void *
+tar_open (nbdkit_next_open *next, nbdkit_backend *nxdata, int readonly)
+{
+ struct handle *h;
+
+ if (next (nxdata, readonly) == -1)
+ return NULL;
+
+ h = calloc (1, sizeof *h);
+ if (h == NULL) {
+ nbdkit_error ("calloc: %m");
+ return NULL;
+ }
+ return h;
+}
+
+static void
+tar...
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 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...rtname) == -1) {
/* If the reopen fails we treat it the same way as a command
* failing.
*/
diff --git a/filters/tar/tar.c b/filters/tar/tar.c
index a2b26935..c04f09dd 100644
--- a/filters/tar/tar.c
+++ b/filters/tar/tar.c
@@ -112,11 +112,12 @@ struct handle {
};
static void *
-tar_open (nbdkit_next_open *next, nbdkit_backend *nxdata, int readonly)
+tar_open (nbdkit_next_open *next, nbdkit_backend *nxdata,
+ int readonly, const char *exportname)
{
struct handle *h;
- if (next (nxdata, readonly) == -1)
+ if (next (nxdata, readonly, exportname) == -1)
return NU...
2020 Aug 07
0
[nbdkit PATCH 1/3] server: Implement nbdkit_is_tls for use during .open
...nst char *exportname)
+ int readonly, const char *exportname, int is_tls)
{
struct retry_handle *h;
diff --git a/filters/tar/tar.c b/filters/tar/tar.c
index c04f09dd..ab041153 100644
--- a/filters/tar/tar.c
+++ b/filters/tar/tar.c
@@ -113,7 +113,7 @@ struct handle {
static void *
tar_open (nbdkit_next_open *next, nbdkit_backend *nxdata,
- int readonly, const char *exportname)
+ int readonly, const char *exportname, int is_tls)
{
struct handle *h;
diff --git a/filters/truncate/truncate.c b/filters/truncate/truncate.c
index ee384871..00b5d8ce 100644
--- a/filter...
2020 Aug 07
7
[nbdkit PATCH 0/3] Content differentiation during --tls=on
Patch 3 still needs tests added, but it is at least working from
my simple command line tests.
Eric Blake (3):
server: Implement nbdkit_is_tls for use during .open
server: Expose final thread_model to filter's .get_ready
tlsdummy: New filter
docs/nbdkit-filter.pod | 21 +-
docs/nbdkit-plugin.pod | 34 ++-
docs/nbdkit-tls.pod
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