On Wednesday, November 16, 2022 10:01:39 AM CET Shi, Guohuai wrote: [...] > > > diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index > > > 4997677460..7d9a736b66 100644 > > > --- a/fsdev/file-op-9p.h > > > +++ b/fsdev/file-op-9p.h > > > @@ -27,6 +27,39 @@ > > > # include <sys/mount.h> > > > #endif > > > > > > +#ifdef CONFIG_WIN32 > > > + > > > +/* POSIX structure not defined in Windows */ > > > + > > > +typedef uint32_t uid_t; > > > +typedef uint32_t gid_t; > > > + > > > +/* from http://man7.org/linux/man-pages/man2/statfs.2.html */ typedef > > > +uint32_t __fsword_t; typedef uint32_t fsblkcnt_t; typedef uint32_t > > > +fsfilcnt_t; > > > + > > > +/* from linux/include/uapi/asm-generic/posix_types.h */ typedef > > > +struct { > > > + long __val[2]; > > > +} fsid_t; > > > + > > > +struct statfs { > > > + __fsword_t f_type; > > > + __fsword_t f_bsize; > > > + fsblkcnt_t f_blocks; > > > + fsblkcnt_t f_bfree; > > > + fsblkcnt_t f_bavail; > > > + fsfilcnt_t f_files; > > > + fsfilcnt_t f_ffree; > > > + fsid_t f_fsid; > > > + __fsword_t f_namelen; > > > + __fsword_t f_frsize; > > > + __fsword_t f_flags; > > > +}; > > > + > > > > Does it make sense to define all of these, even though not being used? > > Windows does not have this definition, so use Linux definition can make less > impact to 9pfs code. > If not, need to add many macro "#ifdef CONFIG_WIN32" in other places to > disable the unsupported code.
My bad, I thought most of these were not referenced in code at all, but I just realized they are indeed. Only exception is probably `f_flags`, but I haven't checked yet whether you are using that for something new in your patches. The previous patches LGTM BTW. I still have to look at all following patches though. So better wait some more days before posting a v3. Best regards, Christian Schoenebeck