]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/fcntl.c
Merge branch 'upstream' of git://git.infradead.org/~dedekind/ubi-2.6
[linux-2.6-omap-h63xx.git] / fs / fcntl.c
index 2bdaef35da5479a406aa1eb658eba498c145c4c7..3f22e9f4f691ae3cb44312921c0aaf3a6b382086 100644 (file)
@@ -77,10 +77,9 @@ repeat:
                start = files->next_fd;
 
        newfd = start;
-       if (start < fdt->max_fdset) {
+       if (start < fdt->max_fds)
                newfd = find_next_zero_bit(fdt->open_fds->fds_bits,
-                       fdt->max_fdset, start);
-       }
+                                          fdt->max_fds, start);
        
        error = -EMFILE;
        if (newfd >= current->signal->rlim[RLIMIT_NOFILE].rlim_cur)
@@ -216,7 +215,7 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
 
        /* O_NOATIME can only be set by the owner or superuser */
        if ((arg & O_NOATIME) && !(filp->f_flags & O_NOATIME))
-               if (current->fsuid != inode->i_uid && !capable(CAP_FOWNER))
+               if (!is_owner_or_cap(inode))
                        return -EPERM;
 
        /* required for strict SunOS emulation */