drop unused dentry argument to ->fsync
[safe/jmp/linux-2.6] / fs / ncpfs / file.c
index 4947d9b..3639cc5 100644 (file)
 #include <linux/fcntl.h>
 #include <linux/stat.h>
 #include <linux/mm.h>
-#include <linux/slab.h>
 #include <linux/vmalloc.h>
+#include <linux/sched.h>
 #include <linux/smp_lock.h>
 
 #include <linux/ncp_fs.h>
 #include "ncplib_kernel.h"
 
-static int ncp_fsync(struct file *file, struct dentry *dentry, int datasync)
+static int ncp_fsync(struct file *file, int datasync)
 {
        return 0;
 }
@@ -46,7 +46,7 @@ int ncp_make_open(struct inode *inode, int right)
                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;
@@ -93,7 +93,7 @@ int ncp_make_open(struct inode *inode, int right)
        }
 
 out_unlock:
-       up(&NCP_FINFO(inode)->open_sem);
+       mutex_unlock(&NCP_FINFO(inode)->open_mutex);
 out:
        return error;
 }
@@ -101,7 +101,7 @@ out:
 static ssize_t
 ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
-       struct dentry *dentry = file->f_dentry;
+       struct dentry *dentry = file->f_path.dentry;
        struct inode *inode = dentry->d_inode;
        size_t already_read = 0;
        off_t pos;
@@ -182,7 +182,7 @@ outrel:
 static ssize_t
 ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-       struct dentry *dentry = file->f_dentry;
+       struct dentry *dentry = file->f_path.dentry;
        struct inode *inode = dentry->d_inode;
        size_t already_written = 0;
        off_t pos;
@@ -203,7 +203,6 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
 
        if (pos + count > MAX_NON_LFS && !(file->f_flags&O_LARGEFILE)) {
                if (pos >= MAX_NON_LFS) {
-                       send_sig(SIGXFSZ, current, 0);
                        return -EFBIG;
                }
                if (count > MAX_NON_LFS - (u32)pos) {
@@ -212,7 +211,6 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
        }
        if (pos >= inode->i_sb->s_maxbytes) {
                if (count || pos > inode->i_sb->s_maxbytes) {
-                       send_sig(SIGXFSZ, current, 0);
                        return -EFBIG;
                }
        }
@@ -262,7 +260,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
        }
        vfree(bouncebuffer);
 
-       inode_update_time(inode, 1);
+       file_update_time(file);
 
        *ppos = pos;
 
@@ -283,18 +281,30 @@ static int ncp_release(struct inode *inode, struct file *file) {
        return 0;
 }
 
-struct file_operations ncp_file_operations =
+static loff_t ncp_remote_llseek(struct file *file, loff_t offset, int origin)
 {
-       .llseek         = remote_llseek,
+       loff_t ret;
+       lock_kernel();
+       ret = generic_file_llseek_unlocked(file, offset, origin);
+       unlock_kernel();
+       return ret;
+}
+
+const struct file_operations ncp_file_operations =
+{
+       .llseek         = ncp_remote_llseek,
        .read           = ncp_file_read,
        .write          = ncp_file_write,
-       .ioctl          = ncp_ioctl,
+       .unlocked_ioctl = ncp_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = ncp_compat_ioctl,
+#endif
        .mmap           = ncp_mmap,
        .release        = ncp_release,
        .fsync          = ncp_fsync,
 };
 
-struct inode_operations ncp_file_inode_operations =
+const struct inode_operations ncp_file_inode_operations =
 {
        .setattr        = ncp_notify_change,
 };