[PATCH 2/3] xfs: create symlink proc/fs/xfs/stat to sys/fs/xfs/stats
Eric Sandeen
sandeen at sandeen.net
Fri Sep 4 13:32:52 CDT 2015
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 at redhat.com>
> ---
> 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))
>
More information about the xfs
mailing list