#include <linux/init.h>
#include <linux/idr.h>
#include <linux/namei.h>
-#include <linux/vs_base.h>
+#include <linux/bitops.h>
#include <linux/vserver/inode.h>
#include <asm/uaccess.h>
-#include <asm/bitops.h>
static ssize_t proc_file_read(struct file *file, char __user *buf,
size_t nbytes, loff_t *ppos);
return -ENOMEM;
while ((nbytes > 0) && !eof) {
- count = min_t(ssize_t, PROC_BLOCK_SIZE, nbytes);
+ count = min_t(size_t, PROC_BLOCK_SIZE, nbytes);
start = NULL;
if (dp->get_info) {
}
static DEFINE_IDR(proc_inum_idr);
-static spinlock_t proc_inum_lock = SPIN_LOCK_UNLOCKED; /* protects the above */
+static DEFINE_SPINLOCK(proc_inum_lock); /* protects the above */
#define PROC_DYNAMIC_FIRST 0xF0000000UL
return 1;
}
-static int proc_revalidate_dentry(struct dentry *de, struct nameidata *nd)
-{
- /* maybe add a check if it's really necessary? */
- return 0;
-}
-
static struct dentry_operations proc_dentry_operations =
{
- .d_revalidate = proc_revalidate_dentry,
.d_delete = proc_delete_dentry,
};
error = -EINVAL;
inode = proc_get_inode(dir->i_sb, ino, de);
- inode->i_xid = vx_current_xid();
+ /* generic proc entries belong to the host */
+ inode->i_xid = 0;
break;
}
}
if (!(*parent) && xlate_proc_name(name, parent, &fn) != 0)
goto out;
+
+ /* At this point there must not be any '/' characters beyond *fn */
+ if (strchr(fn, '/'))
+ goto out;
+
len = strlen(fn);
ent = kmalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL);