From: Gao Xiang Date: Mon, 24 Jun 2024 11:59:23 +0000 (+0800) Subject: erofs-utils: introduce `payload` field in `struct erofs_vfile` X-Git-Tag: v1.8~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2e97bf6901e98cd8c6c4ce9dabe9b6357be3f78;p=platform%2Fupstream%2Ferofs-utils.git erofs-utils: introduce `payload` field in `struct erofs_vfile` Allow customized `vfile` with non-NULL `ops` utilizing `payload` for additional information. Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20240624115923.4090196-2-hsiangkao@linux.alibaba.com --- 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);