Remove begin_stream callback flags
authorEric Biggers <ebiggers3@gmail.com>
Wed, 25 Jun 2014 01:13:33 +0000 (20:13 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 25 Jun 2014 01:13:33 +0000 (20:13 -0500)
These aren't used for anything anymore.

include/wimlib/resource.h
src/extract.c
src/ntfs-3g_apply.c
src/resource.c
src/unix_apply.c
src/win32_apply.c
src/write.c

index ae07755..7861f87 100644 (file)
@@ -216,10 +216,6 @@ skip_wim_stream(struct wim_lookup_table_entry *lte);
  * @lte:
  *     Stream that is about to be read.
  *
- * @flags:
- *     Bitwise OR of BEGIN_STREAM_FLAG_PARTIAL_RESOURCE and/or
- *     BEGIN_STREAM_FLAG_WHOLE_STREAM.
- *
  * @ctx:
  *     User-provided context.
  *
@@ -229,17 +225,8 @@ skip_wim_stream(struct wim_lookup_table_entry *lte);
  * (without calling @consume_chunk or @end_stream).
  */
 typedef int (*read_stream_list_begin_stream_t)(struct wim_lookup_table_entry *lte,
-                                              u32 flags,
                                               void *ctx);
 
-/* Set to true if the stream is just one of several being read from a single
- * pack and therefore would be extra expensive to read independently.  */
-#define BEGIN_STREAM_FLAG_PARTIAL_RESOURCE     0x00000001
-
-/* This is purely advisory and indicates that the entire stream data will be
- * provided in one call to consume_chunk().  */
-#define BEGIN_STREAM_FLAG_WHOLE_STREAM         0x00000002
-
 #define BEGIN_STREAM_STATUS_SKIP_STREAM        -1
 
 /*
index 3cc9959..bbd0a5e 100644 (file)
@@ -217,7 +217,7 @@ load_streams_from_pipe(struct apply_ctx *ctx,
                        lte_unbind_wim_resource_spec(found_lte);
                        lte_bind_wim_resource_spec(needed_lte, rspec);
 
-                       ret = (*cbs->begin_stream)(needed_lte, 0,
+                       ret = (*cbs->begin_stream)(needed_lte,
                                                   cbs->begin_stream_ctx);
                        if (ret) {
                                lte_unbind_wim_resource_spec(needed_lte);
@@ -306,8 +306,7 @@ retry:
 }
 
 static int
-begin_extract_stream_wrapper(struct wim_lookup_table_entry *lte,
-                            u32 flags, void *_ctx)
+begin_extract_stream_wrapper(struct wim_lookup_table_entry *lte, void *_ctx)
 {
        struct apply_ctx *ctx = _ctx;
 
@@ -316,8 +315,7 @@ begin_extract_stream_wrapper(struct wim_lookup_table_entry *lte,
        if (unlikely(lte->out_refcnt > MAX_OPEN_STREAMS))
                return create_temporary_file(&ctx->tmpfile_fd, &ctx->tmpfile_name);
        else
-               return (*ctx->saved_cbs->begin_stream)(lte, flags,
-                                                      ctx->saved_cbs->begin_stream_ctx);
+               return (*ctx->saved_cbs->begin_stream)(lte, ctx->saved_cbs->begin_stream_ctx);
 }
 
 static int
@@ -424,8 +422,7 @@ extract_from_tmpfile(const tchar *tmpfile_name, struct apply_ctx *ctx)
                 * because it needs the original stream location in order to
                 * create the external backing reference.  */
 
-               ret = (*cbs->begin_stream)(orig_lte, 0,
-                                          cbs->begin_stream_ctx);
+               ret = (*cbs->begin_stream)(orig_lte, cbs->begin_stream_ctx);
                if (ret)
                        return ret;
 
index d075d3d..306daa5 100644 (file)
@@ -791,8 +791,7 @@ ntfs_3g_open_inode(struct wim_inode *inode, struct ntfs_3g_apply_ctx *ctx)
 }
 
 static int
