is limited by the capabilities of the backing zoned device, file system
size and the max_open_zones mount option.
+ nr_open_zones (Min: 0 Default: Varies Max: UINTMAX)
+ This read-only attribute exposes the current number of open zones
+ used by the file system.
+
zonegc_low_space (Min: 0 Default: 0 Max: 100)
Define a percentage for how much of the unused space that GC should keep
available for writing. A high value will reclaim more of the space
#include "xfs_log.h"
#include "xfs_log_priv.h"
#include "xfs_mount.h"
+#include "xfs_zone_priv.h"
#include "xfs_zones.h"
#include "xfs_zone_alloc.h"
}
XFS_SYSFS_ATTR_RO(max_open_zones);
+static ssize_t
+nr_open_zones_show(
+ struct kobject *kobj,
+ char *buf)
+{
+ struct xfs_zone_info *zi = zoned_to_mp(kobj)->m_zone_info;
+
+ return sysfs_emit(buf, "%u\n", READ_ONCE(zi->zi_nr_open_zones));
+}
+XFS_SYSFS_ATTR_RO(nr_open_zones);
+
static ssize_t
zonegc_low_space_store(
struct kobject *kobj,
static struct attribute *xfs_zoned_attrs[] = {
ATTR_LIST(max_open_zones),
+ ATTR_LIST(nr_open_zones),
ATTR_LIST(zonegc_low_space),
NULL,
};