Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
fb2036d8
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fb2036d8
编写于
11月 23, 2016
作者:
P
Pavel Shilovsky
提交者:
Steve French
2月 01, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CIFS: Make send_cancel take rqst as argument
Signed-off-by:
N
Pavel Shilovsky
<
pshilov@microsoft.com
>
上级
da502f7d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
17 deletion
+22
-17
fs/cifs/cifsglob.h
fs/cifs/cifsglob.h
+1
-1
fs/cifs/smb1ops.c
fs/cifs/smb1ops.c
+2
-2
fs/cifs/transport.c
fs/cifs/transport.c
+19
-14
未找到文件。
fs/cifs/cifsglob.h
浏览文件 @
fb2036d8
...
...
@@ -208,7 +208,7 @@ struct cifsInodeInfo;
struct
cifs_open_parms
;
struct
smb_version_operations
{
int
(
*
send_cancel
)(
struct
TCP_Server_Info
*
,
void
*
,
int
(
*
send_cancel
)(
struct
TCP_Server_Info
*
,
struct
smb_rqst
*
,
struct
mid_q_entry
*
);
bool
(
*
compare_fids
)(
struct
cifsFileInfo
*
,
struct
cifsFileInfo
*
);
/* setup request: allocate mid, sign message */
...
...
fs/cifs/smb1ops.c
浏览文件 @
fb2036d8
...
...
@@ -36,11 +36,11 @@
* SMB_COM_NT_CANCEL request and then sends it.
*/
static
int
send_nt_cancel
(
struct
TCP_Server_Info
*
server
,
void
*
buf
,
send_nt_cancel
(
struct
TCP_Server_Info
*
server
,
struct
smb_rqst
*
rqst
,
struct
mid_q_entry
*
mid
)
{
int
rc
=
0
;
struct
smb_hdr
*
in_buf
=
(
struct
smb_hdr
*
)
buf
;
struct
smb_hdr
*
in_buf
=
(
struct
smb_hdr
*
)
rqst
->
rq_iov
[
0
].
iov_base
;
/* -4 for RFC1001 length and +2 for BCC field */
in_buf
->
smb_buf_length
=
cpu_to_be32
(
sizeof
(
struct
smb_hdr
)
-
4
+
2
);
...
...
fs/cifs/transport.c
浏览文件 @
fb2036d8
...
...
@@ -596,10 +596,11 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
}
static
inline
int
send_cancel
(
struct
TCP_Server_Info
*
server
,
void
*
buf
,
struct
mid_q_entry
*
mid
)
send_cancel
(
struct
TCP_Server_Info
*
server
,
struct
smb_rqst
*
rqst
,
struct
mid_q_entry
*
mid
)
{
return
server
->
ops
->
send_cancel
?
server
->
ops
->
send_cancel
(
server
,
buf
,
mid
)
:
0
;
server
->
ops
->
send_cancel
(
server
,
rqst
,
mid
)
:
0
;
}
int
...
...
@@ -719,7 +720,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
rc
=
wait_for_response
(
ses
->
server
,
midQ
);
if
(
rc
!=
0
)
{
send_cancel
(
ses
->
server
,
buf
,
midQ
);
send_cancel
(
ses
->
server
,
&
rqst
,
midQ
);
spin_lock
(
&
GlobalMid_Lock
);
if
(
midQ
->
mid_state
==
MID_REQUEST_SUBMITTED
)
{
midQ
->
callback
=
DeleteMidQEntry
;
...
...
@@ -772,6 +773,9 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
{
int
rc
=
0
;
struct
mid_q_entry
*
midQ
;
unsigned
int
len
=
be32_to_cpu
(
in_buf
->
smb_buf_length
);
struct
kvec
iov
=
{
.
iov_base
=
in_buf
,
.
iov_len
=
len
};
struct
smb_rqst
rqst
=
{
.
rq_iov
=
&
iov
,
.
rq_nvec
=
1
};
if
(
ses
==
NULL
)
{
cifs_dbg
(
VFS
,
"Null smb session
\n
"
);
...
...
@@ -789,10 +793,9 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
to the same server. We may make this configurable later or
use ses->maxReq */
if
(
be32_to_cpu
(
in_buf
->
smb_buf_length
)
>
CIFSMaxBufSize
+
MAX_CIFS_HDR_SIZE
-
4
)
{
if
(
len
>
CIFSMaxBufSize
+
MAX_CIFS_HDR_SIZE
-
4
)
{
cifs_dbg
(
VFS
,
"Illegal length, greater than maximum frame, %d
\n
"
,
be32_to_cpu
(
in_buf
->
smb_buf_length
)
);
len
);
return
-
EIO
;
}
...
...
@@ -823,7 +826,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
midQ
->
mid_state
=
MID_REQUEST_SUBMITTED
;
cifs_in_send_inc
(
ses
->
server
);
rc
=
smb_send
(
ses
->
server
,
in_buf
,
be32_to_cpu
(
in_buf
->
smb_buf_length
)
);
rc
=
smb_send
(
ses
->
server
,
in_buf
,
len
);
cifs_in_send_dec
(
ses
->
server
);
cifs_save_when_sent
(
midQ
);
...
...
@@ -840,7 +843,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
rc
=
wait_for_response
(
ses
->
server
,
midQ
);
if
(
rc
!=
0
)
{
send_cancel
(
ses
->
server
,
in_buf
,
midQ
);
send_cancel
(
ses
->
server
,
&
rqst
,
midQ
);
spin_lock
(
&
GlobalMid_Lock
);
if
(
midQ
->
mid_state
==
MID_REQUEST_SUBMITTED
)
{
/* no longer considered to be "in-flight" */
...
...
@@ -909,6 +912,9 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
int
rstart
=
0
;
struct
mid_q_entry
*
midQ
;
struct
cifs_ses
*
ses
;
unsigned
int
len
=
be32_to_cpu
(
in_buf
->
smb_buf_length
);
struct
kvec
iov
=
{
.
iov_base
=
in_buf
,
.
iov_len
=
len
};
struct
smb_rqst
rqst
=
{
.
rq_iov
=
&
iov
,
.
rq_nvec
=
1
};
if
(
tcon
==
NULL
||
tcon
->
ses
==
NULL
)
{
cifs_dbg
(
VFS
,
"Null smb session
\n
"
);
...
...
@@ -928,10 +934,9 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
to the same server. We may make this configurable later or
use ses->maxReq */
if
(
be32_to_cpu
(
in_buf
->
smb_buf_length
)
>
CIFSMaxBufSize
+
MAX_CIFS_HDR_SIZE
-
4
)
{
if
(
len
>
CIFSMaxBufSize
+
MAX_CIFS_HDR_SIZE
-
4
)
{
cifs_dbg
(
VFS
,
"Illegal length, greater than maximum frame, %d
\n
"
,
be32_to_cpu
(
in_buf
->
smb_buf_length
)
);
len
);
return
-
EIO
;
}
...
...
@@ -960,7 +965,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
midQ
->
mid_state
=
MID_REQUEST_SUBMITTED
;
cifs_in_send_inc
(
ses
->
server
);
rc
=
smb_send
(
ses
->
server
,
in_buf
,
be32_to_cpu
(
in_buf
->
smb_buf_length
)
);
rc
=
smb_send
(
ses
->
server
,
in_buf
,
len
);
cifs_in_send_dec
(
ses
->
server
);
cifs_save_when_sent
(
midQ
);
...
...
@@ -989,7 +994,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
if
(
in_buf
->
Command
==
SMB_COM_TRANSACTION2
)
{
/* POSIX lock. We send a NT_CANCEL SMB to cause the
blocking lock to return. */
rc
=
send_cancel
(
ses
->
server
,
in_buf
,
midQ
);
rc
=
send_cancel
(
ses
->
server
,
&
rqst
,
midQ
);
if
(
rc
)
{
cifs_delete_mid
(
midQ
);
return
rc
;
...
...
@@ -1010,7 +1015,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
rc
=
wait_for_response
(
ses
->
server
,
midQ
);
if
(
rc
)
{
send_cancel
(
ses
->
server
,
in_buf
,
midQ
);
send_cancel
(
ses
->
server
,
&
rqst
,
midQ
);
spin_lock
(
&
GlobalMid_Lock
);
if
(
midQ
->
mid_state
==
MID_REQUEST_SUBMITTED
)
{
/* no longer considered to be "in-flight" */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录