-ntfs_3g_begin_extract_stream(struct wim_lookup_table_entry *stream,
-                            u32 flags, void *_ctx)
+ntfs_3g_begin_extract_stream(struct wim_lookup_table_entry *stream, void *_ctx)
 {
        struct ntfs_3g_apply_ctx *ctx = _ctx;
        const struct stream_owner *owners = stream_owners(stream);
index 300aec8..53283f2 100644 (file)
@@ -1017,17 +1017,12 @@ streamifier_cb(const void *chunk, size_t size, void *_ctx)
        wimlib_assert(size <= ctx->cur_stream->size - ctx->cur_stream_offset);
 
        if (ctx->cur_stream_offset == 0) {
-               u32 flags;
 
                /* Starting a new stream.  */
                DEBUG("Begin new stream (size=%"PRIu64").",
                      ctx->cur_stream->size);
 
-               flags = BEGIN_STREAM_FLAG_PARTIAL_RESOURCE;
-               if (size == ctx->cur_stream->size)
-                       flags |= BEGIN_STREAM_FLAG_WHOLE_STREAM;
                ret = (*ctx->cbs.begin_stream)(ctx->cur_stream,
-                                              flags,
                                               ctx->cbs.begin_stream_ctx);
                if (ret)
                        return ret;
@@ -1073,8 +1068,7 @@ struct hasher_context {
 /* Callback for starting to read a stream while calculating its SHA1 message
  * digest.  */
 static int
-hasher_begin_stream(struct wim_lookup_table_entry *lte, u32 flags,
-                   void *_ctx)
+hasher_begin_stream(struct wim_lookup_table_entry *lte, void *_ctx)
 {
        struct hasher_context *ctx = _ctx;
 
@@ -1083,8 +1077,7 @@ hasher_begin_stream(struct wim_lookup_table_entry *lte, u32 flags,
        if (ctx->cbs.begin_stream == NULL)
                return 0;
        else
-               return (*ctx->cbs.begin_stream)(lte, flags,
-                                               ctx->cbs.begin_stream_ctx);
+               return (*ctx->cbs.begin_stream)(lte, ctx->cbs.begin_stream_ctx);
 }
 
 /* A consume_data_callback_t implementation that continues calculating the SHA1
@@ -1173,7 +1166,7 @@ read_full_stream_with_cbs(struct wim_lookup_table_entry *lte,
 {
        int ret;
 
-       ret = (*cbs->begin_stream)(lte, 0, cbs->begin_stream_ctx);
+       ret = (*cbs->begin_stream)(lte, cbs->begin_stream_ctx);
        if (ret)
                return ret;
 
index b41c1e2..a683b4d 100644 (file)
@@ -561,8 +561,7 @@ retry_create:
 
 /* Called when starting to read a single-instance stream for extraction  */
 static int
-unix_begin_extract_stream(struct wim_lookup_table_entry *stream,
-                         u32 flags, void *_ctx)
+unix_begin_extract_stream(struct wim_lookup_table_entry *stream, void *_ctx)
 {
        struct unix_apply_ctx *ctx = _ctx;
        const struct stream_owner *owners = stream_owners(stream);
index 6faf212..df42653 100644 (file)
@@ -1632,8 +1632,7 @@ extract_encrypted_file(const struct wim_dentry *dentry,
 
 /* Called when starting to read a stream for extraction on Windows  */
 static int
-begin_extract_stream(struct wim_lookup_table_entry *stream,
-                    u32 flags, void *_ctx)
+begin_extract_stream(struct wim_lookup_table_entry *stream, void *_ctx)
 {
        struct win32_apply_ctx *ctx = _ctx;
        const struct stream_owner *owners = stream_owners(stream);
index c45d0b7..91954f9 100644 (file)
@@ -712,8 +712,7 @@ done_with_stream(struct wim_lookup_table_entry *stream,
 
 /* Begin processing a stream for writing.  */
 static int
-write_stream_begin_read(struct wim_lookup_table_entry *lte,
-                       u32 flags, void *_ctx)
+write_stream_begin_read(struct wim_lookup_table_entry *lte, void *_ctx)
 {
        struct write_streams_ctx *ctx = _ctx;
        int ret;
@@ -742,8 +741,6 @@ write_stream_begin_read(struct wim_lookup_table_entry *lte,
        ctx->stream_was_duplicate = false;
        if (ctx->lookup_table != NULL && lte->unhashed && !lte->unique_size) {
 
-               wimlib_assert(!(flags & BEGIN_STREAM_FLAG_PARTIAL_RESOURCE));
-
                struct wim_lookup_table_entry *lte_new;
 
                ret = hash_unhashed_stream(lte, ctx->lookup_table, &lte_new);