Skip to content

Commit

Permalink
fs/ntfs3: Add more info into /proc/fs/ntfs3/<dev>/volinfo
Browse files Browse the repository at this point in the history
[ Upstream commit d27e202 ]

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
aalexandrovich authored and gregkh committed Nov 8, 2023
1 parent 31baaf8 commit da05aa7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions fs/ntfs3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,23 @@ static struct proc_dir_entry *proc_info_root;
* ntfs3.1
* cluster size
* number of clusters
* total number of mft records
* number of used mft records ~= number of files + folders
* real state of ntfs "dirty"/"clean"
* current state of ntfs "dirty"/"clean"
*/
static int ntfs3_volinfo(struct seq_file *m, void *o)
{
struct super_block *sb = m->private;
struct ntfs_sb_info *sbi = sb->s_fs_info;

seq_printf(m, "ntfs%d.%d\n%u\n%zu\n", sbi->volume.major_ver,
sbi->volume.minor_ver, sbi->cluster_size,
sbi->used.bitmap.nbits);
seq_printf(m, "ntfs%d.%d\n%u\n%zu\n\%zu\n%zu\n%s\n%s\n",
sbi->volume.major_ver, sbi->volume.minor_ver,
sbi->cluster_size, sbi->used.bitmap.nbits,
sbi->mft.bitmap.nbits,
sbi->mft.bitmap.nbits - wnd_zeroes(&sbi->mft.bitmap),
sbi->volume.real_dirty ? "dirty" : "clean",
(sbi->volume.flags & VOLUME_FLAG_DIRTY) ? "dirty" : "clean");

return 0;
}
Expand Down

0 comments on commit da05aa7

Please sign in to comment.