* [PATCH] btrfs:make btrfs_init_compress() return void
@ 2011-08-22 14:22 Wanlong Gao
2011-08-22 23:43 ` Tsutomu Itoh
2011-08-23 0:16 ` [PATCH v2] " Wanlong Gao
0 siblings, 2 replies; 4+ messages in thread
From: Wanlong Gao @ 2011-08-22 14:22 UTC (permalink / raw)
To: linux-btrfs, linux-kernel; +Cc: chris.mason, Wanlong Gao
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Make btrfs_init_compress() return void, since it always return 0,
and no need to check return value.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
---
fs/btrfs/compression.c | 3 +--
fs/btrfs/compression.h | 2 +-
fs/btrfs/super.c | 7 ++-----
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 8ec5d86..b2dbefa 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -731,7 +731,7 @@ struct btrfs_compress_op *btrfs_compress_op[] = {
&btrfs_lzo_compress,
};
-int __init btrfs_init_compress(void)
+void __init btrfs_init_compress(void)
{
int i;
@@ -741,7 +741,6 @@ int __init btrfs_init_compress(void)
atomic_set(&comp_alloc_workspace[i], 0);
init_waitqueue_head(&comp_workspace_wait[i]);
}
- return 0;
}
/*
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index a12059f..9afb0a6 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -19,7 +19,7 @@
#ifndef __BTRFS_COMPRESSION_
#define __BTRFS_COMPRESSION_
-int btrfs_init_compress(void);
+void btrfs_init_compress(void);
void btrfs_exit_compress(void);
int btrfs_compress_pages(int type, struct address_space *mapping,
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 15634d4..31e9654 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1238,9 +1238,7 @@ static int __init init_btrfs_fs(void)
if (err)
return err;
- err = btrfs_init_compress();
- if (err)
- goto free_sysfs;
+ btrfs_init_compress();
err = btrfs_init_cachep();
if (err)
@@ -1281,8 +1279,7 @@ free_cachep:
btrfs_destroy_cachep();
free_compress:
btrfs_exit_compress();
-free_sysfs:
- btrfs_exit_sysfs();
+
return err;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs:make btrfs_init_compress() return void
2011-08-22 14:22 [PATCH] btrfs:make btrfs_init_compress() return void Wanlong Gao
@ 2011-08-22 23:43 ` Tsutomu Itoh
2011-08-23 0:05 ` Wanlong Gao
2011-08-23 0:16 ` [PATCH v2] " Wanlong Gao
1 sibling, 1 reply; 4+ messages in thread
From: Tsutomu Itoh @ 2011-08-22 23:43 UTC (permalink / raw)
To: Wanlong Gao; +Cc: linux-btrfs, linux-kernel, chris.mason
(2011/08/22 23:22), Wanlong Gao wrote:
> From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
>
> Make btrfs_init_compress() return void, since it always return 0,
> and no need to check return value.
>
> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> ---
> fs/btrfs/compression.c | 3 +--
> fs/btrfs/compression.h | 2 +-
> fs/btrfs/super.c | 7 ++-----
> 3 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index 8ec5d86..b2dbefa 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -731,7 +731,7 @@ struct btrfs_compress_op *btrfs_compress_op[] = {
> &btrfs_lzo_compress,
> };
>
> -int __init btrfs_init_compress(void)
> +void __init btrfs_init_compress(void)
> {
> int i;
>
> @@ -741,7 +741,6 @@ int __init btrfs_init_compress(void)
> atomic_set(&comp_alloc_workspace[i], 0);
> init_waitqueue_head(&comp_workspace_wait[i]);
> }
> - return 0;
> }
>
> /*
> diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
> index a12059f..9afb0a6 100644
> --- a/fs/btrfs/compression.h
> +++ b/fs/btrfs/compression.h
> @@ -19,7 +19,7 @@
> #ifndef __BTRFS_COMPRESSION_
> #define __BTRFS_COMPRESSION_
>
> -int btrfs_init_compress(void);
> +void btrfs_init_compress(void);
> void btrfs_exit_compress(void);
>
> int btrfs_compress_pages(int type, struct address_space *mapping,
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 15634d4..31e9654 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1238,9 +1238,7 @@ static int __init init_btrfs_fs(void)
> if (err)
> return err;
>
> - err = btrfs_init_compress();
> - if (err)
> - goto free_sysfs;
> + btrfs_init_compress();
>
> err = btrfs_init_cachep();
> if (err)
> @@ -1281,8 +1279,7 @@ free_cachep:
> btrfs_destroy_cachep();
> free_compress:
> btrfs_exit_compress();
> -free_sysfs:
> - btrfs_exit_sysfs();
> +
Why remove btrfs_exit_sysfs()?
-Tsutomu
> return err;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs:make btrfs_init_compress() return void
2011-08-22 23:43 ` Tsutomu Itoh
@ 2011-08-23 0:05 ` Wanlong Gao
0 siblings, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2011-08-23 0:05 UTC (permalink / raw)
To: Tsutomu Itoh; +Cc: Wanlong Gao, linux-btrfs, linux-kernel, chris.mason
On 08/23/2011 07:43 AM, Tsutomu Itoh wrote:
> (2011/08/22 23:22), Wanlong Gao wrote:
>> From: Wanlong Gao<gaowanlong@cn.fujitsu.com>
>>
>> Make btrfs_init_compress() return void, since it always return 0,
>> and no need to check return value.
>>
>> Signed-off-by: Wanlong Gao<gaowanlong@cn.fujitsu.com>
>> ---
>> fs/btrfs/compression.c | 3 +--
>> fs/btrfs/compression.h | 2 +-
>> fs/btrfs/super.c | 7 ++-----
>> 3 files changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
>> index 8ec5d86..b2dbefa 100644
>> --- a/fs/btrfs/compression.c
>> +++ b/fs/btrfs/compression.c
>> @@ -731,7 +731,7 @@ struct btrfs_compress_op *btrfs_compress_op[] = {
>> &btrfs_lzo_compress,
>> };
>>
>> -int __init btrfs_init_compress(void)
>> +void __init btrfs_init_compress(void)
>> {
>> int i;
>>
>> @@ -741,7 +741,6 @@ int __init btrfs_init_compress(void)
>> atomic_set(&comp_alloc_workspace[i], 0);
>> init_waitqueue_head(&comp_workspace_wait[i]);
>> }
>> - return 0;
>> }
>>
>> /*
>> diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
>> index a12059f..9afb0a6 100644
>> --- a/fs/btrfs/compression.h
>> +++ b/fs/btrfs/compression.h
>> @@ -19,7 +19,7 @@
>> #ifndef __BTRFS_COMPRESSION_
>> #define __BTRFS_COMPRESSION_
>>
>> -int btrfs_init_compress(void);
>> +void btrfs_init_compress(void);
>> void btrfs_exit_compress(void);
>>
>> int btrfs_compress_pages(int type, struct address_space *mapping,
>> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
>> index 15634d4..31e9654 100644
>> --- a/fs/btrfs/super.c
>> +++ b/fs/btrfs/super.c
>> @@ -1238,9 +1238,7 @@ static int __init init_btrfs_fs(void)
>> if (err)
>> return err;
>>
>> - err = btrfs_init_compress();
>> - if (err)
>> - goto free_sysfs;
>> + btrfs_init_compress();
>>
>> err = btrfs_init_cachep();
>> if (err)
>> @@ -1281,8 +1279,7 @@ free_cachep:
>> btrfs_destroy_cachep();
>> free_compress:
>> btrfs_exit_compress();
>
>> -free_sysfs:
>> - btrfs_exit_sysfs();
>> +
>
> Why remove btrfs_exit_sysfs()?
Yeah, a mistake, just wanna remove the label.
Thanks
-Wanlong Gao
>
> -Tsutomu
>
>> return err;
>> }
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] btrfs:make btrfs_init_compress() return void
2011-08-22 14:22 [PATCH] btrfs:make btrfs_init_compress() return void Wanlong Gao
2011-08-22 23:43 ` Tsutomu Itoh
@ 2011-08-23 0:16 ` Wanlong Gao
1 sibling, 0 replies; 4+ messages in thread
From: Wanlong Gao @ 2011-08-23 0:16 UTC (permalink / raw)
To: linux-btrfs, linux-kernel; +Cc: Wanlong Gao, chris.mason, Wanlong Gao, t-itoh
Make btrfs_init_compress() return void, since it always return 0,
and no need to check return value.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
---
fs/btrfs/compression.c | 3 +--
fs/btrfs/compression.h | 2 +-
fs/btrfs/super.c | 7 +++----
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 8ec5d86..b2dbefa 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -731,7 +731,7 @@ struct btrfs_compress_op *btrfs_compress_op[] = {
&btrfs_lzo_compress,
};
-int __init btrfs_init_compress(void)
+void __init btrfs_init_compress(void)
{
int i;
@@ -741,7 +741,6 @@ int __init btrfs_init_compress(void)
atomic_set(&comp_alloc_workspace[i], 0);
init_waitqueue_head(&comp_workspace_wait[i]);
}
- return 0;
}
/*
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index a12059f..9afb0a6 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -19,7 +19,7 @@
#ifndef __BTRFS_COMPRESSION_
#define __BTRFS_COMPRESSION_
-int btrfs_init_compress(void);
+void btrfs_init_compress(void);
void btrfs_exit_compress(void);
int btrfs_compress_pages(int type, struct address_space *mapping,
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 15634d4..ece8d9f 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1238,9 +1238,7 @@ static int __init init_btrfs_fs(void)
if (err)
return err;
- err = btrfs_init_compress();
- if (err)
- goto free_sysfs;
+ btrfs_init_compress();
err = btrfs_init_cachep();
if (err)
@@ -1281,8 +1279,9 @@ free_cachep:
btrfs_destroy_cachep();
free_compress:
btrfs_exit_compress();
-free_sysfs:
+
btrfs_exit_sysfs();
+
return err;
}
--
1.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-23 0:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22 14:22 [PATCH] btrfs:make btrfs_init_compress() return void Wanlong Gao
2011-08-22 23:43 ` Tsutomu Itoh
2011-08-23 0:05 ` Wanlong Gao
2011-08-23 0:16 ` [PATCH v2] " Wanlong Gao
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).