Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etercifs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etercifs
Commits
e2a2bfeb
Commit
e2a2bfeb
authored
Feb 19, 2011
by
Pavel Shilovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix oplock handling for CentOS 5.5
parent
9af697a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
cifsproto.h
sources/centos55/cifsproto.h
+4
-3
cifssmb.c
sources/centos55/cifssmb.c
+5
-3
file.c
sources/centos55/file.c
+8
-7
No files found.
sources/centos55/cifsproto.h
View file @
e2a2bfeb
...
...
@@ -338,9 +338,10 @@ extern int cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
const
struct
nls_table
*
cp
,
int
mapChars
);
extern
int
CIFSSMBLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
netfid
,
const
__u64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u32
numLock
,
const
__u8
lockType
,
const
bool
waitFlag
);
const
__u16
netfid
,
const
__u64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u32
numLock
,
const
__u8
lockType
,
const
bool
waitFlag
,
const
__u8
oplock_level
);
extern
int
CIFSSMBPosixLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
int
get_flag
,
const
__u64
len
,
struct
file_lock
*
,
...
...
sources/centos55/cifssmb.c
View file @
e2a2bfeb
...
...
@@ -1711,9 +1711,10 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
int
CIFSSMBLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
__u64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u32
numLock
,
const
__u8
lockType
,
const
bool
waitFlag
)
const
__u16
smb_file_id
,
const
__u64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u32
numLock
,
const
__u8
lockType
,
const
bool
waitFlag
,
const
__u8
oplock_level
)
{
int
rc
=
0
;
LOCK_REQ
*
pSMB
=
NULL
;
...
...
@@ -1741,6 +1742,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
pSMB
->
NumberOfLocks
=
cpu_to_le16
(
numLock
);
pSMB
->
NumberOfUnlocks
=
cpu_to_le16
(
numUnlock
);
pSMB
->
LockType
=
lockType
;
pSMB
->
OplockLevel
=
oplock_level
;
pSMB
->
AndXCommand
=
0xFF
;
/* none */
pSMB
->
Fid
=
smb_file_id
;
/* netfid stays le */
...
...
sources/centos55/file.c
View file @
e2a2bfeb
...
...
@@ -902,12 +902,12 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
/* BB we could chain these into one lock request BB */
rc
=
CIFSSMBLock
(
xid
,
tcon
,
netfid
,
length
,
pfLock
->
fl_start
,
0
,
1
,
lockType
,
0
/* wait flag */
);
0
,
1
,
lockType
,
0
/* wait flag */
,
0
);
if
(
rc
==
0
)
{
rc
=
CIFSSMBLock
(
xid
,
tcon
,
netfid
,
length
,
pfLock
->
fl_start
,
1
/* numUnlock */
,
0
/* numLock */
,
lockType
,
0
/* wait flag */
);
0
/* wait flag */
,
0
);
pfLock
->
fl_type
=
F_UNLCK
;
if
(
rc
!=
0
)
cERROR
(
1
,
(
"Error unlocking previously locked "
...
...
@@ -924,13 +924,13 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
rc
=
CIFSSMBLock
(
xid
,
tcon
,
netfid
,
length
,
pfLock
->
fl_start
,
0
,
1
,
lockType
|
LOCKING_ANDX_SHARED_LOCK
,
0
/* wait flag */
);
0
/* wait flag */
,
0
);
if
(
rc
==
0
)
{
rc
=
CIFSSMBLock
(
xid
,
tcon
,
netfid
,
length
,
pfLock
->
fl_start
,
1
,
0
,
lockType
|
LOCKING_ANDX_SHARED_LOCK
,
0
/* wait flag */
);
0
/* wait flag */
,
0
);
pfLock
->
fl_type
=
F_RDLCK
;
if
(
rc
!=
0
)
cERROR
(
1
,
(
"Error unlocking "
...
...
@@ -975,7 +975,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
if
(
numLock
)
{
rc
=
CIFSSMBLock
(
xid
,
tcon
,
netfid
,
length
,
pfLock
->
fl_start
,
0
,
numLock
,
lockType
,
wait_flag
);
wait_flag
,
0
);
if
(
rc
==
0
)
{
/* For Windows locks we must store them. */
...
...
@@ -997,7 +997,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
stored_rc
=
CIFSSMBLock
(
xid
,
tcon
,
netfid
,
li
->
length
,
li
->
offset
,
1
,
0
,
li
->
type
,
false
);
li
->
type
,
false
,
0
);
if
(
stored_rc
)
rc
=
stored_rc
;
else
{
...
...
@@ -2559,7 +2559,8 @@ cifs_oplock_break(void *data)
*/
if
(
!
cfile
->
closePend
&&
!
cfile
->
oplock_break_cancelled
)
{
rc
=
CIFSSMBLock
(
0
,
cifs_sb
->
tcon
,
cfile
->
netfid
,
0
,
0
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
false
);
LOCKING_ANDX_OPLOCK_RELEASE
,
false
,
cinode
->
clientCanCacheRead
?
1
:
0
);
cFYI
(
1
,
(
"Oplock release rc = %d"
,
rc
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment