[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1d947879f8191f06cc02fd7c47e41f48@etersoft.ru>
Date: Sun, 04 Oct 2020 01:28:32 +0300
From: Vitaly Lipatov <lav@...rsoft.ru>
To: almaz.alexandrovich@...agon-software.com
Cc: aaptel@...e.com, dsterba@...e.cz, joe@...ches.com,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
mark@...mstone.com, nborisov@...e.com, pali@...nel.org,
rdunlap@...radead.org, viro@...iv.linux.org.uk, willy@...radead.org
Subject: Re: [PATCH v6 02/10] fs/ntfs3: Add initialization of super block
>
> This adds initialization of super block
>
> Signed-off-by: Konstantin Komarov
> <almaz.alexandrovich@...agon-software.com>
...
> +static int ntfs_statfs(struct dentry *dentry, struct kstatfs *buf)
> +{
> + struct super_block *sb = dentry->d_sb;
> + struct ntfs_sb_info *sbi = sb->s_fs_info;
> + struct wnd_bitmap *wnd = &sbi->used.bitmap;
> +
> + buf->f_type = sb->s_magic;
> + buf->f_bsize = sbi->cluster_size;
> + buf->f_blocks = wnd->nbits;
> +
> + buf->f_bfree = buf->f_bavail = wnd_zeroes(wnd);
> + buf->f_fsid.val[0] = (u32)sbi->volume.ser_num;
> + buf->f_fsid.val[1] = (u32)(sbi->volume.ser_num >> 32);
> + buf->f_namelen = NTFS_NAME_LEN;
namelen field of kstatfs (also as statfs struct from statfs system call)
contains
maximum length of filenames on your file system for user space. It is
the number of bytes for filenames.
But NTFS_NAME_LEN (255) is a length of filenames in UCS2 chars, so it
can be up to 3*255 bytes in UTF-8.
--
Vitaly Lipatov
Etersoft
Powered by blists - more mailing lists