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
a9f29eae
Commit
a9f29eae
authored
Jan 15, 2010
by
Pavel Shilovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes
Add mmap for nobrl direct shares Fix bugs CentOS 5.{2,3} Code style fixes
parent
487d84ce
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
110 additions
and
23 deletions
+110
-23
cifsfs.c
sources/2.6.16/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.23/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.24/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.25/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.26/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.27/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.28/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.29/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.30/cifsfs.c
+2
-1
cifsfs.c
sources/2.6.31/cifsfs.c
+2
-1
cifsfs.c
sources/centos52/cifsfs.c
+30
-4
file.c
sources/centos52/file.c
+24
-2
cifsfs.c
sources/centos53/cifsfs.c
+30
-4
cifsfs.c
sources/centos54/cifsfs.c
+6
-3
No files found.
sources/2.6.16/cifsfs.c
View file @
a9f29eae
...
...
@@ -834,7 +834,7 @@ struct file_operations cifs_file_nobrl_ops = {
};
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -842,6 +842,7 @@ struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
.
sendfile
=
generic_file_sendfile
,
/* BB removeme BB */
#else
...
...
sources/2.6.23/cifsfs.c
View file @
a9f29eae
...
...
@@ -719,7 +719,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -727,6 +727,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
ioctl
=
cifs_ioctl
,
...
...
sources/2.6.24/cifsfs.c
View file @
a9f29eae
...
...
@@ -718,7 +718,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -726,6 +726,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
ioctl
=
cifs_ioctl
,
...
...
sources/2.6.25/cifsfs.c
View file @
a9f29eae
...
...
@@ -756,7 +756,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -764,6 +764,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
ioctl
=
cifs_ioctl
,
...
...
sources/2.6.26/cifsfs.c
View file @
a9f29eae
...
...
@@ -783,7 +783,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -791,6 +791,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
unlocked_ioctl
=
cifs_ioctl
,
...
...
sources/2.6.27/cifsfs.c
View file @
a9f29eae
...
...
@@ -784,7 +784,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -792,6 +792,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
unlocked_ioctl
=
cifs_ioctl
,
...
...
sources/2.6.28/cifsfs.c
View file @
a9f29eae
...
...
@@ -822,7 +822,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -830,6 +830,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
unlocked_ioctl
=
cifs_ioctl
,
...
...
sources/2.6.29/cifsfs.c
View file @
a9f29eae
...
...
@@ -836,7 +836,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -844,6 +844,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
unlocked_ioctl
=
cifs_ioctl
,
...
...
sources/2.6.30/cifsfs.c
View file @
a9f29eae
...
...
@@ -837,7 +837,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -845,6 +845,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
unlocked_ioctl
=
cifs_ioctl
,
...
...
sources/2.6.31/cifsfs.c
View file @
a9f29eae
...
...
@@ -849,7 +849,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -857,6 +857,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
.
splice_read
=
generic_file_splice_read
,
#ifdef CONFIG_CIFS_POSIX
.
unlocked_ioctl
=
cifs_ioctl
,
...
...
sources/centos52/cifsfs.c
View file @
a9f29eae
...
...
@@ -594,14 +594,15 @@ 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
)
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
;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
cifs_sb
=
CIFS_SB
(
filp
->
f_path
.
dentry
->
d_sb
);
tcon
=
cifs_sb
->
tcon
;
if
((
tcon
->
ses
->
capabilities
&
CAP_UNIX
)
&&
...
...
@@ -621,7 +622,31 @@ static ssize_t cifs_sync_read(struct file *filp, char __user *buf, size_t len, l
if
(
cifsInode
==
NULL
)
return
-
ENOENT
;
if
(
!
CIFS_I
(
filp
->
f_path
.
dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
if
(
!
CIFS_I
(
filp
->
f_path
.
dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
#else
cifs_sb
=
CIFS_SB
(
filp
->
f_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_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_dentry
->
d_inode
);
if
(
cifsInode
==
NULL
)
return
-
ENOENT
;
if
(
!
CIFS_I
(
filp
->
f_dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
#endif
retval
=
cifs_lock
(
filp
,
F_GETLK
,
&
pfLock
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
...
...
@@ -842,7 +867,7 @@ const struct file_operations cifs_file_nobrl_ops = {
};
const
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -850,6 +875,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
.
sendfile
=
generic_file_sendfile
,
/* BB removeme BB */
#else
...
...
sources/centos52/file.c
View file @
a9f29eae
...
...
@@ -856,8 +856,30 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
}
else
{
/* if rc == ERR_SHARING_VIOLATION ? */
rc
=
0
;
/* do not change lock type to unlock
since range in use */
rc
=
0
;
if
(
lockType
&
LOCKING_ANDX_SHARED_LOCK
)
{
pfLock
->
fl_type
=
F_WRLCK
;
}
else
{
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
0
,
1
,
lockType
|
LOCKING_ANDX_SHARED_LOCK
,
0
/* wait flag */
);
if
(
rc
==
0
)
{
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
1
,
0
,
lockType
|
LOCKING_ANDX_SHARED_LOCK
,
0
/* wait flag */
);
pfLock
->
fl_type
=
F_RDLCK
;
if
(
rc
!=
0
)
cERROR
(
1
,
(
"Error unlocking "
"previously locked range %d "
"during test of lock"
,
rc
));
}
else
pfLock
->
fl_type
=
F_WRLCK
;
rc
=
0
;
}
}
FreeXid
(
xid
);
...
...
sources/centos53/cifsfs.c
View file @
a9f29eae
...
...
@@ -670,14 +670,15 @@ 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
)
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
;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
cifs_sb
=
CIFS_SB
(
filp
->
f_path
.
dentry
->
d_sb
);
tcon
=
cifs_sb
->
tcon
;
if
((
tcon
->
ses
->
capabilities
&
CAP_UNIX
)
&&
...
...
@@ -697,7 +698,31 @@ static ssize_t cifs_sync_read(struct file *filp, char __user *buf, size_t len, l
if
(
cifsInode
==
NULL
)
return
-
ENOENT
;
if
(
!
CIFS_I
(
filp
->
f_path
.
dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
if
(
!
CIFS_I
(
filp
->
f_path
.
dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
#else
cifs_sb
=
CIFS_SB
(
filp
->
f_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_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_dentry
->
d_inode
);
if
(
cifsInode
==
NULL
)
return
-
ENOENT
;
if
(
!
CIFS_I
(
filp
->
f_dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
#endif
retval
=
cifs_lock
(
filp
,
F_GETLK
,
&
pfLock
);
if
(
retval
<
0
)
return
(
ssize_t
)
retval
;
...
...
@@ -940,7 +965,7 @@ struct file_operations cifs_file_nobrl_ops = {
const
#endif
struct
file_operations
cifs_file_direct_nobrl_ops
=
{
/* no
mmap, no
aio, no readv -
/* no aio, no readv -
BB reevaluate whether they can be done with directio, no cache */
.
read
=
cifs_user_read
,
.
write
=
cifs_user_write
,
...
...
@@ -948,6 +973,7 @@ struct file_operations cifs_file_direct_nobrl_ops = {
.
release
=
cifs_close
,
.
fsync
=
cifs_fsync
,
.
flush
=
cifs_flush
,
.
mmap
=
cifs_file_mmap
,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
.
sendfile
=
generic_file_sendfile
,
/* BB removeme BB */
#else
...
...
sources/centos54/cifsfs.c
View file @
a9f29eae
...
...
@@ -687,7 +687,8 @@ 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
)
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
;
...
...
@@ -714,7 +715,8 @@ static ssize_t cifs_sync_read(struct file *filp, char __user *buf, size_t len, l
if
(
cifsInode
==
NULL
)
return
-
ENOENT
;
if
(
!
CIFS_I
(
filp
->
f_path
.
dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
if
(
!
CIFS_I
(
filp
->
f_path
.
dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
#else
cifs_sb
=
CIFS_SB
(
filp
->
f_dentry
->
d_sb
);
tcon
=
cifs_sb
->
tcon
;
...
...
@@ -735,7 +737,8 @@ static ssize_t cifs_sync_read(struct file *filp, char __user *buf, size_t len, l
if
(
cifsInode
==
NULL
)
return
-
ENOENT
;
if
(
!
CIFS_I
(
filp
->
f_dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
if
(
!
CIFS_I
(
filp
->
f_dentry
->
d_inode
)
->
clientCanCacheRead
&&
!
posix_locking
)
{
#endif
retval
=
cifs_lock
(
filp
,
F_GETLK
,
&
pfLock
);
if
(
retval
<
0
)
...
...
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