Patchwork [1/2] ext4: Fix compilation with -DDX_DEBUG

login
register
mail settings
Submitter Bernd Schubert
Date June 17, 2011, 4 p.m.
Message ID <20110617160055.2062012.47590.stgit@localhost.localdomain>
Download mbox | patch
Permalink /patch/100824/
State Superseded
Headers show

Comments

Bernd Schubert - June 17, 2011, 4 p.m.
From: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>

Compilation of ext4/namei.c brought up an error and warning messages
when compiled with -DDX_DEBUG


Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
---
 fs/ext4/namei.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Coly Li - June 17, 2011, 6:29 p.m.
On 2011年06月18日 00:00, Bernd Schubert Wrote:
> From: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
> 
> Compilation of ext4/namei.c brought up an error and warning messages
> when compiled with -DDX_DEBUG
> 
> 
> Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
> ---
>  fs/ext4/namei.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index b754b77..6f32da4 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -288,8 +288,8 @@ static struct stats dx_show_leaf(struct dx_hash_info *hinfo, struct ext4_dir_ent
>  				char *name = de->name;
>  				while (len--) printk("%c", *name++);
>  				ext4fs_dirhash(de->name, de->name_len, &h);
> -				printk(":%x.%u ", h.hash,
> -				       ((char *) de - base));
> +				printk(":%x.%ld ", h.hash,
> +				       (long) ((char *) de - base));
>  			}

How about use %p in printk like
> +				printk(":%x.%p ", h.hash,
> +				       ((char *) de - base));



>  			space += EXT4_DIR_REC_LEN(de->name_len);
>  			names++;
> @@ -1013,7 +1013,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct q
>  
>  	*err = -ENOENT;
>  errout:
> -	dxtrace(printk(KERN_DEBUG "%s not found\n", name));
> +	dxtrace(printk(KERN_DEBUG "%s not found\n", d_name->name));

Nice catch :-)

[snip]
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bernd Schubert - June 17, 2011, 9:25 p.m.
On 06/17/2011 08:29 PM, Coly Li wrote:
> On 2011年06月18日 00:00, Bernd Schubert Wrote:
>> From: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
>>
>> Compilation of ext4/namei.c brought up an error and warning messages
>> when compiled with -DDX_DEBUG
>>
>>
>> Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
>> ---
>>  fs/ext4/namei.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
>> index b754b77..6f32da4 100644
>> --- a/fs/ext4/namei.c
>> +++ b/fs/ext4/namei.c
>> @@ -288,8 +288,8 @@ static struct stats dx_show_leaf(struct dx_hash_info *hinfo, struct ext4_dir_ent
>>  				char *name = de->name;
>>  				while (len--) printk("%c", *name++);
>>  				ext4fs_dirhash(de->name, de->name_len, &h);
>> -				printk(":%x.%u ", h.hash,
>> -				       ((char *) de - base));
>> +				printk(":%x.%ld ", h.hash,
>> +				       (long) ((char *) de - base));
>>  			}
> 
> How about use %p in printk like
>> +				printk(":%x.%p ", h.hash,
>> +				       ((char *) de - base));
> 

Fine with me :) I will send updated patches on Monday.

Cheers,
Bernd
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index b754b77..6f32da4 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -288,8 +288,8 @@  static struct stats dx_show_leaf(struct dx_hash_info *hinfo, struct ext4_dir_ent
 				char *name = de->name;
 				while (len--) printk("%c", *name++);
 				ext4fs_dirhash(de->name, de->name_len, &h);
-				printk(":%x.%u ", h.hash,
-				       ((char *) de - base));
+				printk(":%x.%ld ", h.hash,
+				       (long) ((char *) de - base));
 			}
 			space += EXT4_DIR_REC_LEN(de->name_len);
 			names++;
@@ -1013,7 +1013,7 @@  static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct q
 
 	*err = -ENOENT;
 errout:
-	dxtrace(printk(KERN_DEBUG "%s not found\n", name));
+	dxtrace(printk(KERN_DEBUG "%s not found\n", d_name->name));
 	dx_release (frames);
 	return NULL;
 }