diff options
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r-- | fs/9p/vfs_inode.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index e5c45eed58a9..2270d06ccd56 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -59,7 +59,7 @@ static int unixmode2p9mode(struct v9fs_session_info *v9ses, int mode) | |||
59 | res = mode & 0777; | 59 | res = mode & 0777; |
60 | if (S_ISDIR(mode)) | 60 | if (S_ISDIR(mode)) |
61 | res |= P9_DMDIR; | 61 | res |= P9_DMDIR; |
62 | if (v9ses->extended) { | 62 | if (v9fs_extended(v9ses)) { |
63 | if (S_ISLNK(mode)) | 63 | if (S_ISLNK(mode)) |
64 | res |= P9_DMSYMLINK; | 64 | res |= P9_DMSYMLINK; |
65 | if (v9ses->nodev == 0) { | 65 | if (v9ses->nodev == 0) { |
@@ -99,21 +99,21 @@ static int p9mode2unixmode(struct v9fs_session_info *v9ses, int mode) | |||
99 | 99 | ||
100 | if ((mode & P9_DMDIR) == P9_DMDIR) | 100 | if ((mode & P9_DMDIR) == P9_DMDIR) |
101 | res |= S_IFDIR; | 101 | res |= S_IFDIR; |
102 | else if ((mode & P9_DMSYMLINK) && (v9ses->extended)) | 102 | else if ((mode & P9_DMSYMLINK) && (v9fs_extended(v9ses))) |
103 | res |= S_IFLNK; | 103 | res |= S_IFLNK; |
104 | else if ((mode & P9_DMSOCKET) && (v9ses->extended) | 104 | else if ((mode & P9_DMSOCKET) && (v9fs_extended(v9ses)) |
105 | && (v9ses->nodev == 0)) | 105 | && (v9ses->nodev == 0)) |
106 | res |= S_IFSOCK; | 106 | res |= S_IFSOCK; |
107 | else if ((mode & P9_DMNAMEDPIPE) && (v9ses->extended) | 107 | else if ((mode & P9_DMNAMEDPIPE) && (v9fs_extended(v9ses)) |
108 | && (v9ses->nodev == 0)) | 108 | && (v9ses->nodev == 0)) |
109 | res |= S_IFIFO; | 109 | res |= S_IFIFO; |
110 | else if ((mode & P9_DMDEVICE) && (v9ses->extended) | 110 | else if ((mode & P9_DMDEVICE) && (v9fs_extended(v9ses)) |
111 | && (v9ses->nodev == 0)) | 111 | && (v9ses->nodev == 0)) |
112 | res |= S_IFBLK; | 112 | res |= S_IFBLK; |
113 | else | 113 | else |
114 | res |= S_IFREG; | 114 | res |= S_IFREG; |
115 | 115 | ||
116 | if (v9ses->extended) { | 116 | if (v9fs_extended(v9ses)) { |
117 | if ((mode & P9_DMSETUID) == P9_DMSETUID) | 117 | if ((mode & P9_DMSETUID) == P9_DMSETUID) |
118 | res |= S_ISUID; | 118 | res |= S_ISUID; |
119 | 119 | ||
@@ -214,7 +214,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) | |||
214 | case S_IFBLK: | 214 | case S_IFBLK: |
215 | case S_IFCHR: | 215 | case S_IFCHR: |
216 | case S_IFSOCK: | 216 | case S_IFSOCK: |
217 | if(!v9ses->extended) { | 217 | if (!v9fs_extended(v9ses)) { |
218 | P9_DPRINTK(P9_DEBUG_ERROR, | 218 | P9_DPRINTK(P9_DEBUG_ERROR, |
219 | "special files without extended mode\n"); | 219 | "special files without extended mode\n"); |
220 | return ERR_PTR(-EINVAL); | 220 | return ERR_PTR(-EINVAL); |
@@ -227,7 +227,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) | |||
227 | inode->i_fop = &v9fs_file_operations; | 227 | inode->i_fop = &v9fs_file_operations; |
228 | break; | 228 | break; |
229 | case S_IFLNK: | 229 | case S_IFLNK: |
230 | if(!v9ses->extended) { | 230 | if (!v9fs_extended(v9ses)) { |
231 | P9_DPRINTK(P9_DEBUG_ERROR, | 231 | P9_DPRINTK(P9_DEBUG_ERROR, |
232 | "extended modes used w/o 9P2000.u\n"); | 232 | "extended modes used w/o 9P2000.u\n"); |
233 | return ERR_PTR(-EINVAL); | 233 | return ERR_PTR(-EINVAL); |
@@ -236,7 +236,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode) | |||
236 | break; | 236 | break; |
237 | case S_IFDIR: | 237 | case S_IFDIR: |
238 | inc_nlink(inode); | 238 | inc_nlink(inode); |
239 | if(v9ses->extended) | 239 | if (v9fs_extended(v9ses)) |
240 | inode->i_op = &v9fs_dir_inode_operations_ext; | 240 | inode->i_op = &v9fs_dir_inode_operations_ext; |
241 | else | 241 | else |
242 | inode->i_op = &v9fs_dir_inode_operations; | 242 | inode->i_op = &v9fs_dir_inode_operations; |
@@ -768,7 +768,7 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr) | |||
768 | if (iattr->ia_valid & ATTR_SIZE) | 768 | if (iattr->ia_valid & ATTR_SIZE) |
769 | wstat.length = iattr->ia_size; | 769 | wstat.length = iattr->ia_size; |
770 | 770 | ||
771 | if (v9ses->extended) { | 771 | if (v9fs_extended(v9ses)) { |
772 | if (iattr->ia_valid & ATTR_UID) | 772 | if (iattr->ia_valid & ATTR_UID) |
773 | wstat.n_uid = iattr->ia_uid; | 773 | wstat.n_uid = iattr->ia_uid; |
774 | 774 | ||
@@ -808,7 +808,7 @@ v9fs_stat2inode(struct p9_stat *stat, struct inode *inode, | |||
808 | inode->i_uid = v9ses->uid; | 808 | inode->i_uid = v9ses->uid; |
809 | inode->i_gid = v9ses->gid; | 809 | inode->i_gid = v9ses->gid; |
810 | 810 | ||
811 | if (v9ses->extended) { | 811 | if (v9fs_extended(v9ses)) { |
812 | inode->i_uid = stat->n_uid; | 812 | inode->i_uid = stat->n_uid; |
813 | inode->i_gid = stat->n_gid; | 813 | inode->i_gid = stat->n_gid; |
814 | } | 814 | } |
@@ -890,7 +890,7 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen) | |||
890 | if(IS_ERR(fid)) | 890 | if(IS_ERR(fid)) |
891 | return PTR_ERR(fid); | 891 | return PTR_ERR(fid); |
892 | 892 | ||
893 | if (!v9ses->extended) | 893 | if (!v9fs_extended(v9ses)) |
894 | return -EBADF; | 894 | return -EBADF; |
895 | 895 | ||
896 | st = p9_client_stat(fid); | 896 | st = p9_client_stat(fid); |
@@ -1011,7 +1011,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry, | |||
1011 | struct p9_fid *fid; | 1011 | struct p9_fid *fid; |
1012 | 1012 | ||
1013 | v9ses = v9fs_inode2v9ses(dir); | 1013 | v9ses = v9fs_inode2v9ses(dir); |
1014 | if (!v9ses->extended) { | 1014 | if (!v9fs_extended(v9ses)) { |
1015 | P9_DPRINTK(P9_DEBUG_ERROR, "not extended\n"); | 1015 | P9_DPRINTK(P9_DEBUG_ERROR, "not extended\n"); |
1016 | return -EPERM; | 1016 | return -EPERM; |
1017 | } | 1017 | } |