linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] f2fs: no need to take the address of the array of sb->s_uuid
@ 2018-04-05  3:58 Gao Xiang
  2018-04-08  1:45 ` Chao Yu
  2018-04-08 12:16 ` Chao Yu
  0 siblings, 2 replies; 4+ messages in thread
From: Gao Xiang @ 2018-04-05  3:58 UTC (permalink / raw)
  To: Jaegeuk Kim, chao@kernel.org
  Cc: Gao Xiang, hutj, linux-f2fs-devel@lists.sourceforge.net

Keep in line with the common case since it is some weird
to take the address of an array again.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
---
fix auto-wrapping of email client

 fs/f2fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 9587ca0..4d467c7 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2565,7 +2565,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 	sb->s_time_gran = 1;
 	sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
 		(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
-	memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
+	memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
 	sb->s_iflags |= SB_I_CGROUPWB;
 
 	/* init f2fs-specific super block info */
-- 
2.1.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH] f2fs: no need to take the address of the array of sb->s_uuid
  2018-04-05  3:58 [RESEND PATCH] f2fs: no need to take the address of the array of sb->s_uuid Gao Xiang
@ 2018-04-08  1:45 ` Chao Yu
  2018-04-08 12:16 ` Chao Yu
  1 sibling, 0 replies; 4+ messages in thread
From: Chao Yu @ 2018-04-08  1:45 UTC (permalink / raw)
  To: Gao Xiang, Jaegeuk Kim, chao@kernel.org
  Cc: Gao Xiang, hutj, linux-f2fs-devel@lists.sourceforge.net

On 2018/4/5 11:58, Gao Xiang wrote:
> Keep in line with the common case since it is some weird
> to take the address of an array again.
> 
> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH] f2fs: no need to take the address of the array of sb->s_uuid
  2018-04-05  3:58 [RESEND PATCH] f2fs: no need to take the address of the array of sb->s_uuid Gao Xiang
  2018-04-08  1:45 ` Chao Yu
@ 2018-04-08 12:16 ` Chao Yu
  2018-04-08 13:47   ` Gao Xiang
  1 sibling, 1 reply; 4+ messages in thread
From: Chao Yu @ 2018-04-08 12:16 UTC (permalink / raw)
  To: Gao Xiang, Jaegeuk Kim
  Cc: Gao Xiang, hutj, linux-f2fs-devel@lists.sourceforge.net

On 2018/4/5 11:58, Gao Xiang wrote:
> Keep in line with the common case since it is some weird
> to take the address of an array again.

I encounter compile error after applying this patch:

super.c: In function ‘f2fs_fill_super’:
super.c:2711:2: error: incompatible type for argument 1 of ‘__builtin_memcpy’
  memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
  ^
super.c:2711:2: note: expected ‘void *’ but argument is of type ‘uuid_t’

Anyway, we need '&' due to sb::s_uuid is a structure object instead of an array.

Thanks,

> 
> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
> ---
> fix auto-wrapping of email client
> 
>  fs/f2fs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 9587ca0..4d467c7 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -2565,7 +2565,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
>  	sb->s_time_gran = 1;
>  	sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
>  		(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
> -	memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
> +	memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
>  	sb->s_iflags |= SB_I_CGROUPWB;
>  
>  	/* init f2fs-specific super block info */
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RESEND PATCH] f2fs: no need to take the address of the array of sb->s_uuid
  2018-04-08 12:16 ` Chao Yu
@ 2018-04-08 13:47   ` Gao Xiang
  0 siblings, 0 replies; 4+ messages in thread
From: Gao Xiang @ 2018-04-08 13:47 UTC (permalink / raw)
  To: Chao Yu, Jaegeuk Kim
  Cc: Gao Xiang, hutj, linux-f2fs-devel@lists.sourceforge.net

Hi Chao and Jaegeuk,

On 2018/4/8 20:16, Chao Yu wrote:
> On 2018/4/5 11:58, Gao Xiang wrote:
>> Keep in line with the common case since it is some weird
>> to take the address of an array again.
> 
> I encounter compile error after applying this patch:
> 
> super.c: In function ‘f2fs_fill_super’:
> super.c:2711:2: error: incompatible type for argument 1 of ‘__builtin_memcpy’
>   memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
>   ^
> super.c:2711:2: note: expected ‘void *’ but argument is of type ‘uuid_t’
> 
> Anyway, we need '&' due to sb::s_uuid is a structure object instead of an array.
> 
> Thanks,
> 
Sorry, I'm developing another feature related to it.
But I checked the source code about sb->uuid from 3.x to 4.9.
https://elixir.bootlin.com/linux/v4.9.93/source/include/linux/fs.h#L1382

It seems that the latest kernel changed from u8 s_uuid[16] to uuid_t s_uuid.

Sorry for annoying, please ignore this patch.

Thanks,

>>
>> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
>> ---
>> fix auto-wrapping of email client
>>
>>  fs/f2fs/super.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
>> index 9587ca0..4d467c7 100644
>> --- a/fs/f2fs/super.c
>> +++ b/fs/f2fs/super.c
>> @@ -2565,7 +2565,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
>>  	sb->s_time_gran = 1;
>>  	sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
>>  		(test_opt(sbi, POSIX_ACL) ? SB_POSIXACL : 0);
>> -	memcpy(&sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
>> +	memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid));
>>  	sb->s_iflags |= SB_I_CGROUPWB;
>>  
>>  	/* init f2fs-specific super block info */
>>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-08 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-05  3:58 [RESEND PATCH] f2fs: no need to take the address of the array of sb->s_uuid Gao Xiang
2018-04-08  1:45 ` Chao Yu
2018-04-08 12:16 ` Chao Yu
2018-04-08 13:47   ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).