Re: [PATCH] break out stats for posix open/mkdir

Jeff Layton <[email protected]>
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
On Thu, 2009-07-09 at 21:22 -0500, Steve French wrote:
> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
> index 7f19fef..3cf0609 100644
> --- a/fs/cifs/cifs_debug.c
> +++ b/fs/cifs/cifs_debug.c
> @@ -261,6 +261,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
>                                         atomic_set(&tcon->num_reads, 0);
>                                         atomic_set(&tcon->num_oplock_brks, 0);
>                                         atomic_set(&tcon->num_opens, 0);
> +                                       atomic_set(&tcon->num_posixopens, 0);
> +                                       atomic_set(&tcon->num_posixmkdirs, 0);
>                                         atomic_set(&tcon->num_closes, 0);
>                                         atomic_set(&tcon->num_deletes, 0);
>                                         atomic_set(&tcon->num_mkdirs, 0);
> @@ -347,11 +349,15 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
>                                         atomic_read(&tcon->num_locks),
>                                         atomic_read(&tcon->num_hardlinks),
>                                         atomic_read(&tcon->num_symlinks));
> -                               seq_printf(m, "\nOpens: %d Closes: %d"
> +                               seq_printf(m, "\nOpens: %d Closes: %d "
>                                               "Deletes: %d",
>                                         atomic_read(&tcon->num_opens),
>                                         atomic_read(&tcon->num_closes),
>                                         atomic_read(&tcon->num_deletes));
> +                               seq_printf(m, "\nPosix Opens %d "
						^^^^^^^^^^^^^^^^^
				Shouldn't that be "\nPosix Opens: %d" ?
> +                                             "Posix Mkdirs: %d",
> +                                       atomic_read(&tcon->num_posixopens),
> +                                       atomic_read(&tcon->num_posixmkdirs));
>                                 seq_printf(m, "\nMkdirs: %d Rmdirs: %d",
>                                         atomic_read(&tcon->num_mkdirs),
>                                         atomic_read(&tcon->num_rmdirs));
> diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
> index 63f6cdf..6084d63 100644
> --- a/fs/cifs/cifsglob.h
> +++ b/fs/cifs/cifsglob.h
> @@ -260,6 +260,8 @@ struct cifsTconInfo {
>         atomic_t num_closes;
>         atomic_t num_deletes;
>         atomic_t num_mkdirs;
> +       atomic_t num_posixopens;
> +       atomic_t num_posixmkdirs;
>         atomic_t num_rmdirs;
>         atomic_t num_renames;
>         atomic_t num_t2renames;
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 922f5fe..1866bc2 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -1113,7 +1113,10 @@ PsxCreat:
>  psx_create_err:
>         cifs_buf_release(pSMB);
>  
> -       cifs_stats_inc(&tcon->num_mkdirs);
> +       if (posix_flags & SMB_O_DIRECTORY)
> +               cifs_stats_inc(&tcon->num_posixmkdirs);
> +       else
> +               cifs_stats_inc(&tcon->num_posixopens);
>  
>         if (rc == -EAGAIN)
>                 goto PsxCreat;
> 

Other than the minor nit above, looks fine to me.

Acked-by: Jeff Layton <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.