Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.25
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Apr 2008 18:00:05 +0000 (11:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Apr 2008 18:00:05 +0000 (11:00 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.25:
  sh: export empty_zero_page
  sh: arch/sh/kernel/traps_32.c needs asm/fpu.h
  sh: fix compressed kernel build
  sh64: add missing #include <asm/fpu.h>'s

fs/jffs2/file.c
fs/locks.c

index f9c5dd6f4b64fb77b12b83d7041e6416f2072f41..dcc2734e0b5d65479a34ba53a9bf7ea2f08ecbbf 100644 (file)
@@ -129,7 +129,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
        struct inode *inode = mapping->host;
        struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
        pgoff_t index = pos >> PAGE_CACHE_SHIFT;
-       uint32_t pageofs = pos & (PAGE_CACHE_SIZE - 1);
+       uint32_t pageofs = index << PAGE_CACHE_SHIFT;
        int ret = 0;
 
        pg = __grab_cache_page(mapping, index);
index d83fab1b77b56a4e065d6858440903ed6d70770e..43c0af21a0c5fb563ceb12073d085e5ed45e2ddf 100644 (file)
@@ -1801,17 +1801,21 @@ again:
        if (error)
                goto out;
 
-       for (;;) {
-               error = vfs_lock_file(filp, cmd, file_lock, NULL);
-               if (error != -EAGAIN || cmd == F_SETLK)
-                       break;
-               error = wait_event_interruptible(file_lock->fl_wait,
-                               !file_lock->fl_next);
-               if (!error)
-                       continue;
+       if (filp->f_op && filp->f_op->lock != NULL)
+               error = filp->f_op->lock(filp, cmd, file_lock);
+       else {
+               for (;;) {
+                       error = posix_lock_file(filp, file_lock, NULL);
+                       if (error != -EAGAIN || cmd == F_SETLK)
+                               break;
+                       error = wait_event_interruptible(file_lock->fl_wait,
+                                       !file_lock->fl_next);
+                       if (!error)
+                               continue;
 
-               locks_delete_block(file_lock);
-               break;
+                       locks_delete_block(file_lock);
+                       break;
+               }
        }
 
        /*
@@ -1925,17 +1929,21 @@ again:
        if (error)
                goto out;
 
-       for (;;) {
-               error = vfs_lock_file(filp, cmd, file_lock, NULL);
-               if (error != -EAGAIN || cmd == F_SETLK64)
-                       break;
-               error = wait_event_interruptible(file_lock->fl_wait,
-                               !file_lock->fl_next);
-               if (!error)
-                       continue;
+       if (filp->f_op && filp->f_op->lock != NULL)
+               error = filp->f_op->lock(filp, cmd, file_lock);
+       else {
+               for (;;) {
+                       error = posix_lock_file(filp, file_lock, NULL);
+                       if (error != -EAGAIN || cmd == F_SETLK64)
+                               break;
+                       error = wait_event_interruptible(file_lock->fl_wait,
+                                       !file_lock->fl_next);
+                       if (!error)
+                               continue;
 
-               locks_delete_block(file_lock);
-               break;
+                       locks_delete_block(file_lock);
+                       break;
+               }
        }
 
        /*