From a0e0a47d55765a9936f0d4bee84eea14c1fcdb8c Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 18 May 2024 16:28:40 +0000 Subject: item queue: internal driver context: save mark to last queued item. --- src/internal/tpax_driver_impl.h | 15 +++++++++++++++ src/logic/tpax_archive_append.c | 2 ++ 2 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/internal/tpax_driver_impl.h b/src/internal/tpax_driver_impl.h index ea02185..9860717 100644 --- a/src/internal/tpax_driver_impl.h +++ b/src/internal/tpax_driver_impl.h @@ -79,6 +79,7 @@ struct tpax_driver_ctx_impl { char ** prefcap; char * prefptr[64]; struct tpax_dirent_buffer * dirents; + struct tpax_dirent * dirmark; void * dirbuff; void * bufaddr; size_t bufsize; @@ -212,6 +213,20 @@ static inline struct tpax_dirent_buffer * tpax_get_driver_dirents(const struct t return ictx->dirents; } +static inline struct tpax_dirent * tpax_get_driver_dirmark(const struct tpax_driver_ctx * dctx) +{ + struct tpax_driver_ctx_impl * ictx; + ictx = tpax_get_driver_ictx(dctx); + return ictx->dirmark; +} + +static inline void tpax_set_driver_dirmark(const struct tpax_driver_ctx * dctx, struct tpax_dirent * dirent) +{ + struct tpax_driver_ctx_impl * ictx; + ictx = tpax_get_driver_ictx(dctx); + ictx->dirmark = dirent; +} + static inline off_t tpax_get_unit_hpos(const struct tpax_unit_ctx * uctx) { struct tpax_unit_ctx_impl * ictx; diff --git a/src/logic/tpax_archive_append.c b/src/logic/tpax_archive_append.c index 3dcac5c..4526aaf 100644 --- a/src/logic/tpax_archive_append.c +++ b/src/logic/tpax_archive_append.c @@ -271,6 +271,8 @@ static int tpax_archive_append_queue_item( dentbuf->cdent = (struct tpax_dirent *)cap; dentbuf->nfree -= needed; + tpax_set_driver_dirmark(dctx,cdent); + return 0; } -- cgit v1.2.3