lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <633750a9-bd94-df4b-0112-1e1e15a6b47b@fastmail.fm>
Date:   Fri, 8 Sep 2023 00:55:57 +0200
From:   Bernd Schubert <bernd.schubert@...tmail.fm>
To:     Kemeng Shi <shikemeng@...weicloud.com>, miklos@...redi.hu,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] fuse: move fuse_put_request a bit to remove forward
 declaration



On 9/4/23 16:30, Kemeng Shi wrote:
> Move fuse_put_request before fuse_get_req to remove forward declaration.
> 
> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
> ---
>   fs/fuse/dev.c | 42 ++++++++++++++++++++----------------------
>   1 file changed, 20 insertions(+), 22 deletions(-)
> 
> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> index 4f49b1946635..deda8b036de7 100644
> --- a/fs/fuse/dev.c
> +++ b/fs/fuse/dev.c
> @@ -101,7 +101,26 @@ static void fuse_drop_waiting(struct fuse_conn *fc)
>   	}
>   }
>   
> -static void fuse_put_request(struct fuse_req *req);
> +static void fuse_put_request(struct fuse_req *req)
> +{
> +	struct fuse_conn *fc = req->fm->fc;
> +
> +	if (refcount_dec_and_test(&req->count)) {
> +		if (test_bit(FR_BACKGROUND, &req->flags)) {
> +			/*
> +			 * We get here in the unlikely case that a background
> +			 * request was allocated but not sent
> +			 */
> +			spin_lock(&fc->bg_lock);
> +			if (!fc->blocked)
> +				wake_up(&fc->blocked_waitq);
> +			spin_unlock(&fc->bg_lock);
> +		}
> +
> +		fuse_drop_waiting(fc);
> +		fuse_request_free(req);
> +	}
> +}
>   
>   static struct fuse_req *fuse_get_req(struct fuse_mount *fm, bool for_background)
>   {
> @@ -154,27 +173,6 @@ static struct fuse_req *fuse_get_req(struct fuse_mount *fm, bool for_background)
>   	return ERR_PTR(err);
>   }
>   
> -static void fuse_put_request(struct fuse_req *req)
> -{
> -	struct fuse_conn *fc = req->fm->fc;
> -
> -	if (refcount_dec_and_test(&req->count)) {
> -		if (test_bit(FR_BACKGROUND, &req->flags)) {
> -			/*
> -			 * We get here in the unlikely case that a background
> -			 * request was allocated but not sent
> -			 */
> -			spin_lock(&fc->bg_lock);
> -			if (!fc->blocked)
> -				wake_up(&fc->blocked_waitq);
> -			spin_unlock(&fc->bg_lock);
> -		}
> -
> -		fuse_drop_waiting(fc);
> -		fuse_request_free(req);
> -	}
> -}
> -
>   unsigned int fuse_len_args(unsigned int numargs, struct fuse_arg *args)
>   {
>   	unsigned nbytes = 0;

Hmm yeah, but it makes it harder to get history with git annotate/blame?

Thanks,
Bernd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