]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfs/file.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
[linux-2.6-omap-h63xx.git] / fs / nfs / file.c
index 8689b736fdd98cfa8b648f92e9922c52499a6fb3..579cf8a7d4a75177a0a04a3baf615c0aa1ac4494 100644 (file)
@@ -53,6 +53,7 @@ static int  nfs_fsync(struct file *, struct dentry *dentry, int datasync);
 static int nfs_check_flags(int flags);
 static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
+static int nfs_setlease(struct file *file, long arg, struct file_lock **fl);
 
 const struct file_operations nfs_file_operations = {
        .llseek         = nfs_file_llseek,
@@ -69,6 +70,7 @@ const struct file_operations nfs_file_operations = {
        .flock          = nfs_flock,
        .splice_read    = nfs_file_splice_read,
        .check_flags    = nfs_check_flags,
+       .setlease       = nfs_setlease,
 };
 
 const struct inode_operations nfs_file_inode_operations = {
@@ -314,7 +316,7 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset)
        if (offset != 0)
                return;
        /* Cancel any unstarted writes on this page */
-       nfs_wb_page_priority(page->mapping->host, page, FLUSH_INVALIDATE);
+       nfs_wb_page_cancel(page->mapping->host, page);
 }
 
 static int nfs_release_page(struct page *page, gfp_t gfp)
@@ -400,7 +402,9 @@ static int do_getlk(struct file *filp, int cmd, struct file_lock *fl)
 
        lock_kernel();
        /* Try local locking first */
-       if (posix_test_lock(filp, fl)) {
+       posix_test_lock(filp, fl);
+       if (fl->fl_type != F_UNLCK) {
+               /* found a conflict */
                goto out;
        }
 
@@ -558,3 +562,13 @@ static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl)
                return do_unlk(filp, cmd, fl);
        return do_setlk(filp, cmd, fl);
 }
+
+static int nfs_setlease(struct file *file, long arg, struct file_lock **fl)
+{
+       /*
+        * There is no protocol support for leases, so we have no way
+        * to implement them correctly in the face of opens by other
+        * clients.
+        */
+       return -EINVAL;
+}