result = sb->s_op->statfs(sb->s_root, ksfs);
if (likely(result == 0)) { /* N.B. statfs can't really fail */
statfs_pack(sfs, ksfs);
- if (sb->s_flags & MS_RDONLY)
+ if (unlikely(sb->s_flags & MS_RDONLY))
sfs->os_state = OS_STATE_READONLY;
+ if (LDISKFS_HAS_INCOMPAT_FEATURE(sb,
+ LDISKFS_FEATURE_INCOMPAT_EXTENTS))
+ sfs->os_maxbytes = sb->s_maxbytes;
+ else
+ sfs->os_maxbytes = LDISKFS_SB(sb)->s_bitmap_maxbytes;
}
-
spin_unlock(&osd->od_osfs_lock);
if (unlikely(env == NULL))
param->ddp_max_nlink = LDISKFS_LINK_MAX;
param->ddp_block_shift = sb->s_blocksize_bits;
param->ddp_mount_type = LDD_MT_LDISKFS;
- param->ddp_maxbytes = sb->s_maxbytes;
+ if (LDISKFS_HAS_INCOMPAT_FEATURE(sb, LDISKFS_FEATURE_INCOMPAT_EXTENTS))
+ param->ddp_maxbytes = sb->s_maxbytes;
+ else
+ param->ddp_maxbytes = LDISKFS_SB(sb)->s_bitmap_maxbytes;
/* Overhead estimate should be fairly accurate, so we really take a tiny
* error margin which also avoids fragmenting the filesystem too much */
param->ddp_grant_reserved = 2; /* end up to be 1.9% after conversion */
dmu_objset_space(os, &refdbytes, &availbytes, &usedobjs, &availobjs);
+ memset(osfs, 0, sizeof(*osfs));
+
+ /* We're a zfs filesystem. */
+ osfs->os_type = UBERBLOCK_MAGIC;
+
/*
* ZFS allows multiple block sizes. For statfs, Linux makes no
* proper distinction between bsize and frsize. For calculations
* Rather than report this via os_bavail (which makes users unhappy if
* they can't fill the filesystem 100%), reduce os_blocks as well.
*
- * Reserve 0.78% of total space, at least 4MB for small filesystems,
+ * Reserve 0.78% of total space, at least 16MB for small filesystems,
* for internal files to be created/unlinked when space is tight.
*/
CLASSERT(OSD_STATFS_RESERVED_SIZE > 0);
/* ZFS XXX: fill in backing dataset FSID/UUID
memcpy(osfs->os_fsid, .... );*/
- /* We're a zfs filesystem. */
- osfs->os_type = UBERBLOCK_MAGIC;
+ osfs->os_namelen = MAXNAMELEN;
+ osfs->os_maxbytes = OBD_OBJECT_EOF;
/* ZFS XXX: fill in appropriate OS_STATE_{DEGRADED,READONLY} flags
osfs->os_state = vf_to_stf(vfsp->vfs_flag);
if (sb->s_flags & MS_RDONLY)
- osfs->os_state = OS_STATE_READONLY;
+ osfs->os_state |= OS_STATE_READONLY;
*/
- osfs->os_namelen = MAXNAMELEN;
- osfs->os_maxbytes = OBD_OBJECT_EOF;
-
return 0;
}