Re: [PATCH 02/23] libxfs: remove the dead {d,log,rt}path variables in libxfs_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 11, 2023 at 05:37:21PM +0100, Christoph Hellwig wrote:
> These variables are only initialized, and then unlink is called if they
> were changed from the initial value, which can't happen.  Remove the
> variables and the conditional unlink calls.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>

> ---
>  libxfs/init.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/libxfs/init.c b/libxfs/init.c
> index ce6e62cde..a8603e2fb 100644
> --- a/libxfs/init.c
> +++ b/libxfs/init.c
> @@ -307,17 +307,13 @@ libxfs_init(libxfs_init_t *a)
>  {
>  	char		*blockfile;
>  	char		*dname;
> -	char		dpath[25];
>  	int		fd;
>  	char		*logname;
> -	char		logpath[25];
>  	char		*rawfile;
>  	char		*rtname;
> -	char		rtpath[25];
>  	int		rval = 0;
>  	int		flags;
> 
> -	dpath[0] = logpath[0] = rtpath[0] = '\0';
>  	dname = a->dname;
>  	logname = a->logname;
>  	rtname = a->rtname;
> @@ -418,12 +414,6 @@ libxfs_init(libxfs_init_t *a)
>  	init_caches();
>  	rval = 1;
>  done:
> -	if (dpath[0])
> -		unlink(dpath);
> -	if (logpath[0])
> -		unlink(logpath);
> -	if (rtpath[0])
> -		unlink(rtpath);
>  	if (fd >= 0)
>  		close(fd);
>  	if (!rval) {
> --
> 2.39.2
> 




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux