On Sat, Jul 15, 2023 at 09:21:40AM +0200, Thordur Bjornsson wrote:
> VOP_RECLAIM is only ever called from vclean() to cleanup fs dependent
> data, and vclean() calls cache_purge().
> 
> Makes all of the reclaim implementations the same in this regard.

for now, I am still unsure about the change.

yes, vclean() will call cache_purge() after calling VOP_RECLAIM(). so we 
ended-up 
to have called cache_purge() several times.

but the vnode isn't in the same state inside VOP_RECLAIM() and after calling 
it. 
it seems fine as the *_reclaim() is freeing v_data contents, and cache_purge() 
doesn't touch that.

also, you didn't change ufs_reclaim() to not call cache_purge() ? is it on 
purpose ?

thanks.
-- 
Sebastien Marie

> diff --git sys/isofs/cd9660/cd9660_node.c sys/isofs/cd9660/cd9660_node.c
> index bce99d77c22..300277f3b37 100644
> --- sys/isofs/cd9660/cd9660_node.c
> +++ sys/isofs/cd9660/cd9660_node.c
> @@ -218,7 +218,6 @@ cd9660_reclaim(void *v)
>       /*
>        * Purge old data structures associated with the inode.
>        */
> -     cache_purge(vp);
>       if (ip->i_devvp) {
>               vrele(ip->i_devvp);
>               ip->i_devvp = 0;
> diff --git sys/msdosfs/msdosfs_denode.c sys/msdosfs/msdosfs_denode.c
> index 7a33212b648..3707c97458e 100644
> --- sys/msdosfs/msdosfs_denode.c
> +++ sys/msdosfs/msdosfs_denode.c
> @@ -600,7 +600,6 @@ msdosfs_reclaim(void *v)
>       /*
>        * Purge old data structures associated with the denode.
>        */
> -     cache_purge(vp);
>       if (dep->de_devvp) {
>               vrele(dep->de_devvp);
>               dep->de_devvp = 0;
> diff --git sys/nfs/nfs_node.c sys/nfs/nfs_node.c
> index c8ac3b9bb14..38ad5db82fc 100644
> --- sys/nfs/nfs_node.c
> +++ sys/nfs/nfs_node.c
> @@ -237,7 +237,6 @@ nfs_reclaim(void *v)
>       if (np->n_wcred)
>               crfree(np->n_wcred);
>  
> -     cache_purge(vp);
>       pool_put(&nfs_node_pool, vp->v_data);
>       vp->v_data = NULL;
>  
> diff --git sys/ntfs/ntfs_vnops.c sys/ntfs/ntfs_vnops.c
> index d239112e991..d40e3d254f6 100644
> --- sys/ntfs/ntfs_vnops.c
> +++ sys/ntfs/ntfs_vnops.c
> @@ -221,8 +221,6 @@ ntfs_reclaim(void *v)
>               return (error);
>       
>       /* Purge old data structures associated with the inode. */
> -     cache_purge(vp);
> -
>       ntfs_frele(fp);
>       ntfs_ntput(ip);
>  
> diff --git sys/tmpfs/tmpfs_vnops.c sys/tmpfs/tmpfs_vnops.c
> index bc1390d72c9..6ec13e686b2 100644
> --- sys/tmpfs/tmpfs_vnops.c
> +++ sys/tmpfs/tmpfs_vnops.c
> @@ -1079,8 +1079,6 @@ tmpfs_reclaim(void *v)
>       racing = TMPFS_NODE_RECLAIMING(node);
>       rw_exit_write(&node->tn_nlock);
>  
> -     cache_purge(vp);
> -
>       /*
>        * If inode is not referenced, i.e. no links, then destroy it.
>        * Note: if racing - inode is about to get a new vnode, leave it.
> diff --git sys/ufs/ext2fs/ext2fs_vnops.c sys/ufs/ext2fs/ext2fs_vnops.c
> index 235590d7c74..006a06b0dc8 100644
> --- sys/ufs/ext2fs/ext2fs_vnops.c
> +++ sys/ufs/ext2fs/ext2fs_vnops.c
> @@ -1247,7 +1247,6 @@ ext2fs_reclaim(void *v)
>       /*
>        * Purge old data structures associated with the inode.
>        */
> -     cache_purge(vp);
>       if (ip->i_devvp)
>               vrele(ip->i_devvp);
>  
> 

Reply via email to