__u32 rg_sick; /* o: sick things in ag */
__u32 rg_checked; /* o: checked metadata in ag */
__u32 rg_flags; /* i/o: flags for this ag */
- __u32 rg_reserved[27]; /* o: zero */
+ __u32 rg_writepointer; /* o: write pointer block offset for zoned */
+ __u32 rg_reserved[26]; /* o: zero */
};
#define XFS_RTGROUP_GEOM_SICK_SUPER (1U << 0) /* superblock */
#define XFS_RTGROUP_GEOM_SICK_BITMAP (1U << 1) /* rtbitmap */
#define XFS_RTGROUP_GEOM_SICK_RMAPBT (1U << 3) /* reverse mappings */
#define XFS_RTGROUP_GEOM_SICK_REFCNTBT (1U << 4) /* reference counts */
+#define XFS_RTGROUP_GEOM_WRITEPOINTER (1U << 0) /* write pointer */
+
/* Health monitor event domains */
/* affects the whole fs */
#include "xfs_ioctl.h"
#include "xfs_xattr.h"
#include "xfs_rtbitmap.h"
+#include "xfs_rtrmap_btree.h"
#include "xfs_file.h"
#include "xfs_exchrange.h"
#include "xfs_handle.h"
#include "xfs_rtgroup.h"
#include "xfs_healthmon.h"
#include "xfs_verify_media.h"
+#include "xfs_zone_priv.h"
+#include "xfs_zone_alloc.h"
#include <linux/mount.h>
#include <linux/fileattr.h>
{
struct xfs_rtgroup *rtg;
struct xfs_rtgroup_geometry rgeo;
+ xfs_rgblock_t highest_rgbno;
int error;
if (copy_from_user(&rgeo, arg, sizeof(rgeo)))
if (error)
return error;
+ if (xfs_has_zoned(mp)) {
+ xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
+ if (rtg->rtg_open_zone) {
+ rgeo.rg_writepointer = rtg->rtg_open_zone->oz_allocated;
+ } else {
+ highest_rgbno = xfs_rtrmap_highest_rgbno(rtg);
+ if (highest_rgbno == NULLRGBLOCK)
+ rgeo.rg_writepointer = 0;
+ else
+ rgeo.rg_writepointer = highest_rgbno + 1;
+ }
+ xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
+ rgeo.rg_flags |= XFS_RTGROUP_GEOM_WRITEPOINTER;
+ }
+
if (copy_to_user(arg, &rgeo, sizeof(rgeo)))
return -EFAULT;
return 0;