Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Baokun Li <libaokun1@huawei.com>
Cc: Steve French <sfrench@samba.org>,
	linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
	kernel-janitors@vger.kernel.org, Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next] cifs: convert list_for_each to entry variant in smb2misc.c
Date: Thu, 17 Jun 2021 17:17:17 +0300	[thread overview]
Message-ID: <20210617141717.GF1861@kadam> (raw)
In-Reply-To: <20210617132250.690226-1-libaokun1@huawei.com>

On Thu, Jun 17, 2021 at 09:22:50PM +0800, Baokun Li wrote:
> @@ -628,9 +624,7 @@ smb2_is_valid_lease_break(char *buffer)
>  
>  	/* look up tcon based on tid & uid */
>  	spin_lock(&cifs_tcp_ses_lock);
> -	list_for_each(tmp, &cifs_tcp_ses_list) {
> -		server = list_entry(tmp, struct TCP_Server_Info, tcp_ses_list);
> -
> +	list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
>  		list_for_each(tmp1, &server->smb_ses_list) {
>  			ses = list_entry(tmp1, struct cifs_ses, smb_ses_list);
                        ^^^^^^^^^^^^^^^^

Please convert this one as well.

>  
> @@ -687,7 +681,7 @@ bool
>  smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
>  {
>  	struct smb2_oplock_break *rsp = (struct smb2_oplock_break *)buffer;
> -	struct list_head *tmp, *tmp1, *tmp2;
> +	struct list_head *tmp1, *tmp2;
>  	struct cifs_ses *ses;
>  	struct cifs_tcon *tcon;
>  	struct cifsInodeInfo *cinode;
> @@ -710,9 +704,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
>  
>  	/* look up tcon based on tid & uid */
>  	spin_lock(&cifs_tcp_ses_lock);
> -	list_for_each(tmp, &server->smb_ses_list) {
> -		ses = list_entry(tmp, struct cifs_ses, smb_ses_list);
> -
> +	list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
>  		list_for_each(tmp1, &ses->tcon_list) {
>  			tcon = list_entry(tmp1, struct cifs_tcon, tcon_list);
                        ^^^^^^^^^^^^^^^^^
And this one.

regards,
dan carpenter

>  

  reply	other threads:[~2021-06-17 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 13:22 [PATCH -next] cifs: convert list_for_each to entry variant in smb2misc.c Baokun Li
2021-06-17 14:17 ` Dan Carpenter [this message]
2021-06-18  1:18   ` libaokun (A)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210617141717.GF1861@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=hulkci@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=libaokun1@huawei.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox