* [PATCH v2 0/3] ocfs2: A few clean_ups @ 2022-07-21 20:49 Christophe JAILLET 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Christophe JAILLET @ 2022-07-21 20:49 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, kernel-janitors, Christophe JAILLET Patch 1 and 2 were patch 1/3 and 3/3 in v1. Code is unchanged and R-b tag are already added. Patch 3 is new. It is just a typo Christophe JAILLET (3): ocfs2: Remove some useless functions ocfs2: use the bitmap API to simplify code ocfs2: Fix a typo in a comment fs/ocfs2/heartbeat.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) -- 2.34.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/3] ocfs2: Remove some useless functions 2022-07-21 20:49 [PATCH v2 0/3] ocfs2: A few clean_ups Christophe JAILLET @ 2022-07-21 20:49 ` Christophe JAILLET via Ocfs2-devel 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2 siblings, 0 replies; 9+ messages in thread From: Christophe JAILLET @ 2022-07-21 20:49 UTC (permalink / raw) To: akpm, Mark Fasheh, Joel Becker, Joseph Qi Cc: linux-kernel, kernel-janitors, Christophe JAILLET, ocfs2-devel __ocfs2_node_map_set_bit() and __ocfs2_node_map_clear_bit() are just wrapper around set_bit() and clear_bit(). The leading __ also makes think that these functions are non-atomic just like __set_bit() and __clear_bit(). So, just remove these wrappers and call set_bit() and clear_bit() directly. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> --- v1 -> v2 - fix a typo in the log message - add R-b tag --- fs/ocfs2/heartbeat.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index 9099d8fc7599..1d72e0788943 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -24,11 +24,6 @@ #include "buffer_head_io.h" -static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, - int bit); -static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map, - int bit); - /* special case -1 for now * TODO: should *really* make sure the calling func never passes -1!! */ static void ocfs2_node_map_init(struct ocfs2_node_map *map) @@ -65,12 +60,6 @@ void ocfs2_do_node_down(int node_num, void *data) ocfs2_recovery_thread(osb, node_num); } -static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, - int bit) -{ - set_bit(bit, map->map); -} - void ocfs2_node_map_set_bit(struct ocfs2_super *osb, struct ocfs2_node_map *map, int bit) @@ -79,16 +68,10 @@ void ocfs2_node_map_set_bit(struct ocfs2_super *osb, return; BUG_ON(bit >= map->num_nodes); spin_lock(&osb->node_map_lock); - __ocfs2_node_map_set_bit(map, bit); + set_bit(bit, map->map); spin_unlock(&osb->node_map_lock); } -static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map, - int bit) -{ - clear_bit(bit, map->map); -} - void ocfs2_node_map_clear_bit(struct ocfs2_super *osb, struct ocfs2_node_map *map, int bit) @@ -97,7 +80,7 @@ void ocfs2_node_map_clear_bit(struct ocfs2_super *osb, return; BUG_ON(bit >= map->num_nodes); spin_lock(&osb->node_map_lock); - __ocfs2_node_map_clear_bit(map, bit); + clear_bit(bit, map->map); spin_unlock(&osb->node_map_lock); } -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH v2 1/3] ocfs2: Remove some useless functions @ 2022-07-21 20:49 ` Christophe JAILLET via Ocfs2-devel 0 siblings, 0 replies; 9+ messages in thread From: Christophe JAILLET via Ocfs2-devel @ 2022-07-21 20:49 UTC (permalink / raw) To: akpm, Mark Fasheh, Joel Becker, Joseph Qi Cc: Christophe JAILLET, kernel-janitors, linux-kernel, ocfs2-devel __ocfs2_node_map_set_bit() and __ocfs2_node_map_clear_bit() are just wrapper around set_bit() and clear_bit(). The leading __ also makes think that these functions are non-atomic just like __set_bit() and __clear_bit(). So, just remove these wrappers and call set_bit() and clear_bit() directly. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> --- v1 -> v2 - fix a typo in the log message - add R-b tag --- fs/ocfs2/heartbeat.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index 9099d8fc7599..1d72e0788943 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -24,11 +24,6 @@ #include "buffer_head_io.h" -static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, - int bit); -static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map, - int bit); - /* special case -1 for now * TODO: should *really* make sure the calling func never passes -1!! */ static void ocfs2_node_map_init(struct ocfs2_node_map *map) @@ -65,12 +60,6 @@ void ocfs2_do_node_down(int node_num, void *data) ocfs2_recovery_thread(osb, node_num); } -static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, - int bit) -{ - set_bit(bit, map->map); -} - void ocfs2_node_map_set_bit(struct ocfs2_super *osb, struct ocfs2_node_map *map, int bit) @@ -79,16 +68,10 @@ void ocfs2_node_map_set_bit(struct ocfs2_super *osb, return; BUG_ON(bit >= map->num_nodes); spin_lock(&osb->node_map_lock); - __ocfs2_node_map_set_bit(map, bit); + set_bit(bit, map->map); spin_unlock(&osb->node_map_lock); } -static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map, - int bit) -{ - clear_bit(bit, map->map); -} - void ocfs2_node_map_clear_bit(struct ocfs2_super *osb, struct ocfs2_node_map *map, int bit) @@ -97,7 +80,7 @@ void ocfs2_node_map_clear_bit(struct ocfs2_super *osb, return; BUG_ON(bit >= map->num_nodes); spin_lock(&osb->node_map_lock); - __ocfs2_node_map_clear_bit(map, bit); + clear_bit(bit, map->map); spin_unlock(&osb->node_map_lock); } -- 2.34.1 _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/3] ocfs2: use the bitmap API to simplify code 2022-07-21 20:49 [PATCH v2 0/3] ocfs2: A few clean_ups Christophe JAILLET @ 2022-07-21 20:49 ` Christophe JAILLET via Ocfs2-devel 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2 siblings, 0 replies; 9+ messages in thread From: Christophe JAILLET @ 2022-07-21 20:49 UTC (permalink / raw) To: akpm, Mark Fasheh, Joel Becker, Joseph Qi Cc: linux-kernel, kernel-janitors, Christophe JAILLET, ocfs2-devel Use bitmap_zero() instead of hand-writing it. It is less verbose. While at it, add an explicit #include <linux/bitmap.h>. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> --- v1 -> v2 - no change - it was patch 3/3 in v1 --- fs/ocfs2/heartbeat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index 1d72e0788943..dd29d60af154 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -8,6 +8,7 @@ * Copyright (C) 2002, 2004 Oracle. All rights reserved. */ +#include <linux/bitmap.h> #include <linux/fs.h> #include <linux/types.h> #include <linux/highmem.h> @@ -29,8 +30,7 @@ static void ocfs2_node_map_init(struct ocfs2_node_map *map) { map->num_nodes = OCFS2_NODE_MAP_MAX_NODES; - memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) * - sizeof(unsigned long)); + bitmap_zero(map->map, OCFS2_NODE_MAP_MAX_NODES); } void ocfs2_init_node_maps(struct ocfs2_super *osb) -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH v2 2/3] ocfs2: use the bitmap API to simplify code @ 2022-07-21 20:49 ` Christophe JAILLET via Ocfs2-devel 0 siblings, 0 replies; 9+ messages in thread From: Christophe JAILLET via Ocfs2-devel @ 2022-07-21 20:49 UTC (permalink / raw) To: akpm, Mark Fasheh, Joel Becker, Joseph Qi Cc: Christophe JAILLET, kernel-janitors, linux-kernel, ocfs2-devel Use bitmap_zero() instead of hand-writing it. It is less verbose. While at it, add an explicit #include <linux/bitmap.h>. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> --- v1 -> v2 - no change - it was patch 3/3 in v1 --- fs/ocfs2/heartbeat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index 1d72e0788943..dd29d60af154 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -8,6 +8,7 @@ * Copyright (C) 2002, 2004 Oracle. All rights reserved. */ +#include <linux/bitmap.h> #include <linux/fs.h> #include <linux/types.h> #include <linux/highmem.h> @@ -29,8 +30,7 @@ static void ocfs2_node_map_init(struct ocfs2_node_map *map) { map->num_nodes = OCFS2_NODE_MAP_MAX_NODES; - memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) * - sizeof(unsigned long)); + bitmap_zero(map->map, OCFS2_NODE_MAP_MAX_NODES); } void ocfs2_init_node_maps(struct ocfs2_super *osb) -- 2.34.1 _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 3/3] ocfs2: Fix a typo in a comment 2022-07-21 20:49 [PATCH v2 0/3] ocfs2: A few clean_ups Christophe JAILLET @ 2022-07-21 20:49 ` Christophe JAILLET via Ocfs2-devel 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2 siblings, 0 replies; 9+ messages in thread From: Christophe JAILLET @ 2022-07-21 20:49 UTC (permalink / raw) To: akpm, Mark Fasheh, Joel Becker, Joseph Qi Cc: linux-kernel, kernel-janitors, Christophe JAILLET, ocfs2-devel s/heartbaet/heartbeat Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- v1 -> v2 - this patch is new in the serie --- fs/ocfs2/heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index dd29d60af154..22da768e65b7 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -2,7 +2,7 @@ /* * heartbeat.c * - * Register ourselves with the heartbaet service, keep our node maps + * Register ourselves with the heartbeat service, keep our node maps * up to date, and fire off recovery when needed. * * Copyright (C) 2002, 2004 Oracle. All rights reserved. -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH v2 3/3] ocfs2: Fix a typo in a comment @ 2022-07-21 20:49 ` Christophe JAILLET via Ocfs2-devel 0 siblings, 0 replies; 9+ messages in thread From: Christophe JAILLET via Ocfs2-devel @ 2022-07-21 20:49 UTC (permalink / raw) To: akpm, Mark Fasheh, Joel Becker, Joseph Qi Cc: Christophe JAILLET, kernel-janitors, linux-kernel, ocfs2-devel s/heartbaet/heartbeat Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- v1 -> v2 - this patch is new in the serie --- fs/ocfs2/heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index dd29d60af154..22da768e65b7 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -2,7 +2,7 @@ /* * heartbeat.c * - * Register ourselves with the heartbaet service, keep our node maps + * Register ourselves with the heartbeat service, keep our node maps * up to date, and fire off recovery when needed. * * Copyright (C) 2002, 2004 Oracle. All rights reserved. -- 2.34.1 _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/3] ocfs2: Fix a typo in a comment 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel @ 2022-07-22 1:33 ` Joseph Qi via Ocfs2-devel -1 siblings, 0 replies; 9+ messages in thread From: Joseph Qi @ 2022-07-22 1:33 UTC (permalink / raw) To: Christophe JAILLET, akpm, Mark Fasheh, Joel Becker Cc: linux-kernel, kernel-janitors, ocfs2-devel On 7/22/22 4:49 AM, Christophe JAILLET wrote: > s/heartbaet/heartbeat > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> > --- > v1 -> v2 > - this patch is new in the serie > --- > fs/ocfs2/heartbeat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c > index dd29d60af154..22da768e65b7 100644 > --- a/fs/ocfs2/heartbeat.c > +++ b/fs/ocfs2/heartbeat.c > @@ -2,7 +2,7 @@ > /* > * heartbeat.c > * > - * Register ourselves with the heartbaet service, keep our node maps > + * Register ourselves with the heartbeat service, keep our node maps > * up to date, and fire off recovery when needed. > * > * Copyright (C) 2002, 2004 Oracle. All rights reserved. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Ocfs2-devel] [PATCH v2 3/3] ocfs2: Fix a typo in a comment @ 2022-07-22 1:33 ` Joseph Qi via Ocfs2-devel 0 siblings, 0 replies; 9+ messages in thread From: Joseph Qi via Ocfs2-devel @ 2022-07-22 1:33 UTC (permalink / raw) To: Christophe JAILLET, akpm, Mark Fasheh, Joel Becker Cc: kernel-janitors, linux-kernel, ocfs2-devel On 7/22/22 4:49 AM, Christophe JAILLET wrote: > s/heartbaet/heartbeat > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> > --- > v1 -> v2 > - this patch is new in the serie > --- > fs/ocfs2/heartbeat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c > index dd29d60af154..22da768e65b7 100644 > --- a/fs/ocfs2/heartbeat.c > +++ b/fs/ocfs2/heartbeat.c > @@ -2,7 +2,7 @@ > /* > * heartbeat.c > * > - * Register ourselves with the heartbaet service, keep our node maps > + * Register ourselves with the heartbeat service, keep our node maps > * up to date, and fire off recovery when needed. > * > * Copyright (C) 2002, 2004 Oracle. All rights reserved. _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-07-22 1:33 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-07-21 20:49 [PATCH v2 0/3] ocfs2: A few clean_ups Christophe JAILLET 2022-07-21 20:49 ` [PATCH v2 1/3] ocfs2: Remove some useless functions Christophe JAILLET 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2022-07-21 20:49 ` [PATCH v2 2/3] ocfs2: use the bitmap API to simplify code Christophe JAILLET 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2022-07-21 20:49 ` [PATCH v2 3/3] ocfs2: Fix a typo in a comment Christophe JAILLET 2022-07-21 20:49 ` [Ocfs2-devel] " Christophe JAILLET via Ocfs2-devel 2022-07-22 1:33 ` Joseph Qi 2022-07-22 1:33 ` [Ocfs2-devel] " Joseph Qi via Ocfs2-devel
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.