diff mbox series

[3/5] libxfs: remove the S_ISREG check from blkid_get_topology

Message ID 20240117173312.868103-4-hch@lst.de (mailing list archive)
State Superseded
Headers show
Series [1/5] libxfs: remove the unused fs_topology_t typedef | expand

Commit Message

Christoph Hellwig Jan. 17, 2024, 5:33 p.m. UTC
The only caller already performs the exact same check.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 libxfs/topology.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Darrick J. Wong Jan. 17, 2024, 11:57 p.m. UTC | #1
On Wed, Jan 17, 2024 at 06:33:10PM +0100, Christoph Hellwig wrote:
> The only caller already performs the exact same check.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Makes sense now,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  libxfs/topology.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/libxfs/topology.c b/libxfs/topology.c
> index 8ae5f7483..3a659c262 100644
> --- a/libxfs/topology.c
> +++ b/libxfs/topology.c
> @@ -181,15 +181,6 @@ blkid_get_topology(
>  {
>  	blkid_topology tp;
>  	blkid_probe pr;
> -	struct stat statbuf;
> -
> -	/* can't get topology info from a file */
> -	if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) {
> -		fprintf(stderr,
> -	_("%s: Warning: trying to probe topology of a file %s!\n"),
> -			progname, device);
> -		return;
> -	}
>  
>  	pr = blkid_new_probe_from_filename(device);
>  	if (!pr)
> -- 
> 2.39.2
> 
>
diff mbox series

Patch

diff --git a/libxfs/topology.c b/libxfs/topology.c
index 8ae5f7483..3a659c262 100644
--- a/libxfs/topology.c
+++ b/libxfs/topology.c
@@ -181,15 +181,6 @@  blkid_get_topology(
 {
 	blkid_topology tp;
 	blkid_probe pr;
-	struct stat statbuf;
-
-	/* can't get topology info from a file */
-	if (!stat(device, &statbuf) && S_ISREG(statbuf.st_mode)) {
-		fprintf(stderr,
-	_("%s: Warning: trying to probe topology of a file %s!\n"),
-			progname, device);
-		return;
-	}
 
 	pr = blkid_new_probe_from_filename(device);
 	if (!pr)