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
f9a7eb05
Commit
f9a7eb05
authored
Oct 27, 2009
by
Evgeny Sinelnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed mandatory reading for 2.6.16 (suse legacy)
parent
ac34f3a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
8 deletions
+47
-8
cifsfs.c
sources/2.6.16/cifsfs.c
+44
-1
inode.c
sources/2.6.16/inode.c
+3
-7
No files found.
sources/2.6.16/cifsfs.c
View file @
f9a7eb05
...
...
@@ -586,6 +586,49 @@ cifs_get_sb(struct file_system_type *fs_type,
#endif
}
static
ssize_t
cifs_sync_read
(
struct
file
*
filp
,
char
__user
*
buf
,
size_t
len
,
loff_t
*
ppos
)
{
int
retval
,
read
,
posix_locking
=
0
;
struct
file_lock
pfLock
;
struct
cifsInodeInfo
*
cifsInode
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifsTconInfo
*
tcon
;
cifs_sb
=
CIFS_SB
(
filp
->
f_path
.
dentry
->
d_sb
);
tcon
=
cifs_sb
->
tcon
;
if
((
tcon
->
ses
->
capabilities
&
CAP_UNIX
)
&&
(
CIFS_UNIX_FCNTL_CAP
&
le64_to_cpu
(
tcon
->
fsUnixInfo
.
Capability
))
&&
((
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_NOPOSIXBRL
)
==
0
))
posix_locking
=
1
;
retval
=
cifs_revalidate
(
filp
->
f_path
.
dentry
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
memset
(
&
pfLock
,
0
,
sizeof
(
pfLock
));
pfLock
.
fl_type
=
F_RDLCK
;
pfLock
.
fl_start
=
*
ppos
;
pfLock
.
fl_end
=
*
ppos
+
len
;
cifsInode
=
CIFS_I
(
filp
->
f_path
.
dentry
->
d_inode
);
if
(
cifsInode
==
NULL
)
return
-
ENOENT
;
if
(
!
CIFS_I
(
filp
->
f_path
.
dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
retval
=
cifs_lock
(
filp
,
F_GETLK
,
&
pfLock
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
if
(
pfLock
.
fl_type
==
F_UNLCK
)
read
=
do_sync_read
(
filp
,
buf
,
len
,
ppos
);
else
return
-
EACCES
;
}
else
read
=
do_sync_read
(
filp
,
buf
,
len
,
ppos
);
if
(
read
==
-
EACCES
&&
!
posix_locking
)
read
=
cifs_user_read
(
filp
,
buf
,
len
,
ppos
);
return
read
;
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
static
ssize_t
cifs_file_aio_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
...
...
@@ -708,7 +751,7 @@ struct inode_operations cifs_symlink_inode_ops = {
};
struct
file_operations
cifs_file_ops
=
{
.
read
=
do
_sync_read
,
.
read
=
cifs
_sync_read
,
.
write
=
do_sync_write
,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
.
readv
=
generic_file_readv
,
...
...
sources/2.6.16/inode.c
View file @
f9a7eb05
...
...
@@ -1347,13 +1347,9 @@ int cifs_revalidate(struct dentry *direntry)
if
(
S_ISREG
(
direntry
->
d_inode
->
i_mode
))
{
if
(
direntry
->
d_inode
->
i_mapping
)
filemap_fdatawait
(
direntry
->
d_inode
->
i_mapping
);
/* may eventually have to do this for open files too */
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
/* changed on server - flush read ahead pages */
cFYI
(
1
,
(
"Invalidating read ahead data on "
"closed file"
));
invalidate_remote_inode
(
direntry
->
d_inode
);
}
cFYI
(
1
,
(
"Invalidating read ahead data on "
"closed file"
));
invalidate_remote_inode
(
direntry
->
d_inode
);
}
}
/* mutex_unlock(&direntry->d_inode->i_mutex); */
...
...
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