vserver 1.9.5.x5
[linux-2.6.git] / fs / file_table.c
index 9d71ae0..031f3cb 100644 (file)
@@ -26,12 +26,10 @@ struct files_stat_struct files_stat = {
 
 EXPORT_SYMBOL(files_stat); /* Needed by unix.o */
 
-/* public *and* exported. Not pretty! */
-spinlock_t __cacheline_aligned_in_smp files_lock = SPIN_LOCK_UNLOCKED;
+/* public. Not pretty! */
+ __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock);
 
-EXPORT_SYMBOL(files_lock);
-
-static spinlock_t filp_count_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(filp_count_lock);
 
 /* slab constructors and destructors are called from arbitrary
  * context and must be fully threaded - use a local spinlock
@@ -86,12 +84,13 @@ static int old_max;
                        atomic_set(&f->f_count, 1);
                        f->f_uid = current->fsuid;
                        f->f_gid = current->fsgid;
-                       f->f_owner.lock = RW_LOCK_UNLOCKED;
+                       rwlock_init(&f->f_owner.lock);
                        /* f->f_version: 0 */
                        INIT_LIST_HEAD(&f->f_list);
                        // set_vx_info(&f->f_vx_info, current->vx_info);
-                       f->f_xid = current->xid;
+                       f->f_xid = vx_current_xid();
                        vx_files_inc(f);
+                       f->f_maxcount = INT_MAX;
                        return f;
                }
        }
@@ -208,8 +207,6 @@ void put_filp(struct file *file)
        }
 }
 
-EXPORT_SYMBOL(put_filp);
-
 void file_move(struct file *file, struct list_head *list)
 {
        if (!list)