* [PATCH] mbcache: change setting entry->e_reusable for more readable code
@ 2018-11-15 6:42 Chengguang Xu
2018-11-15 6:57 ` Al Viro
0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2018-11-15 6:42 UTC (permalink / raw)
To: viro, jack; +Cc: linux-fsdevel, Chengguang Xu
Instead of directly setting entry->e_reusable to parameter reusable,
cheek the bool value for more readable code.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
fs/mbcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/mbcache.c b/fs/mbcache.c
index 081ccf0caee3..39ec9fd8bacf 100644
--- a/fs/mbcache.c
+++ b/fs/mbcache.c
@@ -93,7 +93,7 @@ int mb_cache_entry_create(struct mb_cache *cache, gfp_t mask, u32 key,
atomic_set(&entry->e_refcnt, 1);
entry->e_key = key;
entry->e_value = value;
- entry->e_reusable = reusable;
+ entry->e_reusable = reusable ? 1 : 0;
entry->e_referenced = 0;
head = mb_cache_entry_head(cache, key);
hlist_bl_lock(head);
--
2.17.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mbcache: change setting entry->e_reusable for more readable code
2018-11-15 6:42 [PATCH] mbcache: change setting entry->e_reusable for more readable code Chengguang Xu
@ 2018-11-15 6:57 ` Al Viro
0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2018-11-15 6:57 UTC (permalink / raw)
To: Chengguang Xu; +Cc: jack, linux-fsdevel
On Thu, Nov 15, 2018 at 02:42:33PM +0800, Chengguang Xu wrote:
> Instead of directly setting entry->e_reusable to parameter reusable,
> cheek the bool value for more readable code.
>
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> ---
> fs/mbcache.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/mbcache.c b/fs/mbcache.c
> index 081ccf0caee3..39ec9fd8bacf 100644
> --- a/fs/mbcache.c
> +++ b/fs/mbcache.c
> @@ -93,7 +93,7 @@ int mb_cache_entry_create(struct mb_cache *cache, gfp_t mask, u32 key,
> atomic_set(&entry->e_refcnt, 1);
> entry->e_key = key;
> entry->e_value = value;
> - entry->e_reusable = reusable;
> + entry->e_reusable = reusable ? 1 : 0;
Huh? How is that more readable?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-15 17:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15 6:42 [PATCH] mbcache: change setting entry->e_reusable for more readable code Chengguang Xu
2018-11-15 6:57 ` Al Viro
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.