Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Vitaly Lipatov <lav@etersoft.ru>
To: almaz.alexandrovich@paragon-software.com
Cc: aaptel@suse.com, dsterba@suse.cz, joe@perches.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	mark@harmstone.com, nborisov@suse.com, pali@kernel.org,
	rdunlap@infradead.org, viro@zeniv.linux.org.uk,
	willy@infradead.org
Subject: Re: [PATCH v6 02/10] fs/ntfs3: Add initialization of super block
Date: Sun, 04 Oct 2020 01:28:32 +0300	[thread overview]
Message-ID: <1d947879f8191f06cc02fd7c47e41f48@etersoft.ru> (raw)
In-Reply-To: <<20200918162204.3706029-3-almaz.alexandrovich@paragon-software.com>>

> 
> This adds initialization of super block
> 
> Signed-off-by: Konstantin Komarov 
> <almaz.alexandrovich@paragon-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

       reply	other threads:[~2020-10-03 22:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<20200918162204.3706029-3-almaz.alexandrovich@paragon-software.com>
2020-10-03 22:28 ` Vitaly Lipatov [this message]
2020-09-18 16:21 [PATCH v6 00/10] NTFS read-write driver GPL implementation by Paragon Software Konstantin Komarov
2020-09-18 16:21 ` [PATCH v6 02/10] fs/ntfs3: Add initialization of super block Konstantin Komarov
2020-09-18 18:32   ` Mark Harmstone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d947879f8191f06cc02fd7c47e41f48@etersoft.ru \
    --to=lav@etersoft.ru \
    --cc=aaptel@suse.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=dsterba@suse.cz \
    --cc=joe@perches.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@harmstone.com \
    --cc=nborisov@suse.com \
    --cc=pali@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --subject='Re: [PATCH v6 02/10] fs/ntfs3: Add initialization of super block' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).