On Tue, 1 Mar 2022 at 20:47, Christian Schoenebeck <qemu_...@crudebyte.com> wrote: > > Function qemu_dirent_dup() is currently only used by 9pfs server, so move > it from project global header osdep.h to 9pfs specific header 9p-util.h. > > Link: > https://lore.kernel.org/qemu-devel/CAFEAcA_=haunomkd2wursvaaha5mrk22a1ohklwudjk7v6k...@mail.gmail.com/ > Based-on: <20220227223522.91937-12-wwco...@gmail.com> > Signed-off-by: Christian Schoenebeck <qemu_...@crudebyte.com> > --- > hw/9pfs/9p-util.h | 30 ++++++++++++++++++++++++++++++ > include/qemu/osdep.h | 13 ------------- > util/osdep.c | 21 --------------------- > 3 files changed, 30 insertions(+), 34 deletions(-) > > diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h > index 1f74d37558..8b92614e6c 100644 > --- a/hw/9pfs/9p-util.h > +++ b/hw/9pfs/9p-util.h > @@ -112,6 +112,36 @@ static inline off_t qemu_dirent_off(struct dirent *dent) > #endif > } > > +/** > + * Duplicate directory entry @dent. > + * > + * It is highly recommended to use this function instead of open coding > + * duplication of @c dirent objects, because the actual @c struct @c dirent > + * size may be bigger or shorter than @c sizeof(struct dirent) and correct > + * handling is platform specific (see gitlab issue #841). > + * > + * @dent - original directory entry to be duplicated > + * @returns duplicated directory entry which should be freed with g_free() > + */
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> since it's just code movement, but those "@c"s look a bit weird: are they really valid kerneldoc comment markup? thanks -- PMM