All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xfsdump: remove BMV_IF_NO_DMAPI_READ flag
@ 2021-03-31 16:26 Anthony Iliopoulos
  2021-04-02  7:13 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anthony Iliopoulos @ 2021-03-31 16:26 UTC (permalink / raw)
  To: linux-xfs

Use of the flag has had no effect since kernel commit 288699fecaff
("xfs: drop dmapi hooks") which removed all dmapi related code, so we
can remove it.

Given that there are no other flags that need to be specified for the
bmap call, convert once instance of it from getbmapx to plain getbmap.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
---
changes since v1:
 - convert getbmapx to getbmap

 dump/content.c | 1 -
 dump/inomap.c  | 7 +++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/dump/content.c b/dump/content.c
index 75b79220daf6..a40b47101a12 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -4287,7 +4287,6 @@ init_extent_group_context(jdm_fshandle_t *fshandlep,
 	gcp->eg_bmap[0].bmv_offset = 0;
 	gcp->eg_bmap[0].bmv_length = -1;
 	gcp->eg_bmap[0].bmv_count = BMAP_LEN;
-	gcp->eg_bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
 	gcp->eg_nextbmapp = &gcp->eg_bmap[1];
 	gcp->eg_endbmapp = &gcp->eg_bmap[1];
 	gcp->eg_bmapix = 0;
diff --git a/dump/inomap.c b/dump/inomap.c
index 85d61c353cf0..f3200be471e0 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -1627,7 +1627,7 @@ static off64_t
 quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
 {
 	int fd;
-	getbmapx_t bmap[BMAP_LEN];
+	struct getbmap bmap[BMAP_LEN];
 	off64_t offset;
 	off64_t offset_next;
 	off64_t qty_accum;
@@ -1647,7 +1647,6 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
 	bmap[0].bmv_offset = 0;
 	bmap[0].bmv_length = -1;
 	bmap[0].bmv_count = BMAP_LEN;
-	bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
 	bmap[0].bmv_entries = -1;
 	fd = jdm_open(fshandlep, statp, O_RDONLY);
 	if (fd < 0) {
@@ -1662,7 +1661,7 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
 		int eix;
 		int rval;
 
-		rval = ioctl(fd, XFS_IOC_GETBMAPX, bmap);
+		rval = ioctl(fd, XFS_IOC_GETBMAP, bmap);
 		if (rval) {
 			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
 			      "could not read extent map for ino %llu: %s\n"),
@@ -1679,7 +1678,7 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
 		}
 
 		for (eix = 1; eix <= bmap[0].bmv_entries; eix++) {
-			getbmapx_t *bmapp = &bmap[eix];
+			struct getbmap *bmapp = &bmap[eix];
 			off64_t qty_new;
 			if (bmapp->bmv_block == -1) {
 				continue; /* hole */
-- 
2.31.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] xfsdump: remove BMV_IF_NO_DMAPI_READ flag
  2021-03-31 16:26 [PATCH v2] xfsdump: remove BMV_IF_NO_DMAPI_READ flag Anthony Iliopoulos
@ 2021-04-02  7:13 ` Christoph Hellwig
  2022-08-11 13:02 ` Carlos Maiolino
  2022-08-25  8:12 ` Carlos Maiolino
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2021-04-02  7:13 UTC (permalink / raw)
  To: Anthony Iliopoulos; +Cc: linux-xfs

On Wed, Mar 31, 2021 at 06:26:17PM +0200, Anthony Iliopoulos wrote:
> Use of the flag has had no effect since kernel commit 288699fecaff
> ("xfs: drop dmapi hooks") which removed all dmapi related code, so we
> can remove it.
> 
> Given that there are no other flags that need to be specified for the
> bmap call, convert once instance of it from getbmapx to plain getbmap.
> 
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>

I'm not sure dorpping this as long as xfsdump still has all kinds of
other DMAPI related code..

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] xfsdump: remove BMV_IF_NO_DMAPI_READ flag
  2021-03-31 16:26 [PATCH v2] xfsdump: remove BMV_IF_NO_DMAPI_READ flag Anthony Iliopoulos
  2021-04-02  7:13 ` Christoph Hellwig
@ 2022-08-11 13:02 ` Carlos Maiolino
  2022-08-25  8:12 ` Carlos Maiolino
  2 siblings, 0 replies; 4+ messages in thread
From: Carlos Maiolino @ 2022-08-11 13:02 UTC (permalink / raw)
  To: Anthony Iliopoulos; +Cc: linux-xfs

Reviving this old patch since changes have been pushed to xfsprogs.

On Wed, Mar 31, 2021 at 06:26:17PM +0200, Anthony Iliopoulos wrote:
> Use of the flag has had no effect since kernel commit 288699fecaff
> ("xfs: drop dmapi hooks") which removed all dmapi related code, so we
> can remove it.
> 
> Given that there are no other flags that need to be specified for the
> bmap call, convert once instance of it from getbmapx to plain getbmap.
> 
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
> ---
> changes since v1:
>  - convert getbmapx to getbmap
> 
>  dump/content.c | 1 -
>  dump/inomap.c  | 7 +++----
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/dump/content.c b/dump/content.c
> index 75b79220daf6..a40b47101a12 100644
> --- a/dump/content.c
> +++ b/dump/content.c
> @@ -4287,7 +4287,6 @@ init_extent_group_context(jdm_fshandle_t *fshandlep,
>  	gcp->eg_bmap[0].bmv_offset = 0;
>  	gcp->eg_bmap[0].bmv_length = -1;
>  	gcp->eg_bmap[0].bmv_count = BMAP_LEN;
> -	gcp->eg_bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
>  	gcp->eg_nextbmapp = &gcp->eg_bmap[1];
>  	gcp->eg_endbmapp = &gcp->eg_bmap[1];
>  	gcp->eg_bmapix = 0;
> diff --git a/dump/inomap.c b/dump/inomap.c
> index 85d61c353cf0..f3200be471e0 100644
> --- a/dump/inomap.c
> +++ b/dump/inomap.c
> @@ -1627,7 +1627,7 @@ static off64_t
>  quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
>  {
>  	int fd;
> -	getbmapx_t bmap[BMAP_LEN];
> +	struct getbmap bmap[BMAP_LEN];

This seems ok, but I still think this should be properly initialized here, like:

struct getbmap bmap[BMAP_LEN] = {0};


>  	off64_t offset;
>  	off64_t offset_next;
>  	off64_t qty_accum;
> @@ -1647,7 +1647,6 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
>  	bmap[0].bmv_offset = 0;
>  	bmap[0].bmv_length = -1;
>  	bmap[0].bmv_count = BMAP_LEN;
> -	bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
>  	bmap[0].bmv_entries = -1;
>  	fd = jdm_open(fshandlep, statp, O_RDONLY);
>  	if (fd < 0) {
> @@ -1662,7 +1661,7 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
>  		int eix;
>  		int rval;
>  
> -		rval = ioctl(fd, XFS_IOC_GETBMAPX, bmap);
> +		rval = ioctl(fd, XFS_IOC_GETBMAP, bmap);
>  		if (rval) {
>  			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
>  			      "could not read extent map for ino %llu: %s\n"),
> @@ -1679,7 +1678,7 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
>  		}
>  
>  		for (eix = 1; eix <= bmap[0].bmv_entries; eix++) {
> -			getbmapx_t *bmapp = &bmap[eix];
> +			struct getbmap *bmapp = &bmap[eix];
>  			off64_t qty_new;
>  			if (bmapp->bmv_block == -1) {
>  				continue; /* hole */
> -- 
> 2.31.0
> 

-- 
Carlos


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] xfsdump: remove BMV_IF_NO_DMAPI_READ flag
  2021-03-31 16:26 [PATCH v2] xfsdump: remove BMV_IF_NO_DMAPI_READ flag Anthony Iliopoulos
  2021-04-02  7:13 ` Christoph Hellwig
  2022-08-11 13:02 ` Carlos Maiolino
@ 2022-08-25  8:12 ` Carlos Maiolino
  2 siblings, 0 replies; 4+ messages in thread
From: Carlos Maiolino @ 2022-08-25  8:12 UTC (permalink / raw)
  To: Anthony Iliopoulos; +Cc: linux-xfs

On Wed, Mar 31, 2021 at 06:26:17PM +0200, Anthony Iliopoulos wrote:
> Use of the flag has had no effect since kernel commit 288699fecaff
> ("xfs: drop dmapi hooks") which removed all dmapi related code, so we
> can remove it.
> 
> Given that there are no other flags that need to be specified for the
> bmap call, convert once instance of it from getbmapx to plain getbmap.
> 
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
> ---
> changes since v1:
>  - convert getbmapx to getbmap
> 
>  dump/content.c | 1 -
>  dump/inomap.c  | 7 +++----
>  2 files changed, 3 insertions(+), 5 deletions(-)

With my follow-up patch applied on top of this:

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> 
> diff --git a/dump/content.c b/dump/content.c
> index 75b79220daf6..a40b47101a12 100644
> --- a/dump/content.c
> +++ b/dump/content.c
> @@ -4287,7 +4287,6 @@ init_extent_group_context(jdm_fshandle_t *fshandlep,
>  	gcp->eg_bmap[0].bmv_offset = 0;
>  	gcp->eg_bmap[0].bmv_length = -1;
>  	gcp->eg_bmap[0].bmv_count = BMAP_LEN;
> -	gcp->eg_bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
>  	gcp->eg_nextbmapp = &gcp->eg_bmap[1];
>  	gcp->eg_endbmapp = &gcp->eg_bmap[1];
>  	gcp->eg_bmapix = 0;
> diff --git a/dump/inomap.c b/dump/inomap.c
> index 85d61c353cf0..f3200be471e0 100644
> --- a/dump/inomap.c
> +++ b/dump/inomap.c
> @@ -1627,7 +1627,7 @@ static off64_t
>  quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
>  {
>  	int fd;
> -	getbmapx_t bmap[BMAP_LEN];
> +	struct getbmap bmap[BMAP_LEN];
>  	off64_t offset;
>  	off64_t offset_next;
>  	off64_t qty_accum;
> @@ -1647,7 +1647,6 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
>  	bmap[0].bmv_offset = 0;
>  	bmap[0].bmv_length = -1;
>  	bmap[0].bmv_count = BMAP_LEN;
> -	bmap[0].bmv_iflags = BMV_IF_NO_DMAPI_READ;
>  	bmap[0].bmv_entries = -1;
>  	fd = jdm_open(fshandlep, statp, O_RDONLY);
>  	if (fd < 0) {
> @@ -1662,7 +1661,7 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
>  		int eix;
>  		int rval;
>  
> -		rval = ioctl(fd, XFS_IOC_GETBMAPX, bmap);
> +		rval = ioctl(fd, XFS_IOC_GETBMAP, bmap);
>  		if (rval) {
>  			mlog(MLOG_NORMAL | MLOG_WARNING | MLOG_INOMAP, _(
>  			      "could not read extent map for ino %llu: %s\n"),
> @@ -1679,7 +1678,7 @@ quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
>  		}
>  
>  		for (eix = 1; eix <= bmap[0].bmv_entries; eix++) {
> -			getbmapx_t *bmapp = &bmap[eix];
> +			struct getbmap *bmapp = &bmap[eix];
>  			off64_t qty_new;
>  			if (bmapp->bmv_block == -1) {
>  				continue; /* hole */
> -- 
> 2.31.0
> 

-- 
Carlos


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-25  8:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 16:26 [PATCH v2] xfsdump: remove BMV_IF_NO_DMAPI_READ flag Anthony Iliopoulos
2021-04-02  7:13 ` Christoph Hellwig
2022-08-11 13:02 ` Carlos Maiolino
2022-08-25  8:12 ` Carlos Maiolino

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.