2014-07-22 13:54:37

by Jeff Moyer

[permalink] [raw]
Subject: Re: [PATCH 2/4] aio: use the macro rather than the inline magic number

Gu Zheng <[email protected]> writes:

> Signed-off-by: Gu Zheng <[email protected]>

Reviewed-by: Jeff Moyer <[email protected]>

> ---
> fs/aio.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index ad35876..1dc6158 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -201,7 +201,7 @@ static struct dentry *aio_mount(struct file_system_type *fs_type,
> static const struct dentry_operations ops = {
> .d_dname = simple_dname,
> };
> - return mount_pseudo(fs_type, "aio:", NULL, &ops, 0xa10a10a1);
> + return mount_pseudo(fs_type, "aio:", NULL, &ops, AIO_RING_MAGIC);
> }
>
> /* aio_setup


2014-07-25 03:13:20

by Ming Lei

[permalink] [raw]
Subject: Re: [PATCH 2/4] aio: use the macro rather than the inline magic number

On Tue, Jul 22, 2014 at 9:54 PM, Jeff Moyer <[email protected]> wrote:
> Gu Zheng <[email protected]> writes:
>
>> Signed-off-by: Gu Zheng <[email protected]>
>
> Reviewed-by: Jeff Moyer <[email protected]>
>
>> ---
>> fs/aio.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/aio.c b/fs/aio.c
>> index ad35876..1dc6158 100644
>> --- a/fs/aio.c
>> +++ b/fs/aio.c
>> @@ -201,7 +201,7 @@ static struct dentry *aio_mount(struct file_system_type *fs_type,
>> static const struct dentry_operations ops = {
>> .d_dname = simple_dname,
>> };
>> - return mount_pseudo(fs_type, "aio:", NULL, &ops, 0xa10a10a1);
>> + return mount_pseudo(fs_type, "aio:", NULL, &ops, AIO_RING_MAGIC);

IMO, it might be better to use a new macro like AIO_FS_MAGIC
with same number here because the same magic number
0xa10a10a1 serves for two purposes.

Thanks,

2014-07-25 06:06:56

by Gu Zheng

[permalink] [raw]
Subject: Re: [PATCH 2/4] aio: use the macro rather than the inline magic number

Hi Lei,
On 07/25/2014 11:13 AM, Ming Lei wrote:

> On Tue, Jul 22, 2014 at 9:54 PM, Jeff Moyer <[email protected]> wrote:
>> Gu Zheng <[email protected]> writes:
>>
>>> Signed-off-by: Gu Zheng <[email protected]>
>>
>> Reviewed-by: Jeff Moyer <[email protected]>
>>
>>> ---
>>> fs/aio.c | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/fs/aio.c b/fs/aio.c
>>> index ad35876..1dc6158 100644
>>> --- a/fs/aio.c
>>> +++ b/fs/aio.c
>>> @@ -201,7 +201,7 @@ static struct dentry *aio_mount(struct file_system_type *fs_type,
>>> static const struct dentry_operations ops = {
>>> .d_dname = simple_dname,
>>> };
>>> - return mount_pseudo(fs_type, "aio:", NULL, &ops, 0xa10a10a1);
>>> + return mount_pseudo(fs_type, "aio:", NULL, &ops, AIO_RING_MAGIC);
>
> IMO, it might be better to use a new macro like AIO_FS_MAGIC
> with same number here because the same magic number
> 0xa10a10a1 serves for two purposes.

Sounds reasonable, but I prefer a more common name like
AIO_MAGIC to serve two if we need.:)

Thanks,
Gu

>
> Thanks,
> .
>