]> Pileus Git - ~andy/linux/blobdiff - fs/file_table.c
powerpc/numa: Only use active VPHN count fields
[~andy/linux] / fs / file_table.c
index c3dee381f1b4ea588f2188a33b3237f8efc251df..eb36b6b17e26b0add06f7182bbaf2eeb4648bac8 100644 (file)
@@ -125,13 +125,13 @@ struct file *get_empty_filp(void)
                goto fail;
 
        percpu_counter_inc(&nr_files);
+       f->f_cred = get_cred(cred);
        if (security_file_alloc(f))
                goto fail_sec;
 
        INIT_LIST_HEAD(&f->f_u.fu_list);
        atomic_long_set(&f->f_count, 1);
        rwlock_init(&f->f_owner.lock);
-       f->f_cred = get_cred(cred);
        spin_lock_init(&f->f_lock);
        eventpoll_init_file(f);
        /* f->f_version: 0 */
@@ -311,7 +311,7 @@ struct file *fget_light(unsigned int fd, int *fput_needed)
        struct files_struct *files = current->files;
 
        *fput_needed = 0;
-       if (likely((atomic_read(&files->count) == 1))) {
+       if (atomic_read(&files->count) == 1) {
                file = fcheck_files(files, fd);
        } else {
                rcu_read_lock();