X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fioctl.c;h=992cdb7c248704ba854b2fc794ab0df5ee7a5281;hb=2e0f70f3da0ae7cc9d35fde21380e88c5d5bbb4f;hp=44f6e4cc44fe79326be39b229e30015960a8f894;hpb=3944158a6d33f94668dbd6bdc32ff5c67bb53ec2;p=linux-2.6.git diff --git a/fs/ioctl.c b/fs/ioctl.c index 44f6e4cc4..992cdb7c2 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include @@ -40,7 +40,7 @@ static long do_ioctl(struct file *filp, unsigned int cmd, goto out; } else if (filp->f_op->ioctl) { lock_kernel(); - error = filp->f_op->ioctl(filp->f_dentry->d_inode, + error = filp->f_op->ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg); unlock_kernel(); } @@ -54,7 +54,7 @@ static int file_ioctl(struct file *filp, unsigned int cmd, { int error; int block; - struct inode * inode = filp->f_dentry->d_inode; + struct inode * inode = filp->f_path.dentry->d_inode; int __user *p = (int __user *)arg; switch (cmd) { @@ -146,29 +146,29 @@ int vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, unsigned lon break; case FIOQSIZE: - if (S_ISDIR(filp->f_dentry->d_inode->i_mode) || - S_ISREG(filp->f_dentry->d_inode->i_mode) || - S_ISLNK(filp->f_dentry->d_inode->i_mode)) { - loff_t res = inode_get_bytes(filp->f_dentry->d_inode); + if (S_ISDIR(filp->f_path.dentry->d_inode->i_mode) || + S_ISREG(filp->f_path.dentry->d_inode->i_mode) || + S_ISLNK(filp->f_path.dentry->d_inode->i_mode)) { + loff_t res = inode_get_bytes(filp->f_path.dentry->d_inode); error = copy_to_user((loff_t __user *)arg, &res, sizeof(res)) ? -EFAULT : 0; } else error = -ENOTTY; break; #ifdef CONFIG_VSERVER_LEGACY -#ifndef CONFIG_INOXID_NONE - case FIOC_GETXID: { +#ifndef CONFIG_TAGGING_NONE + case FIOC_GETTAG: { struct inode *inode = filp->f_dentry->d_inode; /* fixme: if stealth, return -ENOTTY */ error = -EPERM; if (capable(CAP_CONTEXT)) - error = put_user(inode->i_xid, (int __user *) arg); + error = put_user(inode->i_tag, (int __user *) arg); break; } - case FIOC_SETXID: { + case FIOC_SETTAG: { struct inode *inode = filp->f_dentry->d_inode; - int xid; + int tag; /* fixme: if stealth, return -ENOTTY */ error = -EPERM; @@ -178,13 +178,13 @@ int vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, unsigned lon if (IS_RDONLY(inode)) break; error = -ENOSYS; - if (!(inode->i_sb->s_flags & MS_TAGXID)) + if (!(inode->i_sb->s_flags & MS_TAGGED)) break; error = -EFAULT; - if (get_user(xid, (int __user *) arg)) + if (get_user(tag, (int __user *) arg)) break; error = 0; - inode->i_xid = (xid & 0xFFFF); + inode->i_tag = (tag & 0xFFFF); inode->i_ctime = CURRENT_TIME; mark_inode_dirty(inode); break; @@ -197,24 +197,9 @@ int vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, unsigned lon error = vx_proc_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); break; #endif - /* - * These cmds needed for PLK - don't lose them! - */ - case FIOC_SETIATTR: - case FIOC_GETIATTR: - /* - * Verify that this filp is a file object, - * not (say) a socket. - */ - error = -ENOTTY; - if (S_ISREG(filp->f_dentry->d_inode->i_mode) || - S_ISDIR(filp->f_dentry->d_inode->i_mode)) - error = vc_iattr_ioctl(filp->f_dentry, - cmd, arg); - break; default: - if (S_ISREG(filp->f_dentry->d_inode->i_mode)) + if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) error = file_ioctl(filp, cmd, arg); else error = do_ioctl(filp, cmd, arg);