Allow customized `vfile` with non-NULL `ops` utilizing `payload`
for additional information.

Signed-off-by: Gao Xiang <hsiang...@linux.alibaba.com>
---
 include/erofs/io.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/erofs/io.h b/include/erofs/io.h
index 6167bdf..f53abed 100644
--- a/include/erofs/io.h
+++ b/include/erofs/io.h
@@ -37,10 +37,16 @@ struct erofs_vfops {
                     struct erofs_vfile *vin, int len, bool noseek);
 };
 
+/* don't extend this; instead, use payload for any extra information */
 struct erofs_vfile {
        struct erofs_vfops *ops;
-       u64 offset;
-       int fd;
+       union {
+               struct {
+                       u64 offset;
+                       int fd;
+               };
+               u8 payload[16];
+       };
 };
 
 int erofs_io_fstat(struct erofs_vfile *vf, struct stat *buf);
-- 
2.39.3

Reply via email to