#include <linux/eventpoll.h>
#include <linux/mount.h>
#include <linux/cdev.h>
+#include <linux/vs_limit.h>
/* sysctl tunables... */
struct files_stat_struct files_stat = {
f->f_owner.lock = RW_LOCK_UNLOCKED;
/* f->f_version: 0 */
INIT_LIST_HEAD(&f->f_list);
+ vx_files_inc(f);
return f;
}
}
memset(filp, 0, sizeof(*filp));
eventpoll_init_file(filp);
filp->f_flags = flags;
- filp->f_mode = (flags+1) & O_ACCMODE;
+ filp->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
atomic_set(&filp->f_count, 1);
filp->f_dentry = dentry;
filp->f_mapping = dentry->d_inode->i_mapping;
fops_put(file->f_op);
if (file->f_mode & FMODE_WRITE)
put_write_access(inode);
+ vx_files_dec(file);
file_kill(file);
file->f_dentry = NULL;
file->f_vfsmnt = NULL;