* [PATCH] mkfs: make inobtcount visible
@ 2021-01-04 11:30 Zorro Lang
2021-01-04 15:28 ` Eric Sandeen
2021-01-05 21:11 ` Eric Sandeen
0 siblings, 2 replies; 7+ messages in thread
From: Zorro Lang @ 2021-01-04 11:30 UTC (permalink / raw)
To: linux-xfs
When set inobtcount=1/0, we can't see it from xfs geometry report.
So make it visible.
Signed-off-by: Zorro Lang <zlang@redhat.com>
---
libfrog/fsgeom.c | 6 ++++--
libxfs/xfs_fs.h | 1 +
libxfs/xfs_sb.c | 2 ++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/libfrog/fsgeom.c b/libfrog/fsgeom.c
index 14507668..c2b5f265 100644
--- a/libfrog/fsgeom.c
+++ b/libfrog/fsgeom.c
@@ -29,6 +29,7 @@ xfs_report_geom(
int rmapbt_enabled;
int reflink_enabled;
int bigtime_enabled;
+ int inobtcnt_enabled;
isint = geo->logstart > 0;
lazycount = geo->flags & XFS_FSOP_GEOM_FLAGS_LAZYSB ? 1 : 0;
@@ -45,12 +46,13 @@ xfs_report_geom(
rmapbt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_RMAPBT ? 1 : 0;
reflink_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_REFLINK ? 1 : 0;
bigtime_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_BIGTIME ? 1 : 0;
+ inobtcnt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_INOBTCNT ? 1 : 0;
printf(_(
"meta-data=%-22s isize=%-6d agcount=%u, agsize=%u blks\n"
" =%-22s sectsz=%-5u attr=%u, projid32bit=%u\n"
" =%-22s crc=%-8u finobt=%u, sparse=%u, rmapbt=%u\n"
-" =%-22s reflink=%-4u bigtime=%u\n"
+" =%-22s reflink=%-4u bigtime=%u, inobtcount=%u\n"
"data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
" =%-22s sunit=%-6u swidth=%u blks\n"
"naming =version %-14u bsize=%-6u ascii-ci=%d, ftype=%d\n"
@@ -60,7 +62,7 @@ xfs_report_geom(
mntpoint, geo->inodesize, geo->agcount, geo->agblocks,
"", geo->sectsize, attrversion, projid32bit,
"", crcs_enabled, finobt_enabled, spinodes, rmapbt_enabled,
- "", reflink_enabled, bigtime_enabled,
+ "", reflink_enabled, bigtime_enabled, inobtcnt_enabled,
"", geo->blocksize, (unsigned long long)geo->datablocks,
geo->imaxpct,
"", geo->sunit, geo->swidth,
diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
index 2a2e3cfd..6fad140d 100644
--- a/libxfs/xfs_fs.h
+++ b/libxfs/xfs_fs.h
@@ -250,6 +250,7 @@ typedef struct xfs_fsop_resblks {
#define XFS_FSOP_GEOM_FLAGS_RMAPBT (1 << 19) /* reverse mapping btree */
#define XFS_FSOP_GEOM_FLAGS_REFLINK (1 << 20) /* files can share blocks */
#define XFS_FSOP_GEOM_FLAGS_BIGTIME (1 << 21) /* 64-bit nsec timestamps */
+#define XFS_FSOP_GEOM_FLAGS_INOBTCNT (1 << 22) /* inobt btree counter */
/*
* Minimum and maximum sizes need for growth checks.
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
index fb2212b8..a5ab0211 100644
--- a/libxfs/xfs_sb.c
+++ b/libxfs/xfs_sb.c
@@ -1145,6 +1145,8 @@ xfs_fs_geometry(
geo->flags |= XFS_FSOP_GEOM_FLAGS_REFLINK;
if (xfs_sb_version_hasbigtime(sbp))
geo->flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME;
+ if (xfs_sb_version_hasinobtcounts(sbp))
+ geo->flags |= XFS_FSOP_GEOM_FLAGS_INOBTCNT;
if (xfs_sb_version_hassector(sbp))
geo->logsectsize = sbp->sb_logsectsize;
else
--
2.25.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] mkfs: make inobtcount visible
2021-01-04 11:30 [PATCH] mkfs: make inobtcount visible Zorro Lang
@ 2021-01-04 15:28 ` Eric Sandeen
2021-01-04 16:29 ` Eric Sandeen
2021-01-05 21:11 ` Eric Sandeen
1 sibling, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2021-01-04 15:28 UTC (permalink / raw)
To: Zorro Lang, linux-xfs
On 1/4/21 5:30 AM, Zorro Lang wrote:
> When set inobtcount=1/0, we can't see it from xfs geometry report.
> So make it visible.
>
> Signed-off-by: Zorro Lang <zlang@redhat.com>
Hi Zorro - thanks for spotting this.
I think the libxfs changes need to hit the kernel first, then we can
pull it in and fix up the report_geom function. Nothing calls
xfs_fs_geometry directly in userspace, FWIW.
Thanks,
-Eric
> ---
> libfrog/fsgeom.c | 6 ++++--
> libxfs/xfs_fs.h | 1 +
> libxfs/xfs_sb.c | 2 ++
> 3 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/libfrog/fsgeom.c b/libfrog/fsgeom.c
> index 14507668..c2b5f265 100644
> --- a/libfrog/fsgeom.c
> +++ b/libfrog/fsgeom.c
> @@ -29,6 +29,7 @@ xfs_report_geom(
> int rmapbt_enabled;
> int reflink_enabled;
> int bigtime_enabled;
> + int inobtcnt_enabled;
>
> isint = geo->logstart > 0;
> lazycount = geo->flags & XFS_FSOP_GEOM_FLAGS_LAZYSB ? 1 : 0;
> @@ -45,12 +46,13 @@ xfs_report_geom(
> rmapbt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_RMAPBT ? 1 : 0;
> reflink_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_REFLINK ? 1 : 0;
> bigtime_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_BIGTIME ? 1 : 0;
> + inobtcnt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_INOBTCNT ? 1 : 0;
>
> printf(_(
> "meta-data=%-22s isize=%-6d agcount=%u, agsize=%u blks\n"
> " =%-22s sectsz=%-5u attr=%u, projid32bit=%u\n"
> " =%-22s crc=%-8u finobt=%u, sparse=%u, rmapbt=%u\n"
> -" =%-22s reflink=%-4u bigtime=%u\n"
> +" =%-22s reflink=%-4u bigtime=%u, inobtcount=%u\n"
> "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
> " =%-22s sunit=%-6u swidth=%u blks\n"
> "naming =version %-14u bsize=%-6u ascii-ci=%d, ftype=%d\n"
> @@ -60,7 +62,7 @@ xfs_report_geom(
> mntpoint, geo->inodesize, geo->agcount, geo->agblocks,
> "", geo->sectsize, attrversion, projid32bit,
> "", crcs_enabled, finobt_enabled, spinodes, rmapbt_enabled,
> - "", reflink_enabled, bigtime_enabled,
> + "", reflink_enabled, bigtime_enabled, inobtcnt_enabled,
> "", geo->blocksize, (unsigned long long)geo->datablocks,
> geo->imaxpct,
> "", geo->sunit, geo->swidth,
> diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
> index 2a2e3cfd..6fad140d 100644
> --- a/libxfs/xfs_fs.h
> +++ b/libxfs/xfs_fs.h
> @@ -250,6 +250,7 @@ typedef struct xfs_fsop_resblks {
> #define XFS_FSOP_GEOM_FLAGS_RMAPBT (1 << 19) /* reverse mapping btree */
> #define XFS_FSOP_GEOM_FLAGS_REFLINK (1 << 20) /* files can share blocks */
> #define XFS_FSOP_GEOM_FLAGS_BIGTIME (1 << 21) /* 64-bit nsec timestamps */
> +#define XFS_FSOP_GEOM_FLAGS_INOBTCNT (1 << 22) /* inobt btree counter */
>
> /*
> * Minimum and maximum sizes need for growth checks.
> diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
> index fb2212b8..a5ab0211 100644
> --- a/libxfs/xfs_sb.c
> +++ b/libxfs/xfs_sb.c
> @@ -1145,6 +1145,8 @@ xfs_fs_geometry(
> geo->flags |= XFS_FSOP_GEOM_FLAGS_REFLINK;
> if (xfs_sb_version_hasbigtime(sbp))
> geo->flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME;
> + if (xfs_sb_version_hasinobtcounts(sbp))
> + geo->flags |= XFS_FSOP_GEOM_FLAGS_INOBTCNT;
> if (xfs_sb_version_hassector(sbp))
> geo->logsectsize = sbp->sb_logsectsize;
> else
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mkfs: make inobtcount visible
2021-01-04 15:28 ` Eric Sandeen
@ 2021-01-04 16:29 ` Eric Sandeen
2021-01-04 18:57 ` Zorro Lang
0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2021-01-04 16:29 UTC (permalink / raw)
To: Zorro Lang, linux-xfs
On 1/4/21 9:28 AM, Eric Sandeen wrote:
> On 1/4/21 5:30 AM, Zorro Lang wrote:
>> When set inobtcount=1/0, we can't see it from xfs geometry report.
>> So make it visible.
>>
>> Signed-off-by: Zorro Lang <zlang@redhat.com>
> Hi Zorro - thanks for spotting this.
>
> I think the libxfs changes need to hit the kernel first, then we can
> pull it in and fix up the report_geom function. Nothing calls
> xfs_fs_geometry directly in userspace, FWIW.
Hah, of course I forgot about libxfs_fs_geometry. o_O
In any case, I think this should hit the kernel first, want to send
that patch if it's not already on the list?
-Eric
> Thanks,
> -Eric
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mkfs: make inobtcount visible
2021-01-04 16:29 ` Eric Sandeen
@ 2021-01-04 18:57 ` Zorro Lang
2021-01-04 19:31 ` Darrick J. Wong
0 siblings, 1 reply; 7+ messages in thread
From: Zorro Lang @ 2021-01-04 18:57 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
On Mon, Jan 04, 2021 at 10:29:21AM -0600, Eric Sandeen wrote:
>
>
> On 1/4/21 9:28 AM, Eric Sandeen wrote:
> > On 1/4/21 5:30 AM, Zorro Lang wrote:
> >> When set inobtcount=1/0, we can't see it from xfs geometry report.
> >> So make it visible.
> >>
> >> Signed-off-by: Zorro Lang <zlang@redhat.com>
> > Hi Zorro - thanks for spotting this.
> >
> > I think the libxfs changes need to hit the kernel first, then we can
> > pull it in and fix up the report_geom function. Nothing calls
> > xfs_fs_geometry directly in userspace, FWIW.
>
> Hah, of course I forgot about libxfs_fs_geometry. o_O
>
> In any case, I think this should hit the kernel first, want to send
> that patch if it's not already on the list?
I can give it a try, if Darrick haven't had one in his developing list :)
Thanks,
Zorro
>
> -Eric
>
> > Thanks,
> > -Eric
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mkfs: make inobtcount visible
2021-01-04 18:57 ` Zorro Lang
@ 2021-01-04 19:31 ` Darrick J. Wong
2021-01-05 21:49 ` Eric Sandeen
0 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2021-01-04 19:31 UTC (permalink / raw)
To: Eric Sandeen, linux-xfs
On Tue, Jan 05, 2021 at 02:57:54AM +0800, Zorro Lang wrote:
> On Mon, Jan 04, 2021 at 10:29:21AM -0600, Eric Sandeen wrote:
> >
> >
> > On 1/4/21 9:28 AM, Eric Sandeen wrote:
> > > On 1/4/21 5:30 AM, Zorro Lang wrote:
> > >> When set inobtcount=1/0, we can't see it from xfs geometry report.
> > >> So make it visible.
> > >>
> > >> Signed-off-by: Zorro Lang <zlang@redhat.com>
> > > Hi Zorro - thanks for spotting this.
> > >
> > > I think the libxfs changes need to hit the kernel first, then we can
> > > pull it in and fix up the report_geom function. Nothing calls
> > > xfs_fs_geometry directly in userspace, FWIW.
> >
> > Hah, of course I forgot about libxfs_fs_geometry. o_O
> >
> > In any case, I think this should hit the kernel first, want to send
> > that patch if it's not already on the list?
>
> I can give it a try, if Darrick haven't had one in his developing list :)
Why do we need to expose INOBTCNT/inobtcount via the geometry ioctl?
It doesn't expose any user-visible functionality.
--D
> Thanks,
> Zorro
>
> >
> > -Eric
> >
> > > Thanks,
> > > -Eric
> > >
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mkfs: make inobtcount visible
2021-01-04 11:30 [PATCH] mkfs: make inobtcount visible Zorro Lang
2021-01-04 15:28 ` Eric Sandeen
@ 2021-01-05 21:11 ` Eric Sandeen
1 sibling, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2021-01-05 21:11 UTC (permalink / raw)
To: Zorro Lang, linux-xfs
On 1/4/21 5:30 AM, Zorro Lang wrote:
> When set inobtcount=1/0, we can't see it from xfs geometry report.
> So make it visible.
>
> Signed-off-by: Zorro Lang <zlang@redhat.com>
When the libxfs/kernel patch is in place, I'll merge the userspace
part of this, thanks.
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
> libfrog/fsgeom.c | 6 ++++--
> libxfs/xfs_fs.h | 1 +
> libxfs/xfs_sb.c | 2 ++
> 3 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/libfrog/fsgeom.c b/libfrog/fsgeom.c
> index 14507668..c2b5f265 100644
> --- a/libfrog/fsgeom.c
> +++ b/libfrog/fsgeom.c
> @@ -29,6 +29,7 @@ xfs_report_geom(
> int rmapbt_enabled;
> int reflink_enabled;
> int bigtime_enabled;
> + int inobtcnt_enabled;
>
> isint = geo->logstart > 0;
> lazycount = geo->flags & XFS_FSOP_GEOM_FLAGS_LAZYSB ? 1 : 0;
> @@ -45,12 +46,13 @@ xfs_report_geom(
> rmapbt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_RMAPBT ? 1 : 0;
> reflink_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_REFLINK ? 1 : 0;
> bigtime_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_BIGTIME ? 1 : 0;
> + inobtcnt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_INOBTCNT ? 1 : 0;
>
> printf(_(
> "meta-data=%-22s isize=%-6d agcount=%u, agsize=%u blks\n"
> " =%-22s sectsz=%-5u attr=%u, projid32bit=%u\n"
> " =%-22s crc=%-8u finobt=%u, sparse=%u, rmapbt=%u\n"
> -" =%-22s reflink=%-4u bigtime=%u\n"
> +" =%-22s reflink=%-4u bigtime=%u, inobtcount=%u\n"
> "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
> " =%-22s sunit=%-6u swidth=%u blks\n"
> "naming =version %-14u bsize=%-6u ascii-ci=%d, ftype=%d\n"
> @@ -60,7 +62,7 @@ xfs_report_geom(
> mntpoint, geo->inodesize, geo->agcount, geo->agblocks,
> "", geo->sectsize, attrversion, projid32bit,
> "", crcs_enabled, finobt_enabled, spinodes, rmapbt_enabled,
> - "", reflink_enabled, bigtime_enabled,
> + "", reflink_enabled, bigtime_enabled, inobtcnt_enabled,
> "", geo->blocksize, (unsigned long long)geo->datablocks,
> geo->imaxpct,
> "", geo->sunit, geo->swidth,
> diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
> index 2a2e3cfd..6fad140d 100644
> --- a/libxfs/xfs_fs.h
> +++ b/libxfs/xfs_fs.h
> @@ -250,6 +250,7 @@ typedef struct xfs_fsop_resblks {
> #define XFS_FSOP_GEOM_FLAGS_RMAPBT (1 << 19) /* reverse mapping btree */
> #define XFS_FSOP_GEOM_FLAGS_REFLINK (1 << 20) /* files can share blocks */
> #define XFS_FSOP_GEOM_FLAGS_BIGTIME (1 << 21) /* 64-bit nsec timestamps */
> +#define XFS_FSOP_GEOM_FLAGS_INOBTCNT (1 << 22) /* inobt btree counter */
>
> /*
> * Minimum and maximum sizes need for growth checks.
> diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
> index fb2212b8..a5ab0211 100644
> --- a/libxfs/xfs_sb.c
> +++ b/libxfs/xfs_sb.c
> @@ -1145,6 +1145,8 @@ xfs_fs_geometry(
> geo->flags |= XFS_FSOP_GEOM_FLAGS_REFLINK;
> if (xfs_sb_version_hasbigtime(sbp))
> geo->flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME;
> + if (xfs_sb_version_hasinobtcounts(sbp))
> + geo->flags |= XFS_FSOP_GEOM_FLAGS_INOBTCNT;
> if (xfs_sb_version_hassector(sbp))
> geo->logsectsize = sbp->sb_logsectsize;
> else
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mkfs: make inobtcount visible
2021-01-04 19:31 ` Darrick J. Wong
@ 2021-01-05 21:49 ` Eric Sandeen
0 siblings, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2021-01-05 21:49 UTC (permalink / raw)
To: Darrick J. Wong, linux-xfs
On 1/4/21 1:31 PM, Darrick J. Wong wrote:
> On Tue, Jan 05, 2021 at 02:57:54AM +0800, Zorro Lang wrote:
>> On Mon, Jan 04, 2021 at 10:29:21AM -0600, Eric Sandeen wrote:
>>>
>>>
>>> On 1/4/21 9:28 AM, Eric Sandeen wrote:
>>>> On 1/4/21 5:30 AM, Zorro Lang wrote:
>>>>> When set inobtcount=1/0, we can't see it from xfs geometry report.
>>>>> So make it visible.
>>>>>
>>>>> Signed-off-by: Zorro Lang <zlang@redhat.com>
>>>> Hi Zorro - thanks for spotting this.
>>>>
>>>> I think the libxfs changes need to hit the kernel first, then we can
>>>> pull it in and fix up the report_geom function. Nothing calls
>>>> xfs_fs_geometry directly in userspace, FWIW.
>>>
>>> Hah, of course I forgot about libxfs_fs_geometry. o_O
>>>
>>> In any case, I think this should hit the kernel first, want to send
>>> that patch if it's not already on the list?
>>
>> I can give it a try, if Darrick haven't had one in his developing list :)
>
> Why do we need to expose INOBTCNT/inobtcount via the geometry ioctl?
> It doesn't expose any user-visible functionality.
Just to follow up, my thought here is that mkfs output / xfs_info output
should reflect what's needed to create a filesystem w/ the same
geometry/features, and since this is a mkfs option, it should be reflected.
Darrick already RVB'd the kernel patch, so we're now just cruising along
like a well-oiled machine. ;)
-Eric
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-01-05 21:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 11:30 [PATCH] mkfs: make inobtcount visible Zorro Lang
2021-01-04 15:28 ` Eric Sandeen
2021-01-04 16:29 ` Eric Sandeen
2021-01-04 18:57 ` Zorro Lang
2021-01-04 19:31 ` Darrick J. Wong
2021-01-05 21:49 ` Eric Sandeen
2021-01-05 21:11 ` Eric Sandeen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.