Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
fc94cdb9
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fc94cdb9
编写于
5月 30, 2006
作者:
S
Steve French
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CIFS] Fix new POSIX Locking for setting lock_type correctly on unlock
Signed-off-by:
N
Steve French
<
sfrench@us.ibm.com
>
上级
d9ec5ad2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
42 addition
and
7 deletion
+42
-7
fs/cifs/CHANGES
fs/cifs/CHANGES
+5
-0
fs/cifs/cifsfs.h
fs/cifs/cifsfs.h
+1
-1
fs/cifs/cifsproto.h
fs/cifs/cifsproto.h
+1
-1
fs/cifs/cifssmb.c
fs/cifs/cifssmb.c
+33
-3
fs/cifs/file.c
fs/cifs/file.c
+2
-2
未找到文件。
fs/cifs/CHANGES
浏览文件 @
fc94cdb9
Version 1.43
------------
POSIX locking to servers which support CIFS POSIX Extensions
(disabled by default controlled by proc/fs/cifs/Experimental)
Version 1.42
------------
Fix slow oplock break when mounted to different servers at the same time and
...
...
fs/cifs/cifsfs.h
浏览文件 @
fc94cdb9
...
...
@@ -99,5 +99,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t);
extern
ssize_t
cifs_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
int
cifs_ioctl
(
struct
inode
*
inode
,
struct
file
*
filep
,
unsigned
int
command
,
unsigned
long
arg
);
#define CIFS_VERSION "1.4
2
"
#define CIFS_VERSION "1.4
3
"
#endif
/* _CIFSFS_H */
fs/cifs/cifsproto.h
浏览文件 @
fc94cdb9
...
...
@@ -267,7 +267,7 @@ extern int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
const
int
waitFlag
);
extern
int
CIFSSMBPosixLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
int
get_flag
,
const
__u64
len
,
const
__u64
offset
,
const
__u64
len
,
struct
file_lock
*
,
const
__u16
lock_type
,
const
int
waitFlag
);
extern
int
CIFSSMBTDis
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
);
extern
int
CIFSSMBLogoff
(
const
int
xid
,
struct
cifsSesInfo
*
ses
);
...
...
fs/cifs/cifssmb.c
浏览文件 @
fc94cdb9
...
...
@@ -1355,7 +1355,8 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
int
CIFSSMBPosixLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
int
get_flag
,
const
__u64
len
,
const
__u64
lkoffset
,
const
__u16
lock_type
,
const
int
waitFlag
)
struct
file_lock
*
pLockData
,
const
__u16
lock_type
,
const
int
waitFlag
)
{
struct
smb_com_transaction2_sfi_req
*
pSMB
=
NULL
;
struct
smb_com_transaction2_sfi_rsp
*
pSMBr
=
NULL
;
...
...
@@ -1366,6 +1367,10 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
__u16
params
,
param_offset
,
offset
,
byte_count
,
count
;
cFYI
(
1
,
(
"Posix Lock"
));
if
(
pLockData
==
NULL
)
return
EINVAL
;
rc
=
small_smb_init
(
SMB_COM_TRANSACTION2
,
15
,
tcon
,
(
void
**
)
&
pSMB
);
if
(
rc
)
...
...
@@ -1406,7 +1411,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
if
(
waitFlag
)
parm_data
->
lock_flags
=
1
;
parm_data
->
pid
=
cpu_to_le32
(
current
->
tgid
);
parm_data
->
start
=
lkoffset
;
parm_data
->
start
=
cpu_to_le64
(
pLockData
->
fl_start
)
;
parm_data
->
length
=
len
;
/* normalize negative numbers */
pSMB
->
DataOffset
=
cpu_to_le16
(
offset
);
...
...
@@ -1419,8 +1424,33 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
(
struct
smb_hdr
*
)
pSMBr
,
&
bytes_returned
,
0
);
if
(
rc
)
{
cFYI
(
1
,
(
"Send error in Posix Lock = %d"
,
rc
));
}
}
else
if
(
get_flag
)
{
/* lock structure can be returned on get */
__u16
data_offset
;
__u16
data_count
;
rc
=
validate_t2
((
struct
smb_t2_rsp
*
)
pSMBr
);
if
(
rc
||
(
pSMBr
->
ByteCount
<
sizeof
(
struct
cifs_posix_lock
)))
{
rc
=
-
EIO
;
/* bad smb */
goto
plk_err_exit
;
}
if
(
pLockData
==
NULL
)
{
rc
=
-
EINVAL
;
goto
plk_err_exit
;
}
data_offset
=
le16_to_cpu
(
pSMBr
->
t2
.
DataOffset
);
data_count
=
le16_to_cpu
(
pSMBr
->
t2
.
DataCount
);
if
(
data_count
<
sizeof
(
struct
cifs_posix_lock
))
{
rc
=
-
EIO
;
goto
plk_err_exit
;
}
parm_data
=
(
struct
cifs_posix_lock
*
)
((
char
*
)
&
pSMBr
->
hdr
.
Protocol
+
data_offset
);
if
(
parm_data
->
lock_type
==
cpu_to_le16
(
CIFS_UNLCK
))
pLockData
->
fl_type
=
F_UNLCK
;
}
plk_err_exit:
if
(
pSMB
)
cifs_small_buf_release
(
pSMB
);
...
...
fs/cifs/file.c
浏览文件 @
fc94cdb9
...
...
@@ -656,7 +656,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
else
posix_lock_type
=
CIFS_WRLCK
;
rc
=
CIFSSMBPosixLock
(
xid
,
pTcon
,
netfid
,
1
/* get */
,
length
,
pfLock
->
fl_start
,
length
,
pfLock
,
posix_lock_type
,
wait_flag
);
FreeXid
(
xid
);
return
rc
;
...
...
@@ -704,7 +704,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
return
-
EOPNOTSUPP
;
}
rc
=
CIFSSMBPosixLock
(
xid
,
pTcon
,
netfid
,
0
/* set */
,
length
,
pfLock
->
fl_start
,
length
,
pfLock
,
posix_lock_type
,
wait_flag
);
}
else
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
length
,
pfLock
->
fl_start
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录