Example #1
0
static int sysv_statfs(struct super_block *sb, struct statfs *buf)
{
	buf->f_type = sb->s_magic;
	buf->f_bsize = sb->s_blocksize;
	buf->f_blocks = sb->sv_ndatazones;
	buf->f_bavail = buf->f_bfree = sysv_count_free_blocks(sb);
	buf->f_files = sb->sv_ninodes;
	buf->f_ffree = sysv_count_free_inodes(sb);
	buf->f_namelen = SYSV_NAMELEN;
	return 0;
}
static int sysv_statfs(struct dentry *dentry, struct kstatfs *buf)
{
	struct super_block *sb = dentry->d_sb;
	struct sysv_sb_info *sbi = SYSV_SB(sb);

	buf->f_type = sb->s_magic;
	buf->f_bsize = sb->s_blocksize;
	buf->f_blocks = sbi->s_ndatazones;
	buf->f_bavail = buf->f_bfree = sysv_count_free_blocks(sb);
	buf->f_files = sbi->s_ninodes;
	buf->f_ffree = sysv_count_free_inodes(sb);
	buf->f_namelen = SYSV_NAMELEN;
	return 0;
}
Example #3
0
void sysv_statfs(struct super_block *sb, struct statfs *buf)
{
    long tmp;

    put_fs_long(sb->s_magic, &buf->f_type);		/* type of filesystem */
    put_fs_long(sb->sv_block_size, &buf->f_bsize);	/* block size */
    put_fs_long(sb->sv_ndatazones, &buf->f_blocks);	/* total data blocks in file system */
    tmp = sysv_count_free_blocks(sb);
    put_fs_long(tmp, &buf->f_bfree);		/* free blocks in fs */
    put_fs_long(tmp, &buf->f_bavail);		/* free blocks available to non-superuser */
    put_fs_long(sb->sv_ninodes, &buf->f_files);	/* total file nodes in file system */
    put_fs_long(sysv_count_free_inodes(sb), &buf->f_ffree);	/* free file nodes in fs */
    put_fs_long(SYSV_NAMELEN, &buf->f_namelen);
    /* Don't know what value to put in buf->f_fsid */	/* file system id */
}
static int sysv_statfs(struct dentry *dentry, struct kstatfs *buf)
{
	struct super_block *sb = dentry->d_sb;
	struct sysv_sb_info *sbi = SYSV_SB(sb);
	u64 id = huge_encode_dev(sb->s_bdev->bd_dev);

	buf->f_type = sb->s_magic;
	buf->f_bsize = sb->s_blocksize;
	buf->f_blocks = sbi->s_ndatazones;
	buf->f_bavail = buf->f_bfree = sysv_count_free_blocks(sb);
	buf->f_files = sbi->s_ninodes;
	buf->f_ffree = sysv_count_free_inodes(sb);
	buf->f_namelen = SYSV_NAMELEN;
	buf->f_fsid.val[0] = (u32)id;
	buf->f_fsid.val[1] = (u32)(id >> 32);
	return 0;
}