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
e984f541
Commit
e984f541
authored
Mar 31, 2009
by
Konstantin Baev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4.3.1-alt1
- Remove oplock part of Etersoft patches (sources < 2.6.27) - use cifs_file_aio_read instead of generic_file_aio_read in all sources
parent
919d9d7d
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
151 additions
and
162 deletions
+151
-162
etercifs.spec
etercifs.spec
+5
-1
cifsfs.c
sources/2.6.16/cifsfs.c
+12
-14
cifsglob.h
sources/2.6.16/cifsglob.h
+0
-1
inode.c
sources/2.6.16/inode.c
+5
-10
cifsfs.c
sources/2.6.23/cifsfs.c
+12
-15
cifsglob.h
sources/2.6.23/cifsglob.h
+0
-1
inode.c
sources/2.6.23/inode.c
+5
-11
cifsfs.c
sources/2.6.24/cifsfs.c
+12
-15
cifsglob.h
sources/2.6.24/cifsglob.h
+0
-1
inode.c
sources/2.6.24/inode.c
+5
-11
cifsfs.c
sources/2.6.25/cifsfs.c
+12
-15
cifsglob.h
sources/2.6.25/cifsglob.h
+0
-1
inode.c
sources/2.6.25/inode.c
+5
-11
cifsfs.c
sources/2.6.26/cifsfs.c
+12
-15
cifsglob.h
sources/2.6.26/cifsglob.h
+0
-1
inode.c
sources/2.6.26/inode.c
+5
-11
cifsfs.c
sources/2.6.27/cifsfs.c
+14
-1
cifsfs.c
sources/2.6.28/cifsfs.c
+15
-1
cifsfs.c
sources/2.6.29/cifsfs.c
+15
-1
cifsfs.c
sources/legacy/cifsfs.c
+12
-14
cifsglob.h
sources/legacy/cifsglob.h
+0
-1
inode.c
sources/legacy/inode.c
+5
-10
No files found.
etercifs.spec
View file @
e984f541
...
...
@@ -23,7 +23,7 @@
%define src_2_6_29_version 1.57
Name: etercifs
Version: 4.3.
0
Version: 4.3.
1
Release: alt1
Summary: Advanced Common Internet File System for Linux with Etersoft extension
...
...
@@ -121,6 +121,10 @@ cp %SOURCE29 %buildroot/%etercifs_src/%src_package_name-2.6.29-%src_2_6_29_versi
%doc README.ETER AUTHORS CHANGES README TODO
%changelog
* Tue Mar 31 2009 Konstantin Baev <kipruss@altlinux.org> 4.3.1-alt1
- Remove oplock part of Etersoft patches (sources < 2.6.27)
- use cifs_file_aio_read instead of generic_file_aio_read in all sources
* Mon Mar 30 2009 Konstantin Baev <kipruss@altlinux.org> 4.3.0-alt1
- add sources/2.6.29
- Fix bugs Eter#1185 and Eter#3660 (F_GETLK problem connected with wrong returning file_lock structure)
...
...
sources/2.6.16/cifsfs.c
View file @
e984f541
...
...
@@ -621,19 +621,20 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const char __user *buf,
return
written
;
}
static
ssize_t
cifs_file_read
(
struct
file
*
file
,
char
*
user
,
size_t
cnt
,
loff_t
*
pos
)
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
if
(
file
!=
NULL
&&
file
->
f_dentry
!=
NULL
&&
CIFS_I
(
file
->
f_dentry
->
d_inode
)
!=
NULL
)
{
int
retval
=
0
;
CIFS_I
(
file
->
f_dentry
->
d_inode
)
->
needForceInvalidate
=
1
;
retval
=
cifs_revalidate
(
file
->
f_dentry
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
}
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
return
do_sync_read
(
file
,
user
,
cnt
,
pos
);
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -722,13 +723,13 @@ struct inode_operations cifs_symlink_inode_ops = {
};
struct
file_operations
cifs_file_ops
=
{
.
read
=
cifs_file
_read
,
.
read
=
do_sync
_read
,
.
write
=
do_sync_write
,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
.
readv
=
generic_file_readv
,
.
writev
=
cifs_file_writev
,
#endif
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -1060,9 +1061,6 @@ static int cifs_oplock_thread(void *dummyarg)
to server still is disconnected since oplock
already released by the server in that case */
if
(
pTcon
->
tidStatus
!=
CifsNeedReconnect
)
{
/* PV: disable caching if oplock missed */
CIFS_I
(
inode
)
->
clientCanCacheRead
=
FALSE
;
CIFS_I
(
inode
)
->
clientCanCacheAll
=
FALSE
;
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
0
/* len */
,
0
/* offset */
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
...
...
sources/2.6.16/cifsglob.h
View file @
e984f541
...
...
@@ -363,7 +363,6 @@ struct cifsInodeInfo {
unsigned
clientCanCacheRead
:
1
;
/* read oplock */
unsigned
clientCanCacheAll
:
1
;
/* read and writebehind oplock */
unsigned
oplockPending
:
1
;
unsigned
needForceInvalidate
:
1
;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)
struct
inode
vfs_inode
;
#endif
...
...
sources/2.6.16/inode.c
View file @
e984f541
...
...
@@ -1273,7 +1273,7 @@ int cifs_revalidate(struct dentry *direntry)
direntry
->
d_inode
->
i_count
.
counter
,
direntry
,
direntry
->
d_time
,
jiffies
));
if
(
cifsInode
->
time
==
0
||
cifsInode
->
needForceInvalidate
)
{
if
(
cifsInode
->
time
==
0
)
{
/* was set to zero previously to force revalidate */
}
else
if
(
time_before
(
jiffies
,
cifsInode
->
time
+
HZ
)
&&
lookupCacheEnabled
)
{
...
...
@@ -1315,10 +1315,9 @@ int cifs_revalidate(struct dentry *direntry)
/* if not oplocked, we invalidate inode pages if mtime or file size
had changed on server */
if
(
!
cifsInode
->
needForceInvalidate
&&
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
)
)
{
cFYI
(
1
,
(
"***************************** cifs_revalidate - inode unchanged"
));
if
(
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
))
{
cFYI
(
1
,
(
"cifs_revalidate - inode unchanged"
));
}
else
{
/* file may have changed on server */
if
(
cifsInode
->
clientCanCacheRead
)
{
...
...
@@ -1348,12 +1347,8 @@ 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
);
if
(
cifsInode
->
needForceInvalidate
)
{
cFYI
(
1
,
(
"Force invalidating."
));
invalidate_remote_inode
(
direntry
->
d_inode
);
cifsInode
->
needForceInvalidate
=
0
;
/* may eventually have to do this for open files too */
}
else
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
/* changed on server - flush read ahead pages */
cFYI
(
1
,
(
"Invalidating read ahead data on "
"closed file"
));
...
...
sources/2.6.23/cifsfs.c
View file @
e984f541
...
...
@@ -536,19 +536,20 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return
written
;
}
static
ssize_t
cifs_file_read
(
struct
file
*
file
,
char
*
user
,
size_t
cnt
,
loff_t
*
pos
)
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
if
(
file
!=
NULL
&&
file
->
f_dentry
!=
NULL
&&
CIFS_I
(
file
->
f_dentry
->
d_inode
)
!=
NULL
)
{
int
retval
=
0
;
CIFS_I
(
file
->
f_dentry
->
d_inode
)
->
needForceInvalidate
=
1
;
retval
=
cifs_revalidate
(
file
->
f_dentry
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
}
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
return
do_sync_read
(
file
,
user
,
cnt
,
pos
);
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -627,9 +628,9 @@ const struct inode_operations cifs_symlink_inode_ops = {
};
const
struct
file_operations
cifs_file_ops
=
{
.
read
=
cifs_file
_read
,
.
read
=
do_sync
_read
,
.
write
=
do_sync_write
,
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -917,10 +918,6 @@ static int cifs_oplock_thread(void *dummyarg)
to server still is disconnected since oplock
already released by the server in that case */
if
(
pTcon
->
tidStatus
!=
CifsNeedReconnect
)
{
/* PV: disable caching if oplock missed */
CIFS_I
(
inode
)
->
clientCanCacheRead
=
false
;
CIFS_I
(
inode
)
->
clientCanCacheAll
=
false
;
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
0
/* len */
,
0
/* offset */
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
...
...
sources/2.6.23/cifsglob.h
View file @
e984f541
...
...
@@ -350,7 +350,6 @@ struct cifsInodeInfo {
unsigned
clientCanCacheRead
:
1
;
/* read oplock */
unsigned
clientCanCacheAll
:
1
;
/* read and writebehind oplock */
unsigned
oplockPending
:
1
;
unsigned
needForceInvalidate
:
1
;
struct
inode
vfs_inode
;
};
...
...
sources/2.6.23/inode.c
View file @
e984f541
...
...
@@ -1242,7 +1242,7 @@ int cifs_revalidate(struct dentry *direntry)
direntry
->
d_inode
->
i_count
.
counter
,
direntry
,
direntry
->
d_time
,
jiffies
));
if
(
cifsInode
->
time
==
0
||
cifsInode
->
needForceInvalidate
)
{
if
(
cifsInode
->
time
==
0
)
{
/* was set to zero previously to force revalidate */
}
else
if
(
time_before
(
jiffies
,
cifsInode
->
time
+
HZ
)
&&
lookupCacheEnabled
)
{
...
...
@@ -1284,10 +1284,9 @@ int cifs_revalidate(struct dentry *direntry)
/* if not oplocked, we invalidate inode pages if mtime or file size
had changed on server */
if
(
!
cifsInode
->
needForceInvalidate
&&
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
)
)
{
cFYI
(
1
,
(
"***************************** cifs_revalidate - inode unchanged"
));
if
(
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
))
{
cFYI
(
1
,
(
"cifs_revalidate - inode unchanged"
));
}
else
{
/* file may have changed on server */
if
(
cifsInode
->
clientCanCacheRead
)
{
...
...
@@ -1317,13 +1316,8 @@ 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
);
if
(
cifsInode
->
needForceInvalidate
)
{
cFYI
(
1
,
(
"Force invalidating."
));
invalidate_remote_inode
(
direntry
->
d_inode
);
cifsInode
->
needForceInvalidate
=
0
;
/* may eventually have to do this for open files too */
}
else
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
/* changed on server - flush read ahead pages */
cFYI
(
1
,
(
"Invalidating read ahead data on "
"closed file"
));
...
...
sources/2.6.24/cifsfs.c
View file @
e984f541
...
...
@@ -535,19 +535,20 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return
written
;
}
static
ssize_t
cifs_file_read
(
struct
file
*
file
,
char
*
user
,
size_t
cnt
,
loff_t
*
pos
)
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
if
(
file
!=
NULL
&&
file
->
f_dentry
!=
NULL
&&
CIFS_I
(
file
->
f_dentry
->
d_inode
)
!=
NULL
)
{
int
retval
=
0
;
CIFS_I
(
file
->
f_dentry
->
d_inode
)
->
needForceInvalidate
=
1
;
retval
=
cifs_revalidate
(
file
->
f_dentry
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
}
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
return
do_sync_read
(
file
,
user
,
cnt
,
pos
);
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -626,9 +627,9 @@ const struct inode_operations cifs_symlink_inode_ops = {
};
const
struct
file_operations
cifs_file_ops
=
{
.
read
=
cifs_file
_read
,
.
read
=
do_sync
_read
,
.
write
=
do_sync_write
,
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -919,10 +920,6 @@ static int cifs_oplock_thread(void *dummyarg)
to server still is disconnected since oplock
already released by the server in that case */
if
(
pTcon
->
tidStatus
!=
CifsNeedReconnect
)
{
/* PV: disable caching if oplock missed */
CIFS_I
(
inode
)
->
clientCanCacheRead
=
false
;
CIFS_I
(
inode
)
->
clientCanCacheAll
=
false
;
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
0
/* len */
,
0
/* offset */
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
...
...
sources/2.6.24/cifsglob.h
View file @
e984f541
...
...
@@ -367,7 +367,6 @@ struct cifsInodeInfo {
unsigned
clientCanCacheRead
:
1
;
/* read oplock */
unsigned
clientCanCacheAll
:
1
;
/* read and writebehind oplock */
unsigned
oplockPending
:
1
;
unsigned
needForceInvalidate
:
1
;
struct
inode
vfs_inode
;
};
...
...
sources/2.6.24/inode.c
View file @
e984f541
...
...
@@ -1269,7 +1269,7 @@ int cifs_revalidate(struct dentry *direntry)
direntry
->
d_inode
->
i_count
.
counter
,
direntry
,
direntry
->
d_time
,
jiffies
));
if
(
cifsInode
->
time
==
0
||
cifsInode
->
needForceInvalidate
)
{
if
(
cifsInode
->
time
==
0
)
{
/* was set to zero previously to force revalidate */
}
else
if
(
time_before
(
jiffies
,
cifsInode
->
time
+
HZ
)
&&
lookupCacheEnabled
)
{
...
...
@@ -1311,10 +1311,9 @@ int cifs_revalidate(struct dentry *direntry)
/* if not oplocked, we invalidate inode pages if mtime or file size
had changed on server */
if
(
!
cifsInode
->
needForceInvalidate
&&
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
)
)
{
cFYI
(
1
,
(
"***************************** cifs_revalidate - inode unchanged"
));
if
(
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
))
{
cFYI
(
1
,
(
"cifs_revalidate - inode unchanged"
));
}
else
{
/* file may have changed on server */
if
(
cifsInode
->
clientCanCacheRead
)
{
...
...
@@ -1346,15 +1345,10 @@ int cifs_revalidate(struct dentry *direntry)
if
(
S_ISREG
(
direntry
->
d_inode
->
i_mode
))
{
if
(
direntry
->
d_inode
->
i_mapping
)
wbrc
=
filemap_fdatawait
(
direntry
->
d_inode
->
i_mapping
);
if
(
cifsInode
->
needForceInvalidate
)
{
cFYI
(
1
,
(
"Force invalidating."
));
invalidate_remote_inode
(
direntry
->
d_inode
);
cifsInode
->
needForceInvalidate
=
0
;
if
(
wbrc
)
CIFS_I
(
direntry
->
d_inode
)
->
write_behind_rc
=
wbrc
;
/* may eventually have to do this for open files too */
}
else
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
/* changed on server - flush read ahead pages */
cFYI
(
1
,
(
"Invalidating read ahead data on "
"closed file"
));
...
...
sources/2.6.25/cifsfs.c
View file @
e984f541
...
...
@@ -573,19 +573,20 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return
written
;
}
static
ssize_t
cifs_file_read
(
struct
file
*
file
,
char
*
user
,
size_t
cnt
,
loff_t
*
pos
)
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
if
(
file
!=
NULL
&&
file
->
f_dentry
!=
NULL
&&
CIFS_I
(
file
->
f_dentry
->
d_inode
)
!=
NULL
)
{
int
retval
=
0
;
CIFS_I
(
file
->
f_dentry
->
d_inode
)
->
needForceInvalidate
=
1
;
retval
=
cifs_revalidate
(
file
->
f_dentry
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
}
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
return
do_sync_read
(
file
,
user
,
cnt
,
pos
);
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -664,9 +665,9 @@ const struct inode_operations cifs_symlink_inode_ops = {
};
const
struct
file_operations
cifs_file_ops
=
{
.
read
=
cifs_file
_read
,
.
read
=
do_sync
_read
,
.
write
=
do_sync_write
,
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -957,10 +958,6 @@ static int cifs_oplock_thread(void *dummyarg)
to server still is disconnected since oplock
already released by the server in that case */
if
(
pTcon
->
tidStatus
!=
CifsNeedReconnect
)
{
/* PV: disable caching if oplock missed */
CIFS_I
(
inode
)
->
clientCanCacheRead
=
false
;
CIFS_I
(
inode
)
->
clientCanCacheAll
=
false
;
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
0
/* len */
,
0
/* offset */
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
...
...
sources/2.6.25/cifsglob.h
View file @
e984f541
...
...
@@ -360,7 +360,6 @@ struct cifsInodeInfo {
unsigned
clientCanCacheRead
:
1
;
/* read oplock */
unsigned
clientCanCacheAll
:
1
;
/* read and writebehind oplock */
unsigned
oplockPending
:
1
;
unsigned
needForceInvalidate
:
1
;
struct
inode
vfs_inode
;
};
...
...
sources/2.6.25/inode.c
View file @
e984f541
...
...
@@ -1217,7 +1217,7 @@ int cifs_revalidate(struct dentry *direntry)
direntry
->
d_inode
->
i_count
.
counter
,
direntry
,
direntry
->
d_time
,
jiffies
));
if
(
cifsInode
->
time
==
0
||
cifsInode
->
needForceInvalidate
)
{
if
(
cifsInode
->
time
==
0
)
{
/* was set to zero previously to force revalidate */
}
else
if
(
time_before
(
jiffies
,
cifsInode
->
time
+
HZ
)
&&
lookupCacheEnabled
)
{
...
...
@@ -1259,10 +1259,9 @@ int cifs_revalidate(struct dentry *direntry)
/* if not oplocked, we invalidate inode pages if mtime or file size
had changed on server */
if
(
!
cifsInode
->
needForceInvalidate
&&
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
)
)
{
cFYI
(
1
,
(
"************** cifs_revalidate - inode unchanged"
));
if
(
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
))
{
cFYI
(
1
,
(
"cifs_revalidate - inode unchanged"
));
}
else
{
/* file may have changed on server */
if
(
cifsInode
->
clientCanCacheRead
)
{
...
...
@@ -1294,15 +1293,10 @@ int cifs_revalidate(struct dentry *direntry)
if
(
S_ISREG
(
direntry
->
d_inode
->
i_mode
))
{
if
(
direntry
->
d_inode
->
i_mapping
)
wbrc
=
filemap_fdatawait
(
direntry
->
d_inode
->
i_mapping
);
if
(
cifsInode
->
needForceInvalidate
)
{
cFYI
(
1
,
(
"Force invalidating."
));
invalidate_remote_inode
(
direntry
->
d_inode
);
cifsInode
->
needForceInvalidate
=
0
;
if
(
wbrc
)
CIFS_I
(
direntry
->
d_inode
)
->
write_behind_rc
=
wbrc
;
/* may eventually have to do this for open files too */
}
else
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
/* changed on server - flush read ahead pages */
cFYI
(
1
,
(
"Invalidating read ahead data on "
"closed file"
));
...
...
sources/2.6.26/cifsfs.c
View file @
e984f541
...
...
@@ -600,19 +600,20 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return
written
;
}
static
ssize_t
cifs_file_read
(
struct
file
*
file
,
char
*
user
,
size_t
cnt
,
loff_t
*
pos
)
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
if
(
file
!=
NULL
&&
file
->
f_dentry
!=
NULL
&&
CIFS_I
(
file
->
f_dentry
->
d_inode
)
!=
NULL
)
{
int
retval
=
0
;
CIFS_I
(
file
->
f_dentry
->
d_inode
)
->
needForceInvalidate
=
1
;
retval
=
cifs_revalidate
(
file
->
f_dentry
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
}
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
return
do_sync_read
(
file
,
user
,
cnt
,
pos
);
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -691,9 +692,9 @@ const struct inode_operations cifs_symlink_inode_ops = {
};
const
struct
file_operations
cifs_file_ops
=
{
.
read
=
cifs_file
_read
,
.
read
=
do_sync
_read
,
.
write
=
do_sync_write
,
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -984,10 +985,6 @@ static int cifs_oplock_thread(void *dummyarg)
to server still is disconnected since oplock
already released by the server in that case */
if
(
pTcon
->
tidStatus
!=
CifsNeedReconnect
)
{
/* PV: disable caching if oplock missed */
CIFS_I
(
inode
)
->
clientCanCacheRead
=
false
;
CIFS_I
(
inode
)
->
clientCanCacheAll
=
false
;
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
0
/* len */
,
0
/* offset */
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
...
...
sources/2.6.26/cifsglob.h
View file @
e984f541
...
...
@@ -352,7 +352,6 @@ struct cifsInodeInfo {
bool
clientCanCacheRead
:
1
;
/* read oplock */
bool
clientCanCacheAll
:
1
;
/* read and writebehind oplock */
bool
oplockPending
:
1
;
unsigned
needForceInvalidate
:
1
;
struct
inode
vfs_inode
;
};
...
...
sources/2.6.26/inode.c
View file @
e984f541
...
...
@@ -1237,7 +1237,7 @@ int cifs_revalidate(struct dentry *direntry)
direntry
->
d_inode
->
i_count
.
counter
,
direntry
,
direntry
->
d_time
,
jiffies
));
if
(
cifsInode
->
time
==
0
||
cifsInode
->
needForceInvalidate
)
{
if
(
cifsInode
->
time
==
0
)
{
/* was set to zero previously to force revalidate */
}
else
if
(
time_before
(
jiffies
,
cifsInode
->
time
+
HZ
)
&&
lookupCacheEnabled
)
{
...
...
@@ -1279,10 +1279,9 @@ int cifs_revalidate(struct dentry *direntry)
/* if not oplocked, we invalidate inode pages if mtime or file size
had changed on server */
if
(
!
cifsInode
->
needForceInvalidate
&&
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
)
)
{
cFYI
(
1
,
(
"************** cifs_revalidate - inode unchanged"
));
if
(
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
))
{
cFYI
(
1
,
(
"cifs_revalidate - inode unchanged"
));
}
else
{
/* file may have changed on server */
if
(
cifsInode
->
clientCanCacheRead
)
{
...
...
@@ -1314,15 +1313,10 @@ int cifs_revalidate(struct dentry *direntry)
if
(
S_ISREG
(
direntry
->
d_inode
->
i_mode
))
{
if
(
direntry
->
d_inode
->
i_mapping
)
wbrc
=
filemap_fdatawait
(
direntry
->
d_inode
->
i_mapping
);
if
(
cifsInode
->
needForceInvalidate
)
{
cFYI
(
1
,
(
"Force invalidating."
));
invalidate_remote_inode
(
direntry
->
d_inode
);
cifsInode
->
needForceInvalidate
=
0
;
if
(
wbrc
)
CIFS_I
(
direntry
->
d_inode
)
->
write_behind_rc
=
wbrc
;
/* may eventually have to do this for open files too */
}
else
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
/* changed on server - flush read ahead pages */
cFYI
(
1
,
(
"Invalidating read ahead data on "
"closed file"
));
...
...
sources/2.6.27/cifsfs.c
View file @
e984f541
...
...
@@ -601,6 +601,19 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return
written
;
}
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -681,7 +694,7 @@ const struct inode_operations cifs_symlink_inode_ops = {
const
struct
file_operations
cifs_file_ops
=
{
.
read
=
do_sync_read
,
.
write
=
do_sync_write
,
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
sources/2.6.28/cifsfs.c
View file @
e984f541
...
...
@@ -605,6 +605,20 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return
written
;
}
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -716,7 +730,7 @@ const struct inode_operations cifs_symlink_inode_ops = {
const
struct
file_operations
cifs_file_ops
=
{
.
read
=
do_sync_read
,
.
write
=
do_sync_write
,
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
sources/2.6.29/cifsfs.c
View file @
e984f541
...
...
@@ -622,6 +622,20 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
return
written
;
}
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -733,7 +747,7 @@ const struct inode_operations cifs_symlink_inode_ops = {
const
struct
file_operations
cifs_file_ops
=
{
.
read
=
do_sync_read
,
.
write
=
do_sync_write
,
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
sources/legacy/cifsfs.c
View file @
e984f541
...
...
@@ -629,19 +629,20 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const char __user *buf,
return
written
;
}
static
ssize_t
cifs_file_read
(
struct
file
*
file
,
char
*
user
,
size_t
cnt
,
loff_t
*
pos
)
static
ssize_t
cifs_file_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
{
if
(
file
!=
NULL
&&
file
->
f_dentry
!=
NULL
&&
CIFS_I
(
file
->
f_dentry
->
d_inode
)
!=
NULL
)
{
int
retval
=
0
;
CIFS_I
(
file
->
f_dentry
->
d_inode
)
->
needForceInvalidate
=
1
;
retval
=
cifs_revalidate
(
file
->
f_dentry
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
}
struct
inode
*
inode
=
iocb
->
ki_filp
->
f_path
.
dentry
->
d_inode
;
ssize_t
read
;
return
do_sync_read
(
file
,
user
,
cnt
,
pos
);
if
(
CIFS_I
(
inode
)
->
clientCanCacheRead
)
read
=
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
else
read
=
cifs_user_read
(
iocb
->
ki_filp
,
iov
->
iov_base
,
iov
->
iov_len
,
&
pos
);
return
read
;
}
static
loff_t
cifs_llseek
(
struct
file
*
file
,
loff_t
offset
,
int
origin
)
{
/* origin == SEEK_END => we must revalidate the cached file length */
...
...
@@ -730,13 +731,13 @@ const struct inode_operations cifs_symlink_inode_ops = {
};
const
struct
file_operations
cifs_file_ops
=
{
.
read
=
cifs_file
_read
,
.
read
=
do_sync
_read
,
.
write
=
do_sync_write
,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
.
readv
=
generic_file_readv
,
.
writev
=
cifs_file_writev
,
#endif
.
aio_read
=
generic
_file_aio_read
,
.
aio_read
=
cifs
_file_aio_read
,
.
aio_write
=
cifs_file_aio_write
,
.
open
=
cifs_open
,
.
release
=
cifs_close
,
...
...
@@ -1073,9 +1074,6 @@ static int cifs_oplock_thread(void *dummyarg)
to server still is disconnected since oplock
already released by the server in that case */
if
(
pTcon
->
tidStatus
!=
CifsNeedReconnect
)
{
/* PV: disable caching if oplock missed */
CIFS_I
(
inode
)
->
clientCanCacheRead
=
FALSE
;
CIFS_I
(
inode
)
->
clientCanCacheAll
=
FALSE
;
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
0
/* len */
,
0
/* offset */
,
0
,
...
...
sources/legacy/cifsglob.h
View file @
e984f541
...
...
@@ -363,7 +363,6 @@ struct cifsInodeInfo {
unsigned
clientCanCacheRead
:
1
;
/* read oplock */
unsigned
clientCanCacheAll
:
1
;
/* read and writebehind oplock */
unsigned
oplockPending
:
1
;
unsigned
needForceInvalidate
:
1
;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)
struct
inode
vfs_inode
;
#endif
...
...
sources/legacy/inode.c
View file @
e984f541
...
...
@@ -1271,7 +1271,7 @@ int cifs_revalidate(struct dentry *direntry)
direntry
->
d_inode
->
i_count
.
counter
,
direntry
,
direntry
->
d_time
,
jiffies
));
if
(
cifsInode
->
time
==
0
||
cifsInode
->
needForceInvalidate
)
{
if
(
cifsInode
->
time
==
0
)
{
/* was set to zero previously to force revalidate */
}
else
if
(
time_before
(
jiffies
,
cifsInode
->
time
+
HZ
)
&&
lookupCacheEnabled
)
{
...
...
@@ -1313,10 +1313,9 @@ int cifs_revalidate(struct dentry *direntry)
/* if not oplocked, we invalidate inode pages if mtime or file size
had changed on server */
if
(
!
cifsInode
->
needForceInvalidate
&&
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
)
)
{
cFYI
(
1
,
(
"***************************** cifs_revalidate - inode unchanged"
));
if
(
timespec_equal
(
&
local_mtime
,
&
direntry
->
d_inode
->
i_mtime
)
&&
(
local_size
==
direntry
->
d_inode
->
i_size
))
{
cFYI
(
1
,
(
"cifs_revalidate - inode unchanged"
));
}
else
{
/* file may have changed on server */
if
(
cifsInode
->
clientCanCacheRead
)
{
...
...
@@ -1346,12 +1345,8 @@ int cifs_revalidate(struct dentry *direntry)
if
(
direntry
->
d_inode
->
i_mapping
)
filemap_fdatawait
(
direntry
->
d_inode
->
i_mapping
);
if
(
cifsInode
->
needForceInvalidate
)
{
cFYI
(
1
,
(
"Force invalidating."
));
invalidate_remote_inode
(
direntry
->
d_inode
);
cifsInode
->
needForceInvalidate
=
0
;
/* may eventually have to do this for open files too */
}
else
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
if
(
list_empty
(
&
(
cifsInode
->
openFileList
)))
{
/* changed on server - flush read ahead pages */
cFYI
(
1
,
(
"Invalidating read ahead data on "
"closed file"
));
...
...
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