|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v3 11/23] lib/vfscore: introduce UK_FS_REGISTER
Hi,
Sharan Santhanam <sharan.santhanam@xxxxxxxxx> writes:
> Hello Yuri,
>
> This patch seems fine expect for minor comment.
>
>
>
> Thanks & Regards
> Sharan
>
> On 2/7/19 2:58 PM, Yuri Volchkov wrote:
>> The macro registers the filesystem in the static array
>>
>> Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
>> ---
>> lib/vfscore/Makefile.uk | 2 ++
>> lib/vfscore/extra.ld | 9 +++++++++
>> lib/vfscore/include/vfscore/mount.h | 6 +++++-
>> lib/vfscore/mount.c | 24 ++++++++++++++++++------
>> 4 files changed, 34 insertions(+), 7 deletions(-)
>> create mode 100644 lib/vfscore/extra.ld
>>
>> diff --git a/lib/vfscore/include/vfscore/mount.h
>> b/lib/vfscore/include/vfscore/mount.h
>> index 7a638dbe..b4a07323 100644
>> --- a/lib/vfscore/include/vfscore/mount.h
>> +++ b/lib/vfscore/include/vfscore/mount.h
>> @@ -100,12 +100,16 @@ struct mount {
>> /*
>> * Filesystem type switch table.
>> */
>> -struct vfssw {
>> +struct vfscore_fs_type {
>> const char *vs_name; /* name of file system */
>> int (*vs_init)(void); /* initialize routine */
>> struct vfsops *vs_op; /* pointer to vfs operation */
>> };
>> > +#define UK_FS_REGISTER(fssw) \
>> + static void __attribute((__section__(".uk_fs_list"))) \
>> + *__ptr_##fssw __used = &fssw; \
>> +
> Why do we use the type as void * instead of struct vfscore_fs_type*?
I guess 'void *' is shorter :). And it does not make any difference for
type checking in gcc. That is just adding a pointer into a section, and
this declaration will never be used directly.
But I guess just to make it a bit more syntactically correct I will
change this to 'vfscore_fs_type *'. Even though it does not change
anything in terms of compiling, gcc warnings or type checking.
--
Yuri Volchkov
Software Specialist
NEC Europe Ltd
Kurfürsten-Anlage 36
D-69115 Heidelberg
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |