Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
d39a4f71
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d39a4f71
编写于
9月 19, 2012
作者:
P
Pavel Shilovsky
提交者:
Steve French
9月 24, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CIFS: Move brlock code to ops struct
Signed-off-by:
N
Pavel Shilovsky
<
pshilovsky@samba.org
>
上级
f45d3416
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
25 deletion
+40
-25
fs/cifs/cifsglob.h
fs/cifs/cifsglob.h
+8
-0
fs/cifs/cifsproto.h
fs/cifs/cifsproto.h
+3
-0
fs/cifs/file.c
fs/cifs/file.c
+17
-25
fs/cifs/smb1ops.c
fs/cifs/smb1ops.c
+12
-0
未找到文件。
fs/cifs/cifsglob.h
浏览文件 @
d39a4f71
...
@@ -353,6 +353,14 @@ struct smb_version_operations {
...
@@ -353,6 +353,14 @@ struct smb_version_operations {
/* query remote filesystem */
/* query remote filesystem */
int
(
*
queryfs
)(
const
unsigned
int
,
struct
cifs_tcon
*
,
int
(
*
queryfs
)(
const
unsigned
int
,
struct
cifs_tcon
*
,
struct
kstatfs
*
);
struct
kstatfs
*
);
/* send mandatory brlock to the server */
int
(
*
mand_lock
)(
const
unsigned
int
,
struct
cifsFileInfo
*
,
__u64
,
__u64
,
__u32
,
int
,
int
,
bool
);
/* unlock range of mandatory locks */
int
(
*
mand_unlock_range
)(
struct
cifsFileInfo
*
,
struct
file_lock
*
,
const
unsigned
int
);
/* push brlocks from the cache to the server */
int
(
*
push_mand_locks
)(
struct
cifsFileInfo
*
);
};
};
struct
smb_version_values
{
struct
smb_version_values
{
...
...
fs/cifs/cifsproto.h
浏览文件 @
d39a4f71
...
@@ -124,6 +124,9 @@ extern u64 cifs_UnixTimeToNT(struct timespec);
...
@@ -124,6 +124,9 @@ extern u64 cifs_UnixTimeToNT(struct timespec);
extern
struct
timespec
cnvrtDosUnixTm
(
__le16
le_date
,
__le16
le_time
,
extern
struct
timespec
cnvrtDosUnixTm
(
__le16
le_date
,
__le16
le_time
,
int
offset
);
int
offset
);
extern
void
cifs_set_oplock_level
(
struct
cifsInodeInfo
*
cinode
,
__u32
oplock
);
extern
void
cifs_set_oplock_level
(
struct
cifsInodeInfo
*
cinode
,
__u32
oplock
);
extern
int
cifs_unlock_range
(
struct
cifsFileInfo
*
cfile
,
struct
file_lock
*
flock
,
const
unsigned
int
xid
);
extern
int
cifs_push_mandatory_locks
(
struct
cifsFileInfo
*
cfile
);
extern
struct
cifsFileInfo
*
cifs_new_fileinfo
(
struct
cifs_fid
*
fid
,
extern
struct
cifsFileInfo
*
cifs_new_fileinfo
(
struct
cifs_fid
*
fid
,
struct
file
*
file
,
struct
file
*
file
,
...
...
fs/cifs/file.c
浏览文件 @
d39a4f71
...
@@ -903,7 +903,7 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)
...
@@ -903,7 +903,7 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)
return
rc
;
return
rc
;
}
}
static
int
int
cifs_push_mandatory_locks
(
struct
cifsFileInfo
*
cfile
)
cifs_push_mandatory_locks
(
struct
cifsFileInfo
*
cfile
)
{
{
unsigned
int
xid
;
unsigned
int
xid
;
...
@@ -1111,7 +1111,7 @@ cifs_push_locks(struct cifsFileInfo *cfile)
...
@@ -1111,7 +1111,7 @@ cifs_push_locks(struct cifsFileInfo *cfile)
((
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_NOPOSIXBRL
)
==
0
))
((
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_NOPOSIXBRL
)
==
0
))
return
cifs_push_posix_locks
(
cfile
);
return
cifs_push_posix_locks
(
cfile
);
return
cifs_push_mandatory
_locks
(
cfile
);
return
tcon
->
ses
->
server
->
ops
->
push_mand
_locks
(
cfile
);
}
}
static
void
static
void
...
@@ -1161,15 +1161,6 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
...
@@ -1161,15 +1161,6 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
cFYI
(
1
,
"Unknown type of lock"
);
cFYI
(
1
,
"Unknown type of lock"
);
}
}
static
int
cifs_mandatory_lock
(
unsigned
int
xid
,
struct
cifsFileInfo
*
cfile
,
__u64
offset
,
__u64
length
,
__u32
type
,
int
lock
,
int
unlock
,
bool
wait
)
{
return
CIFSSMBLock
(
xid
,
tlink_tcon
(
cfile
->
tlink
),
cfile
->
fid
.
netfid
,
current
->
tgid
,
length
,
offset
,
unlock
,
lock
,
(
__u8
)
type
,
wait
,
0
);
}
static
int
static
int
cifs_getlk
(
struct
file
*
file
,
struct
file_lock
*
flock
,
__u32
type
,
cifs_getlk
(
struct
file
*
file
,
struct
file_lock
*
flock
,
__u32
type
,
bool
wait_flag
,
bool
posix_lck
,
unsigned
int
xid
)
bool
wait_flag
,
bool
posix_lck
,
unsigned
int
xid
)
...
@@ -1203,11 +1194,11 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
...
@@ -1203,11 +1194,11 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
return
rc
;
return
rc
;
/* BB we could chain these into one lock request BB */
/* BB we could chain these into one lock request BB */
rc
=
cifs_mandatory
_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
type
,
rc
=
server
->
ops
->
mand
_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
type
,
1
,
0
,
false
);
1
,
0
,
false
);
if
(
rc
==
0
)
{
if
(
rc
==
0
)
{
rc
=
cifs_mandatory
_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
rc
=
server
->
ops
->
mand
_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
type
,
0
,
1
,
false
);
type
,
0
,
1
,
false
);
flock
->
fl_type
=
F_UNLCK
;
flock
->
fl_type
=
F_UNLCK
;
if
(
rc
!=
0
)
if
(
rc
!=
0
)
cERROR
(
1
,
"Error unlocking previously locked "
cERROR
(
1
,
"Error unlocking previously locked "
...
@@ -1220,13 +1211,14 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
...
@@ -1220,13 +1211,14 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
return
0
;
return
0
;
}
}
rc
=
cifs_mandatory_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
type
&=
~
server
->
vals
->
exclusive_lock_type
;
type
|
server
->
vals
->
shared_lock_type
,
1
,
0
,
false
);
rc
=
server
->
ops
->
mand_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
type
|
server
->
vals
->
shared_lock_type
,
1
,
0
,
false
);
if
(
rc
==
0
)
{
if
(
rc
==
0
)
{
rc
=
cifs_mandatory_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
rc
=
server
->
ops
->
mand_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
type
|
server
->
vals
->
shared_lock_type
,
type
|
server
->
vals
->
shared_lock_type
,
0
,
1
,
false
);
0
,
1
,
false
);
flock
->
fl_type
=
F_RDLCK
;
flock
->
fl_type
=
F_RDLCK
;
if
(
rc
!=
0
)
if
(
rc
!=
0
)
cERROR
(
1
,
"Error unlocking previously locked "
cERROR
(
1
,
"Error unlocking previously locked "
...
@@ -1256,7 +1248,7 @@ cifs_free_llist(struct list_head *llist)
...
@@ -1256,7 +1248,7 @@ cifs_free_llist(struct list_head *llist)
}
}
}
}
static
int
int
cifs_unlock_range
(
struct
cifsFileInfo
*
cfile
,
struct
file_lock
*
flock
,
cifs_unlock_range
(
struct
cifsFileInfo
*
cfile
,
struct
file_lock
*
flock
,
unsigned
int
xid
)
unsigned
int
xid
)
{
{
...
@@ -1408,8 +1400,8 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
...
@@ -1408,8 +1400,8 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
if
(
rc
<=
0
)
if
(
rc
<=
0
)
goto
out
;
goto
out
;
rc
=
cifs_mandatory
_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
rc
=
server
->
ops
->
mand
_lock
(
xid
,
cfile
,
flock
->
fl_start
,
length
,
type
,
1
,
0
,
wait_flag
);
type
,
1
,
0
,
wait_flag
);
if
(
rc
)
{
if
(
rc
)
{
kfree
(
lock
);
kfree
(
lock
);
goto
out
;
goto
out
;
...
@@ -1417,7 +1409,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
...
@@ -1417,7 +1409,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
cifs_lock_add
(
cfile
,
lock
);
cifs_lock_add
(
cfile
,
lock
);
}
else
if
(
unlock
)
}
else
if
(
unlock
)
rc
=
cifs
_unlock_range
(
cfile
,
flock
,
xid
);
rc
=
server
->
ops
->
mand
_unlock_range
(
cfile
,
flock
,
xid
);
out:
out:
if
(
flock
->
fl_flags
&
FL_POSIX
)
if
(
flock
->
fl_flags
&
FL_POSIX
)
...
...
fs/cifs/smb1ops.c
浏览文件 @
d39a4f71
...
@@ -899,6 +899,15 @@ cifs_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
...
@@ -899,6 +899,15 @@ cifs_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
return
rc
;
return
rc
;
}
}
static
int
cifs_mand_lock
(
const
unsigned
int
xid
,
struct
cifsFileInfo
*
cfile
,
__u64
offset
,
__u64
length
,
__u32
type
,
int
lock
,
int
unlock
,
bool
wait
)
{
return
CIFSSMBLock
(
xid
,
tlink_tcon
(
cfile
->
tlink
),
cfile
->
fid
.
netfid
,
current
->
tgid
,
length
,
offset
,
unlock
,
lock
,
(
__u8
)
type
,
wait
,
0
);
}
struct
smb_version_operations
smb1_operations
=
{
struct
smb_version_operations
smb1_operations
=
{
.
send_cancel
=
send_nt_cancel
,
.
send_cancel
=
send_nt_cancel
,
.
compare_fids
=
cifs_compare_fids
,
.
compare_fids
=
cifs_compare_fids
,
...
@@ -960,6 +969,9 @@ struct smb_version_operations smb1_operations = {
...
@@ -960,6 +969,9 @@ struct smb_version_operations smb1_operations = {
.
calc_smb_size
=
smbCalcSize
,
.
calc_smb_size
=
smbCalcSize
,
.
oplock_response
=
cifs_oplock_response
,
.
oplock_response
=
cifs_oplock_response
,
.
queryfs
=
cifs_queryfs
,
.
queryfs
=
cifs_queryfs
,
.
mand_lock
=
cifs_mand_lock
,
.
mand_unlock_range
=
cifs_unlock_range
,
.
push_mand_locks
=
cifs_push_mandatory_locks
,
};
};
struct
smb_version_values
smb1_values
=
{
struct
smb_version_values
smb1_values
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录