xfs
[Top] [All Lists]

Re: [PATCH 2/3] xfs: create symlink proc/fs/xfs/stat to sys/fs/xfs/stats

To: Bill O'Donnell <billodo@xxxxxxxxxx>, xfs@xxxxxxxxxxx
Subject: Re: [PATCH 2/3] xfs: create symlink proc/fs/xfs/stat to sys/fs/xfs/stats
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Fri, 4 Sep 2015 13:32:52 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1441371319-31625-3-git-send-email-billodo@xxxxxxxxxx>
References: <1441371319-31625-1-git-send-email-billodo@xxxxxxxxxx> <1441371319-31625-3-git-send-email-billodo@xxxxxxxxxx>
On 9/4/15 7:55 AM, Bill O'Donnell wrote:
> As a part of the work to move xfs global stats from procfs to sysfs,
> this patch creates the symlink from proc/fs/xfs/stat to sys/fs/xfs/stats.
> 
> Signed-off-by: Bill O'Donnell <billodo@xxxxxxxxxx>
> ---
>  fs/xfs/xfs_stats.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_stats.c b/fs/xfs/xfs_stats.c
> index 6008e25..734b867 100644
> --- a/fs/xfs/xfs_stats.c
> +++ b/fs/xfs/xfs_stats.c
> @@ -244,9 +244,12 @@ xfs_init_procfs(void)
>       if (!proc_mkdir("fs/xfs", NULL))
>               goto out;
>  
> -     if (!proc_create("fs/xfs/stat", 0, NULL,
> -                      &xfs_stat_proc_fops))
> +     if (!proc_symlink("fs/xfs/stat", NULL,
> +                       "/sys/fs/xfs/stats/stats"))
> +     {
>               goto out_remove_xfs_dir;
> +     }

Ok, without the printk, now there's no need for the braces :)

Also, as an aside, the kernel/xfs style is:

        if (foo) {
                ...
        }

not:

        if (foo)
        {
                ...
        }

just FYI...

Thanks,
-Eric
> +
>  #ifdef CONFIG_XFS_QUOTA
>       if (!proc_create("fs/xfs/xqmstat", 0, NULL,
>                        &xqmstat_proc_fops))
> 

<Prev in Thread] Current Thread [Next in Thread>