Loading fs/9p/vfs_inode.c +56 −49 Original line number Diff line number Diff line Loading @@ -207,13 +207,18 @@ v9fs_blank_wstat(struct p9_wstat *wstat) struct inode *v9fs_get_inode(struct super_block *sb, int mode) { int err; struct inode *inode; struct v9fs_session_info *v9ses = sb->s_fs_info; P9_DPRINTK(P9_DEBUG_VFS, "super block: %p mode: %o\n", sb, mode); inode = new_inode(sb); if (inode) { if (!inode) { P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n"); return -ENOMEM; } inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); Loading @@ -230,10 +235,10 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) if (!v9fs_extended(v9ses)) { P9_DPRINTK(P9_DEBUG_ERROR, "special files without extended mode\n"); return ERR_PTR(-EINVAL); err = -EINVAL; goto error; } init_special_inode(inode, inode->i_mode, inode->i_rdev); init_special_inode(inode, inode->i_mode, inode->i_rdev); break; case S_IFREG: inode->i_op = &v9fs_file_inode_operations; Loading @@ -243,7 +248,8 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) if (!v9fs_extended(v9ses)) { P9_DPRINTK(P9_DEBUG_ERROR, "extended modes used w/o 9P2000.u\n"); return ERR_PTR(-EINVAL); err = -EINVAL; goto error; } inode->i_op = &v9fs_symlink_inode_operations; break; Loading @@ -256,16 +262,17 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) inode->i_fop = &v9fs_dir_operations; break; default: P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n", P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n", mode, mode & S_IFMT); return ERR_PTR(-EINVAL); } } else { P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n"); return ERR_PTR(-ENOMEM); err = -EINVAL; goto error; } return inode; error: iput(inode); return ERR_PTR(err); } /* Loading Loading
fs/9p/vfs_inode.c +56 −49 Original line number Diff line number Diff line Loading @@ -207,13 +207,18 @@ v9fs_blank_wstat(struct p9_wstat *wstat) struct inode *v9fs_get_inode(struct super_block *sb, int mode) { int err; struct inode *inode; struct v9fs_session_info *v9ses = sb->s_fs_info; P9_DPRINTK(P9_DEBUG_VFS, "super block: %p mode: %o\n", sb, mode); inode = new_inode(sb); if (inode) { if (!inode) { P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n"); return -ENOMEM; } inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); Loading @@ -230,10 +235,10 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) if (!v9fs_extended(v9ses)) { P9_DPRINTK(P9_DEBUG_ERROR, "special files without extended mode\n"); return ERR_PTR(-EINVAL); err = -EINVAL; goto error; } init_special_inode(inode, inode->i_mode, inode->i_rdev); init_special_inode(inode, inode->i_mode, inode->i_rdev); break; case S_IFREG: inode->i_op = &v9fs_file_inode_operations; Loading @@ -243,7 +248,8 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) if (!v9fs_extended(v9ses)) { P9_DPRINTK(P9_DEBUG_ERROR, "extended modes used w/o 9P2000.u\n"); return ERR_PTR(-EINVAL); err = -EINVAL; goto error; } inode->i_op = &v9fs_symlink_inode_operations; break; Loading @@ -256,16 +262,17 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) inode->i_fop = &v9fs_dir_operations; break; default: P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n", P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n", mode, mode & S_IFMT); return ERR_PTR(-EINVAL); } } else { P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n"); return ERR_PTR(-ENOMEM); err = -EINVAL; goto error; } return inode; error: iput(inode); return ERR_PTR(err); } /* Loading