]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/locks.c
PCI: remove unused resource assignment in pci_read_bridge_bases()
[linux-2.6-omap-h63xx.git] / fs / locks.c
index 01490300f7cbd7f6257f38b9de6ff34b5ce6f78d..20457486d6b2a95e67783f220b89f8cb19e22d3e 100644 (file)
@@ -201,7 +201,7 @@ EXPORT_SYMBOL(locks_init_lock);
  * Initialises the fields of the file lock which are invariant for
  * free file_locks.
  */
-static void init_once(struct kmem_cache *cache, void *foo)
+static void init_once(void *foo)
 {
        struct file_lock *lock = (struct file_lock *) foo;
 
@@ -1580,7 +1580,8 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
        cmd &= ~LOCK_NB;
        unlock = (cmd == LOCK_UN);
 
-       if (!unlock && !(cmd & LOCK_MAND) && !(filp->f_mode & 3))
+       if (!unlock && !(cmd & LOCK_MAND) &&
+           !(filp->f_mode & (FMODE_READ|FMODE_WRITE)))
                goto out_putf;
 
        error = flock_make_lock(filp, &lock, cmd);