ALSA: usb-audio: add UAC2 sepecific Feature Unit controls
[safe/jmp/linux-2.6] / fs / locks.c
index 19ee18a..ab24d49 100644 (file)
@@ -434,7 +434,7 @@ static int lease_mylease_callback(struct file_lock *fl, struct file_lock *try)
        return fl->fl_file == try->fl_file;
 }
 
-static struct lock_manager_operations lease_manager_ops = {
+static const struct lock_manager_operations lease_manager_ops = {
        .fl_break = lease_break_callback,
        .fl_release_private = lease_release_private_callback,
        .fl_mylease = lease_mylease_callback,
@@ -1182,8 +1182,9 @@ int __break_lease(struct inode *inode, unsigned int mode)
        struct file_lock *fl;
        unsigned long break_time;
        int i_have_this_lease = 0;
+       int want_write = (mode & O_ACCMODE) != O_RDONLY;
 
-       new_fl = lease_alloc(NULL, mode & FMODE_WRITE ? F_WRLCK : F_RDLCK);
+       new_fl = lease_alloc(NULL, want_write ? F_WRLCK : F_RDLCK);
 
        lock_kernel();
 
@@ -1197,7 +1198,7 @@ int __break_lease(struct inode *inode, unsigned int mode)
                if (fl->fl_owner == current->files)
                        i_have_this_lease = 1;
 
-       if (mode & FMODE_WRITE) {
+       if (want_write) {
                /* If we want write access, we have to revoke any lease. */
                future = F_UNLCK | F_INPROGRESS;
        } else if (flock->fl_type & F_INPROGRESS) {
@@ -1454,7 +1455,7 @@ EXPORT_SYMBOL(generic_setlease);
  *     leases held by processes on this node.
  *
  *     There is also no break_lease method; filesystems that
- *     handle their own leases shoud break leases themselves from the
+ *     handle their own leases should break leases themselves from the
  *     filesystem's open, create, and (on truncate) setattr methods.
  *
  *     Warning: the only current setlease methods exist only to disable