diff options
author | Sachin Prabhu <sprabhu@redhat.com> | 2014-06-16 10:35:24 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2014-08-01 00:11:15 -0400 |
commit | 6d81ed1ec22dbe96b85a5eb6422b2ab0556f7cbc (patch) | |
tree | d531d22859f8cd6a0c2836f548431cffb3900419 /fs/cifs/cifssmb.c | |
parent | 6f0928036bcbd8dd2ebee9201580da8bcc0a81af (diff) |
cifs: replace code with free_rsp_buf()
The functionality provided by free_rsp_buf() is duplicated in a number
of places. Replace these instances with a call to free_rsp_buf().
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Shirish Pargaonkar <spargaonkar@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 6ce4e0954b98..b7e5b6508caa 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1734,10 +1734,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms, | |||
1734 | 1734 | ||
1735 | /* cifs_small_buf_release(pSMB); */ /* Freed earlier now in SendReceive2 */ | 1735 | /* cifs_small_buf_release(pSMB); */ /* Freed earlier now in SendReceive2 */ |
1736 | if (*buf) { | 1736 | if (*buf) { |
1737 | if (resp_buf_type == CIFS_SMALL_BUFFER) | 1737 | free_rsp_buf(resp_buf_type, iov[0].iov_base); |
1738 | cifs_small_buf_release(iov[0].iov_base); | ||
1739 | else if (resp_buf_type == CIFS_LARGE_BUFFER) | ||
1740 | cifs_buf_release(iov[0].iov_base); | ||
1741 | } else if (resp_buf_type != CIFS_NO_BUFFER) { | 1738 | } else if (resp_buf_type != CIFS_NO_BUFFER) { |
1742 | /* return buffer to caller to free */ | 1739 | /* return buffer to caller to free */ |
1743 | *buf = iov[0].iov_base; | 1740 | *buf = iov[0].iov_base; |
@@ -2203,10 +2200,7 @@ CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms, | |||
2203 | } | 2200 | } |
2204 | 2201 | ||
2205 | /* cifs_small_buf_release(pSMB); */ /* Freed earlier now in SendReceive2 */ | 2202 | /* cifs_small_buf_release(pSMB); */ /* Freed earlier now in SendReceive2 */ |
2206 | if (resp_buf_type == CIFS_SMALL_BUFFER) | 2203 | free_rsp_buf(resp_buf_type, iov[0].iov_base); |
2207 | cifs_small_buf_release(iov[0].iov_base); | ||
2208 | else if (resp_buf_type == CIFS_LARGE_BUFFER) | ||
2209 | cifs_buf_release(iov[0].iov_base); | ||
2210 | 2204 | ||
2211 | /* Note: On -EAGAIN error only caller can retry on handle based calls | 2205 | /* Note: On -EAGAIN error only caller can retry on handle based calls |
2212 | since file handle passed in no longer valid */ | 2206 | since file handle passed in no longer valid */ |
@@ -2451,10 +2445,7 @@ plk_err_exit: | |||
2451 | if (pSMB) | 2445 | if (pSMB) |
2452 | cifs_small_buf_release(pSMB); | 2446 | cifs_small_buf_release(pSMB); |
2453 | 2447 | ||
2454 | if (resp_buf_type == CIFS_SMALL_BUFFER) | 2448 | free_rsp_buf(resp_buf_type, iov[0].iov_base); |
2455 | cifs_small_buf_release(iov[0].iov_base); | ||
2456 | else if (resp_buf_type == CIFS_LARGE_BUFFER) | ||
2457 | cifs_buf_release(iov[0].iov_base); | ||
2458 | 2449 | ||
2459 | /* Note: On -EAGAIN error only caller can retry on handle based calls | 2450 | /* Note: On -EAGAIN error only caller can retry on handle based calls |
2460 | since file handle passed in no longer valid */ | 2451 | since file handle passed in no longer valid */ |
@@ -3838,10 +3829,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid, | |||
3838 | } | 3829 | } |
3839 | } | 3830 | } |
3840 | qsec_out: | 3831 | qsec_out: |
3841 | if (buf_type == CIFS_SMALL_BUFFER) | 3832 | free_rsp_buf(buf_type, iov[0].iov_base); |
3842 | cifs_small_buf_release(iov[0].iov_base); | ||
3843 | else if (buf_type == CIFS_LARGE_BUFFER) | ||
3844 | cifs_buf_release(iov[0].iov_base); | ||
3845 | /* cifs_small_buf_release(pSMB); */ /* Freed earlier now in SendReceive2 */ | 3833 | /* cifs_small_buf_release(pSMB); */ /* Freed earlier now in SendReceive2 */ |
3846 | return rc; | 3834 | return rc; |
3847 | } | 3835 | } |