* [PATCH] Btrfs: make ulist_{init,fin}() static and not exported as symbol
@ 2013-04-20 14:43 Wang Shilong
2013-04-20 17:43 ` Eric Sandeen
0 siblings, 1 reply; 3+ messages in thread
From: Wang Shilong @ 2013-04-20 14:43 UTC (permalink / raw)
To: linux-btrfs
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
ulist is a generic structure to iterate tree. we export them
just in the hope it may be used by other modules. However, until
now, it is just used by btrfs. The main point is that ulist_{init,fin}()
should be only called by ulist_{alloc,reinit,free}().So we don't need
to export them and make them staic will be best choice.
Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
---
fs/btrfs/ulist.c | 6 ++----
fs/btrfs/ulist.h | 2 --
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/ulist.c b/fs/btrfs/ulist.c
index ddc61ca..50fc1c4 100644
--- a/fs/btrfs/ulist.c
+++ b/fs/btrfs/ulist.c
@@ -48,13 +48,12 @@
* Note: don't use this function to init an already used ulist, use
* ulist_reinit instead.
*/
-void ulist_init(struct ulist *ulist)
+static void ulist_init(struct ulist *ulist)
{
ulist->nnodes = 0;
ulist->nodes = ulist->int_nodes;
ulist->nodes_alloced = ULIST_SIZE;
}
-EXPORT_SYMBOL(ulist_init);
/**
* ulist_fini - free up additionally allocated memory for the ulist
@@ -63,7 +62,7 @@ EXPORT_SYMBOL(ulist_init);
* This is useful in cases where the base 'struct ulist' has been statically
* allocated.
*/
-void ulist_fini(struct ulist *ulist)
+static void ulist_fini(struct ulist *ulist)
{
/*
* The first ULIST_SIZE elements are stored inline in struct ulist.
@@ -73,7 +72,6 @@ void ulist_fini(struct ulist *ulist)
kfree(ulist->nodes);
ulist->nodes_alloced = 0; /* in case ulist_fini is called twice */
}
-EXPORT_SYMBOL(ulist_fini);
/**
* ulist_reinit - prepare a ulist for reuse
diff --git a/fs/btrfs/ulist.h b/fs/btrfs/ulist.h
index 21a1963..e05db47 100644
--- a/fs/btrfs/ulist.h
+++ b/fs/btrfs/ulist.h
@@ -60,8 +60,6 @@ struct ulist {
struct ulist_node int_nodes[ULIST_SIZE];
};
-void ulist_init(struct ulist *ulist);
-void ulist_fini(struct ulist *ulist);
void ulist_reinit(struct ulist *ulist);
struct ulist *ulist_alloc(gfp_t gfp_mask);
void ulist_free(struct ulist *ulist);
--
1.7.11.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Btrfs: make ulist_{init,fin}() static and not exported as symbol
2013-04-20 14:43 [PATCH] Btrfs: make ulist_{init,fin}() static and not exported as symbol Wang Shilong
@ 2013-04-20 17:43 ` Eric Sandeen
2013-04-20 18:09 ` Arne Jansen
0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2013-04-20 17:43 UTC (permalink / raw)
To: Wang Shilong; +Cc: linux-btrfs
On 4/20/13 7:43 AM, Wang Shilong wrote:
> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>
> ulist is a generic structure to iterate tree. we export them
> just in the hope it may be used by other modules. However, until
> now, it is just used by btrfs. The main point is that ulist_{init,fin}()
> should be only called by ulist_{alloc,reinit,free}().So we don't need
> to export them and make them staic will be best choice.
It actually seems like all EXPORT_SYMBOLS should be removed, no?
I can't imagine that btrfs needs to be exporting any of these
functions to any other module...
Thanks,
-Eric
> Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
> ---
> fs/btrfs/ulist.c | 6 ++----
> fs/btrfs/ulist.h | 2 --
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/fs/btrfs/ulist.c b/fs/btrfs/ulist.c
> index ddc61ca..50fc1c4 100644
> --- a/fs/btrfs/ulist.c
> +++ b/fs/btrfs/ulist.c
> @@ -48,13 +48,12 @@
> * Note: don't use this function to init an already used ulist, use
> * ulist_reinit instead.
> */
> -void ulist_init(struct ulist *ulist)
> +static void ulist_init(struct ulist *ulist)
> {
> ulist->nnodes = 0;
> ulist->nodes = ulist->int_nodes;
> ulist->nodes_alloced = ULIST_SIZE;
> }
> -EXPORT_SYMBOL(ulist_init);
>
> /**
> * ulist_fini - free up additionally allocated memory for the ulist
> @@ -63,7 +62,7 @@ EXPORT_SYMBOL(ulist_init);
> * This is useful in cases where the base 'struct ulist' has been statically
> * allocated.
> */
> -void ulist_fini(struct ulist *ulist)
> +static void ulist_fini(struct ulist *ulist)
> {
> /*
> * The first ULIST_SIZE elements are stored inline in struct ulist.
> @@ -73,7 +72,6 @@ void ulist_fini(struct ulist *ulist)
> kfree(ulist->nodes);
> ulist->nodes_alloced = 0; /* in case ulist_fini is called twice */
> }
> -EXPORT_SYMBOL(ulist_fini);
>
> /**
> * ulist_reinit - prepare a ulist for reuse
> diff --git a/fs/btrfs/ulist.h b/fs/btrfs/ulist.h
> index 21a1963..e05db47 100644
> --- a/fs/btrfs/ulist.h
> +++ b/fs/btrfs/ulist.h
> @@ -60,8 +60,6 @@ struct ulist {
> struct ulist_node int_nodes[ULIST_SIZE];
> };
>
> -void ulist_init(struct ulist *ulist);
> -void ulist_fini(struct ulist *ulist);
> void ulist_reinit(struct ulist *ulist);
> struct ulist *ulist_alloc(gfp_t gfp_mask);
> void ulist_free(struct ulist *ulist);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Btrfs: make ulist_{init,fin}() static and not exported as symbol
2013-04-20 17:43 ` Eric Sandeen
@ 2013-04-20 18:09 ` Arne Jansen
0 siblings, 0 replies; 3+ messages in thread
From: Arne Jansen @ 2013-04-20 18:09 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Wang Shilong, linux-btrfs
On 04/20/13 19:43, Eric Sandeen wrote:
> On 4/20/13 7:43 AM, Wang Shilong wrote:
>> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>>
>> ulist is a generic structure to iterate tree. we export them
>> just in the hope it may be used by other modules. However, until
>> now, it is just used by btrfs. The main point is that ulist_{init,fin}()
>> should be only called by ulist_{alloc,reinit,free}().So we don't need
>> to export them and make them staic will be best choice.
>
> It actually seems like all EXPORT_SYMBOLS should be removed, no?
> I can't imagine that btrfs needs to be exporting any of these
> functions to any other module...
let's see that we move ulists to lib/ for 3.10.
-Arne
>
> Thanks,
> -Eric
>
>> Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>> ---
>> fs/btrfs/ulist.c | 6 ++----
>> fs/btrfs/ulist.h | 2 --
>> 2 files changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/fs/btrfs/ulist.c b/fs/btrfs/ulist.c
>> index ddc61ca..50fc1c4 100644
>> --- a/fs/btrfs/ulist.c
>> +++ b/fs/btrfs/ulist.c
>> @@ -48,13 +48,12 @@
>> * Note: don't use this function to init an already used ulist, use
>> * ulist_reinit instead.
>> */
>> -void ulist_init(struct ulist *ulist)
>> +static void ulist_init(struct ulist *ulist)
>> {
>> ulist->nnodes = 0;
>> ulist->nodes = ulist->int_nodes;
>> ulist->nodes_alloced = ULIST_SIZE;
>> }
>> -EXPORT_SYMBOL(ulist_init);
>>
>> /**
>> * ulist_fini - free up additionally allocated memory for the ulist
>> @@ -63,7 +62,7 @@ EXPORT_SYMBOL(ulist_init);
>> * This is useful in cases where the base 'struct ulist' has been statically
>> * allocated.
>> */
>> -void ulist_fini(struct ulist *ulist)
>> +static void ulist_fini(struct ulist *ulist)
>> {
>> /*
>> * The first ULIST_SIZE elements are stored inline in struct ulist.
>> @@ -73,7 +72,6 @@ void ulist_fini(struct ulist *ulist)
>> kfree(ulist->nodes);
>> ulist->nodes_alloced = 0; /* in case ulist_fini is called twice */
>> }
>> -EXPORT_SYMBOL(ulist_fini);
>>
>> /**
>> * ulist_reinit - prepare a ulist for reuse
>> diff --git a/fs/btrfs/ulist.h b/fs/btrfs/ulist.h
>> index 21a1963..e05db47 100644
>> --- a/fs/btrfs/ulist.h
>> +++ b/fs/btrfs/ulist.h
>> @@ -60,8 +60,6 @@ struct ulist {
>> struct ulist_node int_nodes[ULIST_SIZE];
>> };
>>
>> -void ulist_init(struct ulist *ulist);
>> -void ulist_fini(struct ulist *ulist);
>> void ulist_reinit(struct ulist *ulist);
>> struct ulist *ulist_alloc(gfp_t gfp_mask);
>> void ulist_free(struct ulist *ulist);
>>
>
> --
> 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] 3+ messages in thread
end of thread, other threads:[~2013-04-20 18:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-20 14:43 [PATCH] Btrfs: make ulist_{init,fin}() static and not exported as symbol Wang Shilong
2013-04-20 17:43 ` Eric Sandeen
2013-04-20 18:09 ` Arne Jansen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox