git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
fs
/
ncpfs
/
file.c
diff --git
a/fs/ncpfs/file.c
b/fs/ncpfs/file.c
index
c1745b6
..
e6b7c67
100644
(file)
--- a/
fs/ncpfs/file.c
+++ b/
fs/ncpfs/file.c
@@
-46,7
+46,7
@@
int ncp_make_open(struct inode *inode, int right)
NCP_FINFO(inode)->volNumber,
NCP_FINFO(inode)->dirEntNum);
error = -EACCES;
NCP_FINFO(inode)->volNumber,
NCP_FINFO(inode)->dirEntNum);
error = -EACCES;
-
down(&NCP_FINFO(inode)->open_sem
);
+
mutex_lock(&NCP_FINFO(inode)->open_mutex
);
if (!atomic_read(&NCP_FINFO(inode)->opened)) {
struct ncp_entry_info finfo;
int result;
if (!atomic_read(&NCP_FINFO(inode)->opened)) {
struct ncp_entry_info finfo;
int result;
@@
-93,7
+93,7
@@
int ncp_make_open(struct inode *inode, int right)
}
out_unlock:
}
out_unlock:
-
up(&NCP_FINFO(inode)->open_sem
);
+
mutex_unlock(&NCP_FINFO(inode)->open_mutex
);
out:
return error;
}
out:
return error;
}
@@
-115,11
+115,6
@@
ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
if (!ncp_conn_valid(NCP_SERVER(inode)))
return -EIO;
if (!ncp_conn_valid(NCP_SERVER(inode)))
return -EIO;
- if (!S_ISREG(inode->i_mode)) {
- DPRINTK("ncp_file_read: read from non-file, mode %07o\n",
- inode->i_mode);
- return -EINVAL;
- }
pos = *ppos;
pos = *ppos;
@@
-175,10
+170,8
@@
ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
*ppos = pos;
*ppos = pos;
- if (!IS_RDONLY(inode)) {
- inode->i_atime = CURRENT_TIME;
- }
-
+ file_accessed(file);
+
DPRINTK("ncp_file_read: exit %s/%s\n",
dentry->d_parent->d_name.name, dentry->d_name.name);
outrel:
DPRINTK("ncp_file_read: exit %s/%s\n",
dentry->d_parent->d_name.name, dentry->d_name.name);
outrel:
@@
-201,11
+194,6
@@
ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
dentry->d_parent->d_name.name, dentry->d_name.name);
if (!ncp_conn_valid(NCP_SERVER(inode)))
return -EIO;
dentry->d_parent->d_name.name, dentry->d_name.name);
if (!ncp_conn_valid(NCP_SERVER(inode)))
return -EIO;
- if (!S_ISREG(inode->i_mode)) {
- DPRINTK("ncp_file_write: write to non-file, mode %07o\n",
- inode->i_mode);
- return -EINVAL;
- }
if ((ssize_t) count < 0)
return -EINVAL;
pos = *ppos;
if ((ssize_t) count < 0)
return -EINVAL;
pos = *ppos;
@@
-273,8
+261,9
@@
ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
}
}
vfree(bouncebuffer);
}
}
vfree(bouncebuffer);
- inode->i_mtime = inode->i_atime = CURRENT_TIME;
-
+
+ file_update_time(file);
+
*ppos = pos;
if (pos > inode->i_size) {
*ppos = pos;
if (pos > inode->i_size) {
@@
-294,7
+283,7
@@
static int ncp_release(struct inode *inode, struct file *file) {
return 0;
}
return 0;
}
-struct file_operations ncp_file_operations =
+
const
struct file_operations ncp_file_operations =
{
.llseek = remote_llseek,
.read = ncp_file_read,
{
.llseek = remote_llseek,
.read = ncp_file_read,