Re: [PATCH] cifs: implement drop_inode superblock op

Steve French <[email protected]> Tue, 25 May 2010 17:14:10 -0500
Newsgroups gmane.linux.file-systems,gmane.linux.file-systems.cifs
Message-ID <[email protected]>
Any rough idea of performance or memory savings (even in something
artificial like dbench run)?

On Tue, May 25, 2010 at 2:24 PM, Jeff Layton <[email protected]> wrote=
:
> The standard behavior for drop_inode is to delete the inode when the
> last reference to it is put and the nlink count goes to 0. This helps
> keep inodes that are still considered "not deleted" in cache as long =
as
> possible even when there aren't dentries attached to them.
>
> When server inode numbers are disabled, it's not possible for cifs_ig=
et
> to ever match an existing inode (since inode numbers are generated vi=
a
> iunique). In this situation, cifs can keep a lot of inodes in cache t=
hat
> will never be used again.
>
> Implement a drop_inode routine that deletes the inode if server inode
> numbers are disabled on the mount. This helps keep the cifs inode
> caches down to a more manageable size when server inode numbers are
> disabled.
>
> Signed-off-by: Jeff Layton <[email protected]>
> ---
> =A0fs/cifs/cifsfs.c | =A0 14 ++++++++++++--
> =A01 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index 78c02eb..8f647db 100644
> --- a/fs/cifs/cifsfs.c
> +++ b/fs/cifs/cifsfs.c
> @@ -473,13 +473,23 @@ static int cifs_remount(struct super_block *sb,=
 int *flags, char *data)
> =A0 =A0 =A0 =A0return 0;
> =A0}
>
> +void cifs_drop_inode(struct inode *inode)
> +{
> + =A0 =A0 =A0 struct cifs_sb_info *cifs_sb =3D CIFS_SB(inode->i_sb);
> +
> + =A0 =A0 =A0 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return generic_drop_inode(inode);
> +
> + =A0 =A0 =A0 return generic_delete_inode(inode);
> +}
> +
> =A0static const struct super_operations cifs_super_ops =3D {
> =A0 =A0 =A0 =A0.put_super =3D cifs_put_super,
> =A0 =A0 =A0 =A0.statfs =3D cifs_statfs,
> =A0 =A0 =A0 =A0.alloc_inode =3D cifs_alloc_inode,
> =A0 =A0 =A0 =A0.destroy_inode =3D cifs_destroy_inode,
> -/* =A0 =A0 .drop_inode =A0 =A0 =A0 =A0 =3D generic_delete_inode,
> - =A0 =A0 =A0 .delete_inode =A0 =3D cifs_delete_inode, =A0*/ =A0/* Do=
 not need above two
> + =A0 =A0 =A0 .drop_inode =A0 =A0 =3D cifs_drop_inode,
> +/* =A0 =A0 .delete_inode =A0 =3D cifs_delete_inode, =A0*/ =A0/* Do n=
ot need above two
> =A0 =A0 =A0 =A0functions unless later we add lazy close of inodes or =
unless the
> =A0 =A0 =A0 =A0kernel forgets to call us with the same number of rele=
ases (closes)
> =A0 =A0 =A0 =A0as opens */
> --
> 1.6.6.1
>
>



--=20
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel=
" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html