mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-27 18:34:35 +00:00
scoutfs: add support for statfs
To do a credible job of this we need to track the number of free blocks. We add counters of order allocations free to the indirect blocks so that we can quickly scan them. We also need a bit of help to count inodes. Finally I noticed that we were miscalculating the number of slots in the indirect blocks because we were using the size of the buddy block header, not the size of the indirect block header. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -263,6 +263,22 @@ void scoutfs_update_inode_item(struct inode *inode)
|
||||
trace_scoutfs_update_inode(inode);
|
||||
}
|
||||
|
||||
/*
|
||||
* A quick atomic sample of the last inode number that's been allocated.
|
||||
*/
|
||||
u64 scoutfs_last_ino(struct super_block *sb)
|
||||
{
|
||||
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
|
||||
struct scoutfs_super_block *super = &sbi->super;
|
||||
u64 last;
|
||||
|
||||
spin_lock(&sbi->next_ino_lock);
|
||||
last = le64_to_cpu(super->next_ino);
|
||||
spin_unlock(&sbi->next_ino_lock);
|
||||
|
||||
return last;
|
||||
}
|
||||
|
||||
static int alloc_ino(struct super_block *sb, u64 *ino)
|
||||
{
|
||||
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
|
||||
|
||||
Reference in New Issue
Block a user