diff options
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r-- | fs/9p/vfs_inode.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index e5c45eed58a9..175b4d9bf3f8 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; |
@@ -364,7 +364,7 @@ static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir) | |||
364 | file_inode = file->d_inode; | 364 | file_inode = file->d_inode; |
365 | v9ses = v9fs_inode2v9ses(file_inode); | 365 | v9ses = v9fs_inode2v9ses(file_inode); |
366 | v9fid = v9fs_fid_clone(file); | 366 | v9fid = v9fs_fid_clone(file); |
367 | if(IS_ERR(v9fid)) | 367 | if (IS_ERR(v9fid)) |
368 | return PTR_ERR(v9fid); | 368 | return PTR_ERR(v9fid); |
369 | 369 | ||
370 | return p9_client_remove(v9fid); | 370 | return p9_client_remove(v9fid); |
@@ -398,7 +398,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, | |||
398 | fid = NULL; | 398 | fid = NULL; |
399 | name = (char *) dentry->d_name.name; | 399 | name = (char *) dentry->d_name.name; |
400 | dfid = v9fs_fid_clone(dentry->d_parent); | 400 | dfid = v9fs_fid_clone(dentry->d_parent); |
401 | if(IS_ERR(dfid)) { | 401 | if (IS_ERR(dfid)) { |
402 | err = PTR_ERR(dfid); | 402 | err = PTR_ERR(dfid); |
403 | dfid = NULL; | 403 | dfid = NULL; |
404 | goto error; | 404 | goto error; |
@@ -432,7 +432,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, | |||
432 | goto error; | 432 | goto error; |
433 | } | 433 | } |
434 | 434 | ||
435 | if(v9ses->cache) | 435 | if (v9ses->cache) |
436 | dentry->d_op = &v9fs_cached_dentry_operations; | 436 | dentry->d_op = &v9fs_cached_dentry_operations; |
437 | else | 437 | else |
438 | dentry->d_op = &v9fs_dentry_operations; | 438 | dentry->d_op = &v9fs_dentry_operations; |
@@ -593,7 +593,7 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, | |||
593 | if (result < 0) | 593 | if (result < 0) |
594 | goto error; | 594 | goto error; |
595 | 595 | ||
596 | if((fid->qid.version)&&(v9ses->cache)) | 596 | if ((fid->qid.version) && (v9ses->cache)) |
597 | dentry->d_op = &v9fs_cached_dentry_operations; | 597 | dentry->d_op = &v9fs_cached_dentry_operations; |
598 | else | 598 | else |
599 | dentry->d_op = &v9fs_dentry_operations; | 599 | dentry->d_op = &v9fs_dentry_operations; |
@@ -658,17 +658,17 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
658 | old_inode = old_dentry->d_inode; | 658 | old_inode = old_dentry->d_inode; |
659 | v9ses = v9fs_inode2v9ses(old_inode); | 659 | v9ses = v9fs_inode2v9ses(old_inode); |
660 | oldfid = v9fs_fid_lookup(old_dentry); | 660 | oldfid = v9fs_fid_lookup(old_dentry); |
661 | if(IS_ERR(oldfid)) | 661 | if (IS_ERR(oldfid)) |
662 | return PTR_ERR(oldfid); | 662 | return PTR_ERR(oldfid); |
663 | 663 | ||
664 | olddirfid = v9fs_fid_clone(old_dentry->d_parent); | 664 | olddirfid = v9fs_fid_clone(old_dentry->d_parent); |
665 | if(IS_ERR(olddirfid)) { | 665 | if (IS_ERR(olddirfid)) { |
666 | retval = PTR_ERR(olddirfid); | 666 | retval = PTR_ERR(olddirfid); |
667 | goto done; | 667 | goto done; |
668 | } | 668 | } |
669 | 669 | ||
670 | newdirfid = v9fs_fid_clone(new_dentry->d_parent); | 670 | newdirfid = v9fs_fid_clone(new_dentry->d_parent); |
671 | if(IS_ERR(newdirfid)) { | 671 | if (IS_ERR(newdirfid)) { |
672 | retval = PTR_ERR(newdirfid); | 672 | retval = PTR_ERR(newdirfid); |
673 | goto clunk_olddir; | 673 | goto clunk_olddir; |
674 | } | 674 | } |
@@ -682,7 +682,7 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
682 | } | 682 | } |
683 | 683 | ||
684 | v9fs_blank_wstat(&wstat); | 684 | v9fs_blank_wstat(&wstat); |
685 | wstat.muid = v9ses->name; | 685 | wstat.muid = v9ses->uname; |
686 | wstat.name = (char *) new_dentry->d_name.name; | 686 | wstat.name = (char *) new_dentry->d_name.name; |
687 | retval = p9_client_wstat(oldfid, &wstat); | 687 | retval = p9_client_wstat(oldfid, &wstat); |
688 | 688 | ||
@@ -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 | ||
@@ -805,10 +805,10 @@ v9fs_stat2inode(struct p9_stat *stat, struct inode *inode, | |||
805 | inode->i_mtime.tv_sec = stat->mtime; | 805 | inode->i_mtime.tv_sec = stat->mtime; |
806 | inode->i_ctime.tv_sec = stat->mtime; | 806 | inode->i_ctime.tv_sec = stat->mtime; |
807 | 807 | ||
808 | inode->i_uid = v9ses->uid; | 808 | inode->i_uid = v9ses->dfltuid; |
809 | inode->i_gid = v9ses->gid; | 809 | inode->i_gid = v9ses->dfltgid; |
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 | } |
@@ -887,10 +887,10 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen) | |||
887 | retval = -EPERM; | 887 | retval = -EPERM; |
888 | v9ses = v9fs_inode2v9ses(dentry->d_inode); | 888 | v9ses = v9fs_inode2v9ses(dentry->d_inode); |
889 | fid = v9fs_fid_lookup(dentry); | 889 | fid = v9fs_fid_lookup(dentry); |
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 | } |
@@ -1070,7 +1070,7 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir, | |||
1070 | old_dentry->d_name.name); | 1070 | old_dentry->d_name.name); |
1071 | 1071 | ||
1072 | oldfid = v9fs_fid_clone(old_dentry); | 1072 | oldfid = v9fs_fid_clone(old_dentry); |
1073 | if(IS_ERR(oldfid)) | 1073 | if (IS_ERR(oldfid)) |
1074 | return PTR_ERR(oldfid); | 1074 | return PTR_ERR(oldfid); |
1075 | 1075 | ||
1076 | name = __getname(); | 1076 | name = __getname(); |