]> git.karo-electronics.de Git - karo-tx-linux.git/commit
nilfs2: implement calculation of free inodes count
authorVyacheslav Dubeyko <slava@dubeyko.com>
Wed, 19 Jun 2013 00:08:10 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:27:35 +0000 (17:27 +1000)
commit89a478aa14b39f9d8acb4a406855e2eb89119a97
tree5843bf3e8e5977edfb91d447e7efaf21a14c99bf
parent58d4bbd286d862c65d631860b116e97c688f0720
nilfs2: implement calculation of free inodes count

Currently, NILFS2 returns 0 as free inodes count (f_ffree) and current
used inodes count as total file nodes in file system (f_files):

df -i
Filesystem      Inodes  IUsed   IFree IUse% Mounted on
/dev/loop0           2      2       0  100% /mnt/nilfs2

This patch implements real calculation of free inodes count.  First of
all, it is calculated total file nodes in file system as
(desc_blocks_count * groups_per_desc_block * entries_per_group).  Then, it
is calculated free inodes count as difference the total file nodes and
used inodes count.  As a result, we have such output for NILFS2:

df -i
Filesystem       Inodes   IUsed    IFree IUse% Mounted on
/dev/loop0      4194304 2114701  2079603   51% /mnt/nilfs2

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Joern Engel <joern@logfs.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/alloc.c
fs/nilfs2/alloc.h
fs/nilfs2/ifile.c
fs/nilfs2/ifile.h
fs/nilfs2/super.c