I think it'd be better to add a parameter like __lookup_nat_cache(for_dirty).

On 07/18, wangzijie wrote:
> __lookup_nat_cache follows LRU manner to move clean nat entry, when nat
> entries are going to be dirty, no need to move them to tail of lru list.
> 
> Signed-off-by: wangzijie <wangzij...@honor.com>
> ---
>  fs/f2fs/node.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 4b3d9070e..b9fbc6bf7 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -460,7 +460,7 @@ static void set_node_addr(struct f2fs_sb_info *sbi, 
> struct node_info *ni,
>       struct nat_entry *new = __alloc_nat_entry(sbi, ni->nid, true);
>  
>       f2fs_down_write(&nm_i->nat_tree_lock);
> -     e = __lookup_nat_cache(nm_i, ni->nid);
> +     e = radix_tree_lookup(&nm_i->nat_root, ni->nid);
>       if (!e) {
>               e = __init_nat_entry(nm_i, new, NULL, true);
>               copy_node_info(&e->ni, ni);
> @@ -2926,7 +2926,7 @@ static void remove_nats_in_journal(struct f2fs_sb_info 
> *sbi)
>  
>               raw_ne = nat_in_journal(journal, i);
>  
> -             ne = __lookup_nat_cache(nm_i, nid);
> +             ne = radix_tree_lookup(&nm_i->nat_root, nid);
>               if (!ne) {
>                       ne = __alloc_nat_entry(sbi, nid, true);
>                       __init_nat_entry(nm_i, ne, &raw_ne, true);
> -- 
> 2.25.1


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to