2011/10/12 Jeff Layton <jlayton@xxxxxxxxxx>: > On Wed, 12 Oct 2011 12:43:04 +0400 > Pavel Shilovsky <piastryyy@xxxxxxxxx> wrote: > >> 2011/8/29 Jeff Layton <jlayton@xxxxxxxxxx>: >> > Change find_cifs_mid to only return NULL if a mid could not be found. >> > If we got part of a multi-part T2 response, then coalesce it and still >> > return the mid. The caller can determine the T2 receive status from >> > the flags in the mid. >> > >> > With this change, there is no need to pass a pointer to "length" as >> > well so just pass by value. If a mid is found, then we can just mark >> > it as malformed. If one isn't found, then the value of "length" won't >> > change anyway. >> > >> > Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx> >> > --- >> > fs/cifs/connect.c | 35 ++++++++++++++++------------------- >> > 1 files changed, 16 insertions(+), 19 deletions(-) >> > >> > diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c >> > index 6b4fcb3..9518457 100644 >> > --- a/fs/cifs/connect.c >> > +++ b/fs/cifs/connect.c >> > @@ -576,8 +576,7 @@ dequeue_mid(struct mid_q_entry *mid, int malformed) >> > >> > static struct mid_q_entry * >> > find_cifs_mid(struct TCP_Server_Info *server, struct smb_hdr *buf, >> > - int *malformed, bool is_large_buf, bool *is_multi_rsp, >> > - char **bigbuf) >> > + int malformed, bool is_large_buf, char **bigbuf) >> > { >> > struct mid_q_entry *mid = NULL; >> > >> > @@ -585,16 +584,14 @@ find_cifs_mid(struct TCP_Server_Info *server, struct smb_hdr *buf, >> > if (!mid) >> > return mid; >> > >> > - if (*malformed == 0 && check2ndT2(buf) > 0) { >> > - /* We have a multipart transact2 resp */ >> > - *is_multi_rsp = true; >> > + if (malformed == 0 && check2ndT2(buf) > 0) { >> > + mid->multiRsp = true; >> > if (mid->resp_buf) { >> > /* merge response - fix up 1st*/ >> > - *malformed = coalesce_t2(buf, mid->resp_buf); >> > - if (*malformed > 0) { >> > - *malformed = 0; >> > - mid->multiRsp = true; >> > - return NULL; >> > + malformed = coalesce_t2(buf, mid->resp_buf); >> > + if (malformed > 0) { >> > + malformed = 0; >> ^^^^ >> this is unnecessary because we return from the function as the next step. >> > > <forehead slap> > > Correct. It's a harmless thing though. Mind if I fix this in a > follow-on patch to the whole series? I hate to have to respin it for > this... > The follow-on patch is ok for me. -- Best regards, Pavel Shilovsky. -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html