aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 18:09:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 18:09:01 -0500
commit609eac1c152353ee4cd6f292d49f0aa0b885951a (patch)
tree9274243e8d62427be5b7ec15bc9cd383e482f477 /fs/9p
parent57eccf1c2acae2fcb748730881ba75643fc31c81 (diff)
parentf766619db2be059cd0dbba8a36176fe01a29d588 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs: fs/9p: iattr_valid flags are kernel internal flags map them to 9p values. fs/9p: We should not allocate a new inode when creating hardlines. fs/9p: v9fs_stat2inode should update suid/sgid bits. 9p: Reduce object size with CONFIG_NET_9P_DEBUG fs/9p: check schedule_timeout_interruptible return value Fix up trivial conflicts in fs/9p/{vfs_inode.c,vfs_inode_dotl.c} due to debug messages having changed to use p9_debug() on one hand, and the changes for umode_t on the other.
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/cache.c64
-rw-r--r--fs/9p/fid.c8
-rw-r--r--fs/9p/v9fs.c59
-rw-r--r--fs/9p/vfs_addr.c13
-rw-r--r--fs/9p/vfs_dentry.c12
-rw-r--r--fs/9p/vfs_dir.c13
-rw-r--r--fs/9p/vfs_file.c34
-rw-r--r--fs/9p/vfs_inode.c165
-rw-r--r--fs/9p/vfs_inode_dotl.c127
-rw-r--r--fs/9p/vfs_super.c12
-rw-r--r--fs/9p/xattr.c16
11 files changed, 290 insertions, 233 deletions
diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index 945aa5f02f9b..a9ea73d6dcf3 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -62,8 +62,8 @@ static uint16_t v9fs_cache_session_get_key(const void *cookie_netfs_data,
62 uint16_t klen = 0; 62 uint16_t klen = 0;
63 63
64 v9ses = (struct v9fs_session_info *)cookie_netfs_data; 64 v9ses = (struct v9fs_session_info *)cookie_netfs_data;
65 P9_DPRINTK(P9_DEBUG_FSC, "session %p buf %p size %u", v9ses, 65 p9_debug(P9_DEBUG_FSC, "session %p buf %p size %u\n",
66 buffer, bufmax); 66 v9ses, buffer, bufmax);
67 67
68 if (v9ses->cachetag) 68 if (v9ses->cachetag)
69 klen = strlen(v9ses->cachetag); 69 klen = strlen(v9ses->cachetag);
@@ -72,7 +72,7 @@ static uint16_t v9fs_cache_session_get_key(const void *cookie_netfs_data,
72 return 0; 72 return 0;
73 73
74 memcpy(buffer, v9ses->cachetag, klen); 74 memcpy(buffer, v9ses->cachetag, klen);
75 P9_DPRINTK(P9_DEBUG_FSC, "cache session tag %s", v9ses->cachetag); 75 p9_debug(P9_DEBUG_FSC, "cache session tag %s\n", v9ses->cachetag);
76 return klen; 76 return klen;
77} 77}
78 78
@@ -91,14 +91,14 @@ void v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses)
91 v9ses->fscache = fscache_acquire_cookie(v9fs_cache_netfs.primary_index, 91 v9ses->fscache = fscache_acquire_cookie(v9fs_cache_netfs.primary_index,
92 &v9fs_cache_session_index_def, 92 &v9fs_cache_session_index_def,
93 v9ses); 93 v9ses);
94 P9_DPRINTK(P9_DEBUG_FSC, "session %p get cookie %p", v9ses, 94 p9_debug(P9_DEBUG_FSC, "session %p get cookie %p\n",
95 v9ses->fscache); 95 v9ses, v9ses->fscache);
96} 96}
97 97
98void v9fs_cache_session_put_cookie(struct v9fs_session_info *v9ses) 98void v9fs_cache_session_put_cookie(struct v9fs_session_info *v9ses)
99{ 99{
100 P9_DPRINTK(P9_DEBUG_FSC, "session %p put cookie %p", v9ses, 100 p9_debug(P9_DEBUG_FSC, "session %p put cookie %p\n",
101 v9ses->fscache); 101 v9ses, v9ses->fscache);
102 fscache_relinquish_cookie(v9ses->fscache, 0); 102 fscache_relinquish_cookie(v9ses->fscache, 0);
103 v9ses->fscache = NULL; 103 v9ses->fscache = NULL;
104} 104}
@@ -109,8 +109,8 @@ static uint16_t v9fs_cache_inode_get_key(const void *cookie_netfs_data,
109{ 109{
110 const struct v9fs_inode *v9inode = cookie_netfs_data; 110 const struct v9fs_inode *v9inode = cookie_netfs_data;
111 memcpy(buffer, &v9inode->qid.path, sizeof(v9inode->qid.path)); 111 memcpy(buffer, &v9inode->qid.path, sizeof(v9inode->qid.path));
112 P9_DPRINTK(P9_DEBUG_FSC, "inode %p get key %llu", &v9inode->vfs_inode, 112 p9_debug(P9_DEBUG_FSC, "inode %p get key %llu\n",
113 v9inode->qid.path); 113 &v9inode->vfs_inode, v9inode->qid.path);
114 return sizeof(v9inode->qid.path); 114 return sizeof(v9inode->qid.path);
115} 115}
116 116
@@ -120,8 +120,8 @@ static void v9fs_cache_inode_get_attr(const void *cookie_netfs_data,
120 const struct v9fs_inode *v9inode = cookie_netfs_data; 120 const struct v9fs_inode *v9inode = cookie_netfs_data;
121 *size = i_size_read(&v9inode->vfs_inode); 121 *size = i_size_read(&v9inode->vfs_inode);
122 122
123 P9_DPRINTK(P9_DEBUG_FSC, "inode %p get attr %llu", &v9inode->vfs_inode, 123 p9_debug(P9_DEBUG_FSC, "inode %p get attr %llu\n",
124 *size); 124 &v9inode->vfs_inode, *size);
125} 125}
126 126
127static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data, 127static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data,
@@ -129,8 +129,8 @@ static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data,
129{ 129{
130 const struct v9fs_inode *v9inode = cookie_netfs_data; 130 const struct v9fs_inode *v9inode = cookie_netfs_data;
131 memcpy(buffer, &v9inode->qid.version, sizeof(v9inode->qid.version)); 131 memcpy(buffer, &v9inode->qid.version, sizeof(v9inode->qid.version));
132 P9_DPRINTK(P9_DEBUG_FSC, "inode %p get aux %u", &v9inode->vfs_inode, 132 p9_debug(P9_DEBUG_FSC, "inode %p get aux %u\n",
133 v9inode->qid.version); 133 &v9inode->vfs_inode, v9inode->qid.version);
134 return sizeof(v9inode->qid.version); 134 return sizeof(v9inode->qid.version);
135} 135}
136 136
@@ -206,8 +206,8 @@ void v9fs_cache_inode_get_cookie(struct inode *inode)
206 &v9fs_cache_inode_index_def, 206 &v9fs_cache_inode_index_def,
207 v9inode); 207 v9inode);
208 208
209 P9_DPRINTK(P9_DEBUG_FSC, "inode %p get cookie %p", inode, 209 p9_debug(P9_DEBUG_FSC, "inode %p get cookie %p\n",
210 v9inode->fscache); 210 inode, v9inode->fscache);
211} 211}
212 212
213void v9fs_cache_inode_put_cookie(struct inode *inode) 213void v9fs_cache_inode_put_cookie(struct inode *inode)
@@ -216,8 +216,8 @@ void v9fs_cache_inode_put_cookie(struct inode *inode)
216 216
217 if (!v9inode->fscache) 217 if (!v9inode->fscache)
218 return; 218 return;
219 P9_DPRINTK(P9_DEBUG_FSC, "inode %p put cookie %p", inode, 219 p9_debug(P9_DEBUG_FSC, "inode %p put cookie %p\n",
220 v9inode->fscache); 220 inode, v9inode->fscache);
221 221
222 fscache_relinquish_cookie(v9inode->fscache, 0); 222 fscache_relinquish_cookie(v9inode->fscache, 0);
223 v9inode->fscache = NULL; 223 v9inode->fscache = NULL;
@@ -229,8 +229,8 @@ void v9fs_cache_inode_flush_cookie(struct inode *inode)
229 229
230 if (!v9inode->fscache) 230 if (!v9inode->fscache)
231 return; 231 return;
232 P9_DPRINTK(P9_DEBUG_FSC, "inode %p flush cookie %p", inode, 232 p9_debug(P9_DEBUG_FSC, "inode %p flush cookie %p\n",
233 v9inode->fscache); 233 inode, v9inode->fscache);
234 234
235 fscache_relinquish_cookie(v9inode->fscache, 1); 235 fscache_relinquish_cookie(v9inode->fscache, 1);
236 v9inode->fscache = NULL; 236 v9inode->fscache = NULL;
@@ -272,8 +272,8 @@ void v9fs_cache_inode_reset_cookie(struct inode *inode)
272 v9inode->fscache = fscache_acquire_cookie(v9ses->fscache, 272 v9inode->fscache = fscache_acquire_cookie(v9ses->fscache,
273 &v9fs_cache_inode_index_def, 273 &v9fs_cache_inode_index_def,
274 v9inode); 274 v9inode);
275 P9_DPRINTK(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p", 275 p9_debug(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p\n",
276 inode, old, v9inode->fscache); 276 inode, old, v9inode->fscache);
277 277
278 spin_unlock(&v9inode->fscache_lock); 278 spin_unlock(&v9inode->fscache_lock);
279} 279}
@@ -323,7 +323,7 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page)
323 int ret; 323 int ret;
324 const struct v9fs_inode *v9inode = V9FS_I(inode); 324 const struct v9fs_inode *v9inode = V9FS_I(inode);
325 325
326 P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page); 326 p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
327 if (!v9inode->fscache) 327 if (!v9inode->fscache)
328 return -ENOBUFS; 328 return -ENOBUFS;
329 329
@@ -335,13 +335,13 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page)
335 switch (ret) { 335 switch (ret) {
336 case -ENOBUFS: 336 case -ENOBUFS:
337 case -ENODATA: 337 case -ENODATA:
338 P9_DPRINTK(P9_DEBUG_FSC, "page/inode not in cache %d", ret); 338 p9_debug(P9_DEBUG_FSC, "page/inode not in cache %d\n", ret);
339 return 1; 339 return 1;
340 case 0: 340 case 0:
341 P9_DPRINTK(P9_DEBUG_FSC, "BIO submitted"); 341 p9_debug(P9_DEBUG_FSC, "BIO submitted\n");
342 return ret; 342 return ret;
343 default: 343 default:
344 P9_DPRINTK(P9_DEBUG_FSC, "ret %d", ret); 344 p9_debug(P9_DEBUG_FSC, "ret %d\n", ret);
345 return ret; 345 return ret;
346 } 346 }
347} 347}
@@ -361,7 +361,7 @@ int __v9fs_readpages_from_fscache(struct inode *inode,
361 int ret; 361 int ret;
362 const struct v9fs_inode *v9inode = V9FS_I(inode); 362 const struct v9fs_inode *v9inode = V9FS_I(inode);
363 363
364 P9_DPRINTK(P9_DEBUG_FSC, "inode %p pages %u", inode, *nr_pages); 364 p9_debug(P9_DEBUG_FSC, "inode %p pages %u\n", inode, *nr_pages);
365 if (!v9inode->fscache) 365 if (!v9inode->fscache)
366 return -ENOBUFS; 366 return -ENOBUFS;
367 367
@@ -373,15 +373,15 @@ int __v9fs_readpages_from_fscache(struct inode *inode,
373 switch (ret) { 373 switch (ret) {
374 case -ENOBUFS: 374 case -ENOBUFS:
375 case -ENODATA: 375 case -ENODATA:
376 P9_DPRINTK(P9_DEBUG_FSC, "pages/inodes not in cache %d", ret); 376 p9_debug(P9_DEBUG_FSC, "pages/inodes not in cache %d\n", ret);
377 return 1; 377 return 1;
378 case 0: 378 case 0:
379 BUG_ON(!list_empty(pages)); 379 BUG_ON(!list_empty(pages));
380 BUG_ON(*nr_pages != 0); 380 BUG_ON(*nr_pages != 0);
381 P9_DPRINTK(P9_DEBUG_FSC, "BIO submitted"); 381 p9_debug(P9_DEBUG_FSC, "BIO submitted\n");
382 return ret; 382 return ret;
383 default: 383 default:
384 P9_DPRINTK(P9_DEBUG_FSC, "ret %d", ret); 384 p9_debug(P9_DEBUG_FSC, "ret %d\n", ret);
385 return ret; 385 return ret;
386 } 386 }
387} 387}
@@ -396,9 +396,9 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
396 int ret; 396 int ret;
397 const struct v9fs_inode *v9inode = V9FS_I(inode); 397 const struct v9fs_inode *v9inode = V9FS_I(inode);
398 398
399 P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page); 399 p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
400 ret = fscache_write_page(v9inode->fscache, page, GFP_KERNEL); 400 ret = fscache_write_page(v9inode->fscache, page, GFP_KERNEL);
401 P9_DPRINTK(P9_DEBUG_FSC, "ret = %d", ret); 401 p9_debug(P9_DEBUG_FSC, "ret = %d\n", ret);
402 if (ret != 0) 402 if (ret != 0)
403 v9fs_uncache_page(inode, page); 403 v9fs_uncache_page(inode, page);
404} 404}
@@ -409,7 +409,7 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
409void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page) 409void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page)
410{ 410{
411 const struct v9fs_inode *v9inode = V9FS_I(inode); 411 const struct v9fs_inode *v9inode = V9FS_I(inode);
412 P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page); 412 p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
413 if (PageFsCache(page)) 413 if (PageFsCache(page))
414 fscache_wait_on_page_write(v9inode->fscache, page); 414 fscache_wait_on_page_write(v9inode->fscache, page);
415} 415}
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 85b67ffa2a43..da8eefbe830d 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -45,8 +45,8 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
45{ 45{
46 struct v9fs_dentry *dent; 46 struct v9fs_dentry *dent;
47 47
48 P9_DPRINTK(P9_DEBUG_VFS, "fid %d dentry %s\n", 48 p9_debug(P9_DEBUG_VFS, "fid %d dentry %s\n",
49 fid->fid, dentry->d_name.name); 49 fid->fid, dentry->d_name.name);
50 50
51 dent = dentry->d_fsdata; 51 dent = dentry->d_fsdata;
52 if (!dent) { 52 if (!dent) {
@@ -79,8 +79,8 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, u32 uid, int any)
79 struct v9fs_dentry *dent; 79 struct v9fs_dentry *dent;
80 struct p9_fid *fid, *ret; 80 struct p9_fid *fid, *ret;
81 81
82 P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n", 82 p9_debug(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n",
83 dentry->d_name.name, dentry, uid, any); 83 dentry->d_name.name, dentry, uid, any);
84 dent = (struct v9fs_dentry *) dentry->d_fsdata; 84 dent = (struct v9fs_dentry *) dentry->d_fsdata;
85 ret = NULL; 85 ret = NULL;
86 if (dent) { 86 if (dent) {
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 2b78014a124a..1964f98e74be 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -23,6 +23,8 @@
23 * 23 *
24 */ 24 */
25 25
26#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27
26#include <linux/module.h> 28#include <linux/module.h>
27#include <linux/errno.h> 29#include <linux/errno.h>
28#include <linux/fs.h> 30#include <linux/fs.h>
@@ -85,15 +87,15 @@ static int get_cache_mode(char *s)
85 87
86 if (!strcmp(s, "loose")) { 88 if (!strcmp(s, "loose")) {
87 version = CACHE_LOOSE; 89 version = CACHE_LOOSE;
88 P9_DPRINTK(P9_DEBUG_9P, "Cache mode: loose\n"); 90 p9_debug(P9_DEBUG_9P, "Cache mode: loose\n");
89 } else if (!strcmp(s, "fscache")) { 91 } else if (!strcmp(s, "fscache")) {
90 version = CACHE_FSCACHE; 92 version = CACHE_FSCACHE;
91 P9_DPRINTK(P9_DEBUG_9P, "Cache mode: fscache\n"); 93 p9_debug(P9_DEBUG_9P, "Cache mode: fscache\n");
92 } else if (!strcmp(s, "none")) { 94 } else if (!strcmp(s, "none")) {
93 version = CACHE_NONE; 95 version = CACHE_NONE;
94 P9_DPRINTK(P9_DEBUG_9P, "Cache mode: none\n"); 96 p9_debug(P9_DEBUG_9P, "Cache mode: none\n");
95 } else 97 } else
96 printk(KERN_INFO "9p: Unknown Cache mode %s.\n", s); 98 pr_info("Unknown Cache mode %s\n", s);
97 return version; 99 return version;
98} 100}
99 101
@@ -140,8 +142,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
140 case Opt_debug: 142 case Opt_debug:
141 r = match_int(&args[0], &option); 143 r = match_int(&args[0], &option);
142 if (r < 0) { 144 if (r < 0) {
143 P9_DPRINTK(P9_DEBUG_ERROR, 145 p9_debug(P9_DEBUG_ERROR,
144 "integer field, but no integer?\n"); 146 "integer field, but no integer?\n");
145 ret = r; 147 ret = r;
146 continue; 148 continue;
147 } 149 }
@@ -154,8 +156,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
154 case Opt_dfltuid: 156 case Opt_dfltuid:
155 r = match_int(&args[0], &option); 157 r = match_int(&args[0], &option);
156 if (r < 0) { 158 if (r < 0) {
157 P9_DPRINTK(P9_DEBUG_ERROR, 159 p9_debug(P9_DEBUG_ERROR,
158 "integer field, but no integer?\n"); 160 "integer field, but no integer?\n");
159 ret = r; 161 ret = r;
160 continue; 162 continue;
161 } 163 }
@@ -164,8 +166,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
164 case Opt_dfltgid: 166 case Opt_dfltgid:
165 r = match_int(&args[0], &option); 167 r = match_int(&args[0], &option);
166 if (r < 0) { 168 if (r < 0) {
167 P9_DPRINTK(P9_DEBUG_ERROR, 169 p9_debug(P9_DEBUG_ERROR,
168 "integer field, but no integer?\n"); 170 "integer field, but no integer?\n");
169 ret = r; 171 ret = r;
170 continue; 172 continue;
171 } 173 }
@@ -174,8 +176,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
174 case Opt_afid: 176 case Opt_afid:
175 r = match_int(&args[0], &option); 177 r = match_int(&args[0], &option);
176 if (r < 0) { 178 if (r < 0) {
177 P9_DPRINTK(P9_DEBUG_ERROR, 179 p9_debug(P9_DEBUG_ERROR,
178 "integer field, but no integer?\n"); 180 "integer field, but no integer?\n");
179 ret = r; 181 ret = r;
180 continue; 182 continue;
181 } 183 }
@@ -205,8 +207,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
205 s = match_strdup(&args[0]); 207 s = match_strdup(&args[0]);
206 if (!s) { 208 if (!s) {
207 ret = -ENOMEM; 209 ret = -ENOMEM;
208 P9_DPRINTK(P9_DEBUG_ERROR, 210 p9_debug(P9_DEBUG_ERROR,
209 "problem allocating copy of cache arg\n"); 211 "problem allocating copy of cache arg\n");
210 goto free_and_return; 212 goto free_and_return;
211 } 213 }
212 ret = get_cache_mode(s); 214 ret = get_cache_mode(s);
@@ -223,8 +225,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
223 s = match_strdup(&args[0]); 225 s = match_strdup(&args[0]);
224 if (!s) { 226 if (!s) {
225 ret = -ENOMEM; 227 ret = -ENOMEM;
226 P9_DPRINTK(P9_DEBUG_ERROR, 228 p9_debug(P9_DEBUG_ERROR,
227 "problem allocating copy of access arg\n"); 229 "problem allocating copy of access arg\n");
228 goto free_and_return; 230 goto free_and_return;
229 } 231 }
230 232
@@ -240,8 +242,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
240 v9ses->uid = simple_strtoul(s, &e, 10); 242 v9ses->uid = simple_strtoul(s, &e, 10);
241 if (*e != '\0') { 243 if (*e != '\0') {
242 ret = -EINVAL; 244 ret = -EINVAL;
243 printk(KERN_INFO "9p: Unknown access " 245 pr_info("Unknown access argument %s\n",
244 "argument %s.\n", s); 246 s);
245 kfree(s); 247 kfree(s);
246 goto free_and_return; 248 goto free_and_return;
247 } 249 }
@@ -254,9 +256,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
254#ifdef CONFIG_9P_FS_POSIX_ACL 256#ifdef CONFIG_9P_FS_POSIX_ACL
255 v9ses->flags |= V9FS_POSIX_ACL; 257 v9ses->flags |= V9FS_POSIX_ACL;
256#else 258#else
257 P9_DPRINTK(P9_DEBUG_ERROR, 259 p9_debug(P9_DEBUG_ERROR,
258 "Not defined CONFIG_9P_FS_POSIX_ACL. " 260 "Not defined CONFIG_9P_FS_POSIX_ACL. Ignoring posixacl option\n");
259 "Ignoring posixacl option\n");
260#endif 261#endif
261 break; 262 break;
262 263
@@ -318,7 +319,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
318 if (IS_ERR(v9ses->clnt)) { 319 if (IS_ERR(v9ses->clnt)) {
319 retval = PTR_ERR(v9ses->clnt); 320 retval = PTR_ERR(v9ses->clnt);
320 v9ses->clnt = NULL; 321 v9ses->clnt = NULL;
321 P9_DPRINTK(P9_DEBUG_ERROR, "problem initializing 9p client\n"); 322 p9_debug(P9_DEBUG_ERROR, "problem initializing 9p client\n");
322 goto error; 323 goto error;
323 } 324 }
324 325
@@ -371,7 +372,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
371 if (IS_ERR(fid)) { 372 if (IS_ERR(fid)) {
372 retval = PTR_ERR(fid); 373 retval = PTR_ERR(fid);
373 fid = NULL; 374 fid = NULL;
374 P9_DPRINTK(P9_DEBUG_ERROR, "cannot attach\n"); 375 p9_debug(P9_DEBUG_ERROR, "cannot attach\n");
375 goto error; 376 goto error;
376 } 377 }
377 378
@@ -429,7 +430,7 @@ void v9fs_session_close(struct v9fs_session_info *v9ses)
429 */ 430 */
430 431
431void v9fs_session_cancel(struct v9fs_session_info *v9ses) { 432void v9fs_session_cancel(struct v9fs_session_info *v9ses) {
432 P9_DPRINTK(P9_DEBUG_ERROR, "cancel session %p\n", v9ses); 433 p9_debug(P9_DEBUG_ERROR, "cancel session %p\n", v9ses);
433 p9_client_disconnect(v9ses->clnt); 434 p9_client_disconnect(v9ses->clnt);
434} 435}
435 436
@@ -442,7 +443,7 @@ void v9fs_session_cancel(struct v9fs_session_info *v9ses) {
442 443
443void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses) 444void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses)
444{ 445{
445 P9_DPRINTK(P9_DEBUG_ERROR, "begin cancel session %p\n", v9ses); 446 p9_debug(P9_DEBUG_ERROR, "begin cancel session %p\n", v9ses);
446 p9_client_begin_disconnect(v9ses->clnt); 447 p9_client_begin_disconnect(v9ses->clnt);
447} 448}
448 449
@@ -591,23 +592,23 @@ static void v9fs_cache_unregister(void)
591static int __init init_v9fs(void) 592static int __init init_v9fs(void)
592{ 593{
593 int err; 594 int err;
594 printk(KERN_INFO "Installing v9fs 9p2000 file system support\n"); 595 pr_info("Installing v9fs 9p2000 file system support\n");
595 /* TODO: Setup list of registered trasnport modules */ 596 /* TODO: Setup list of registered trasnport modules */
596 err = register_filesystem(&v9fs_fs_type); 597 err = register_filesystem(&v9fs_fs_type);
597 if (err < 0) { 598 if (err < 0) {
598 printk(KERN_ERR "Failed to register filesystem\n"); 599 pr_err("Failed to register filesystem\n");
599 return err; 600 return err;
600 } 601 }
601 602
602 err = v9fs_cache_register(); 603 err = v9fs_cache_register();
603 if (err < 0) { 604 if (err < 0) {
604 printk(KERN_ERR "Failed to register v9fs for caching\n"); 605 pr_err("Failed to register v9fs for caching\n");
605 goto out_fs_unreg; 606 goto out_fs_unreg;
606 } 607 }
607 608
608 err = v9fs_sysfs_init(); 609 err = v9fs_sysfs_init();
609 if (err < 0) { 610 if (err < 0) {
610 printk(KERN_ERR "Failed to register with sysfs\n"); 611 pr_err("Failed to register with sysfs\n");
611 goto out_sysfs_cleanup; 612 goto out_sysfs_cleanup;
612 } 613 }
613 614
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 2524e4cbb8ea..0ad61c6a65a5 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -56,7 +56,7 @@ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page)
56 struct inode *inode; 56 struct inode *inode;
57 57
58 inode = page->mapping->host; 58 inode = page->mapping->host;
59 P9_DPRINTK(P9_DEBUG_VFS, "\n"); 59 p9_debug(P9_DEBUG_VFS, "\n");
60 60
61 BUG_ON(!PageLocked(page)); 61 BUG_ON(!PageLocked(page));
62 62
@@ -116,14 +116,14 @@ static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping,
116 struct inode *inode; 116 struct inode *inode;
117 117
118 inode = mapping->host; 118 inode = mapping->host;
119 P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, filp); 119 p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, filp);
120 120
121 ret = v9fs_readpages_from_fscache(inode, mapping, pages, &nr_pages); 121 ret = v9fs_readpages_from_fscache(inode, mapping, pages, &nr_pages);
122 if (ret == 0) 122 if (ret == 0)
123 return ret; 123 return ret;
124 124
125 ret = read_cache_pages(mapping, pages, (void *)v9fs_vfs_readpage, filp); 125 ret = read_cache_pages(mapping, pages, (void *)v9fs_vfs_readpage, filp);
126 P9_DPRINTK(P9_DEBUG_VFS, " = %d\n", ret); 126 p9_debug(P9_DEBUG_VFS, " = %d\n", ret);
127 return ret; 127 return ret;
128} 128}
129 129
@@ -263,10 +263,9 @@ v9fs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
263 * Now that we do caching with cache mode enabled, We need 263 * Now that we do caching with cache mode enabled, We need
264 * to support direct IO 264 * to support direct IO
265 */ 265 */
266 P9_DPRINTK(P9_DEBUG_VFS, "v9fs_direct_IO: v9fs_direct_IO (%s) " 266 p9_debug(P9_DEBUG_VFS, "v9fs_direct_IO: v9fs_direct_IO (%s) off/no(%lld/%lu) EINVAL\n",
267 "off/no(%lld/%lu) EINVAL\n", 267 iocb->ki_filp->f_path.dentry->d_name.name,
268 iocb->ki_filp->f_path.dentry->d_name.name, 268 (long long)pos, nr_segs);
269 (long long) pos, nr_segs);
270 269
271 return -EINVAL; 270 return -EINVAL;
272} 271}
diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c
index e022890c6f40..d529437ff442 100644
--- a/fs/9p/vfs_dentry.c
+++ b/fs/9p/vfs_dentry.c
@@ -53,8 +53,8 @@
53 53
54static int v9fs_dentry_delete(const struct dentry *dentry) 54static int v9fs_dentry_delete(const struct dentry *dentry)
55{ 55{
56 P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name, 56 p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n",
57 dentry); 57 dentry->d_name.name, dentry);
58 58
59 return 1; 59 return 1;
60} 60}
@@ -66,8 +66,8 @@ static int v9fs_dentry_delete(const struct dentry *dentry)
66 */ 66 */
67static int v9fs_cached_dentry_delete(const struct dentry *dentry) 67static int v9fs_cached_dentry_delete(const struct dentry *dentry)
68{ 68{
69 P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", 69 p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n",
70 dentry->d_name.name, dentry); 70 dentry->d_name.name, dentry);
71 71
72 /* Don't cache negative dentries */ 72 /* Don't cache negative dentries */
73 if (!dentry->d_inode) 73 if (!dentry->d_inode)
@@ -86,8 +86,8 @@ static void v9fs_dentry_release(struct dentry *dentry)
86 struct v9fs_dentry *dent; 86 struct v9fs_dentry *dent;
87 struct p9_fid *temp, *current_fid; 87 struct p9_fid *temp, *current_fid;
88 88
89 P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name, 89 p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n",
90 dentry); 90 dentry->d_name.name, dentry);
91 dent = dentry->d_fsdata; 91 dent = dentry->d_fsdata;
92 if (dent) { 92 if (dent) {
93 list_for_each_entry_safe(current_fid, temp, &dent->fidlist, 93 list_for_each_entry_safe(current_fid, temp, &dent->fidlist,
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 598fff1a54e5..ff911e779651 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -140,7 +140,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
140 int reclen = 0; 140 int reclen = 0;
141 struct p9_rdir *rdir; 141 struct p9_rdir *rdir;
142 142
143 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name); 143 p9_debug(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
144 fid = filp->private_data; 144 fid = filp->private_data;
145 145
146 buflen = fid->clnt->msize - P9_IOHDRSZ; 146 buflen = fid->clnt->msize - P9_IOHDRSZ;
@@ -168,7 +168,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
168 err = p9stat_read(fid->clnt, rdir->buf + rdir->head, 168 err = p9stat_read(fid->clnt, rdir->buf + rdir->head,
169 rdir->tail - rdir->head, &st); 169 rdir->tail - rdir->head, &st);
170 if (err) { 170 if (err) {
171 P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); 171 p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
172 err = -EIO; 172 err = -EIO;
173 p9stat_free(&st); 173 p9stat_free(&st);
174 goto unlock_and_exit; 174 goto unlock_and_exit;
@@ -213,7 +213,7 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent,
213 struct p9_dirent curdirent; 213 struct p9_dirent curdirent;
214 u64 oldoffset = 0; 214 u64 oldoffset = 0;
215 215
216 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name); 216 p9_debug(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
217 fid = filp->private_data; 217 fid = filp->private_data;
218 218
219 buflen = fid->clnt->msize - P9_READDIRHDRSZ; 219 buflen = fid->clnt->msize - P9_READDIRHDRSZ;
@@ -244,7 +244,7 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent,
244 rdir->tail - rdir->head, 244 rdir->tail - rdir->head,
245 &curdirent); 245 &curdirent);
246 if (err < 0) { 246 if (err < 0) {
247 P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); 247 p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
248 err = -EIO; 248 err = -EIO;
249 goto unlock_and_exit; 249 goto unlock_and_exit;
250 } 250 }
@@ -290,9 +290,8 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
290 struct p9_fid *fid; 290 struct p9_fid *fid;
291 291
292 fid = filp->private_data; 292 fid = filp->private_data;
293 P9_DPRINTK(P9_DEBUG_VFS, 293 p9_debug(P9_DEBUG_VFS, "inode: %p filp: %p fid: %d\n",
294 "v9fs_dir_release: inode: %p filp: %p fid: %d\n", 294 inode, filp, fid ? fid->fid : -1);
295 inode, filp, fid ? fid->fid : -1);
296 if (fid) 295 if (fid)
297 p9_client_clunk(fid); 296 p9_client_clunk(fid);
298 return 0; 297 return 0;
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 62857a810a79..fc06fd27065e 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -61,7 +61,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
61 struct p9_fid *fid; 61 struct p9_fid *fid;
62 int omode; 62 int omode;
63 63
64 P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file); 64 p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file);
65 v9inode = V9FS_I(inode); 65 v9inode = V9FS_I(inode);
66 v9ses = v9fs_inode2v9ses(inode); 66 v9ses = v9fs_inode2v9ses(inode);
67 if (v9fs_proto_dotl(v9ses)) 67 if (v9fs_proto_dotl(v9ses))
@@ -135,7 +135,7 @@ static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl)
135 int res = 0; 135 int res = 0;
136 struct inode *inode = filp->f_path.dentry->d_inode; 136 struct inode *inode = filp->f_path.dentry->d_inode;
137 137
138 P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); 138 p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl);
139 139
140 /* No mandatory locks */ 140 /* No mandatory locks */
141 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) 141 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
@@ -204,7 +204,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
204 break; 204 break;
205 if (status == P9_LOCK_BLOCKED && !IS_SETLKW(cmd)) 205 if (status == P9_LOCK_BLOCKED && !IS_SETLKW(cmd))
206 break; 206 break;
207 schedule_timeout_interruptible(P9_LOCK_TIMEOUT); 207 if (schedule_timeout_interruptible(P9_LOCK_TIMEOUT) != 0)
208 break;
208 } 209 }
209 210
210 /* map 9p status to VFS status */ 211 /* map 9p status to VFS status */
@@ -304,8 +305,8 @@ static int v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl)
304 struct inode *inode = filp->f_path.dentry->d_inode; 305 struct inode *inode = filp->f_path.dentry->d_inode;
305 int ret = -ENOLCK; 306 int ret = -ENOLCK;
306 307
307 P9_DPRINTK(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", filp, 308 p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n",
308 cmd, fl, filp->f_path.dentry->d_name.name); 309 filp, cmd, fl, filp->f_path.dentry->d_name.name);
309 310
310 /* No mandatory locks */ 311 /* No mandatory locks */
311 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) 312 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
@@ -340,8 +341,8 @@ static int v9fs_file_flock_dotl(struct file *filp, int cmd,
340 struct inode *inode = filp->f_path.dentry->d_inode; 341 struct inode *inode = filp->f_path.dentry->d_inode;
341 int ret = -ENOLCK; 342 int ret = -ENOLCK;
342 343
343 P9_DPRINTK(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", filp, 344 p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n",
344 cmd, fl, filp->f_path.dentry->d_name.name); 345 filp, cmd, fl, filp->f_path.dentry->d_name.name);
345 346
346 /* No mandatory locks */ 347 /* No mandatory locks */
347 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) 348 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
@@ -384,8 +385,8 @@ v9fs_fid_readn(struct p9_fid *fid, char *data, char __user *udata, u32 count,
384{ 385{
385 int n, total, size; 386 int n, total, size;
386 387
387 P9_DPRINTK(P9_DEBUG_VFS, "fid %d offset %llu count %d\n", fid->fid, 388 p9_debug(P9_DEBUG_VFS, "fid %d offset %llu count %d\n",
388 (long long unsigned) offset, count); 389 fid->fid, (long long unsigned)offset, count);
389 n = 0; 390 n = 0;
390 total = 0; 391 total = 0;
391 size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ; 392 size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ;
@@ -443,7 +444,7 @@ v9fs_file_read(struct file *filp, char __user *udata, size_t count,
443 struct p9_fid *fid; 444 struct p9_fid *fid;
444 size_t size; 445 size_t size;
445 446
446 P9_DPRINTK(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset); 447 p9_debug(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset);
447 fid = filp->private_data; 448 fid = filp->private_data;
448 449
449 size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ; 450 size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ;
@@ -470,8 +471,8 @@ v9fs_file_write_internal(struct inode *inode, struct p9_fid *fid,
470 loff_t origin = *offset; 471 loff_t origin = *offset;
471 unsigned long pg_start, pg_end; 472 unsigned long pg_start, pg_end;
472 473
473 P9_DPRINTK(P9_DEBUG_VFS, "data %p count %d offset %x\n", data, 474 p9_debug(P9_DEBUG_VFS, "data %p count %d offset %x\n",
474 (int)count, (int)*offset); 475 data, (int)count, (int)*offset);
475 476
476 clnt = fid->clnt; 477 clnt = fid->clnt;
477 do { 478 do {
@@ -552,7 +553,7 @@ static int v9fs_file_fsync(struct file *filp, loff_t start, loff_t end,
552 return retval; 553 return retval;
553 554
554 mutex_lock(&inode->i_mutex); 555 mutex_lock(&inode->i_mutex);
555 P9_DPRINTK(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync); 556 p9_debug(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync);
556 557
557 fid = filp->private_data; 558 fid = filp->private_data;
558 v9fs_blank_wstat(&wstat); 559 v9fs_blank_wstat(&wstat);
@@ -575,8 +576,7 @@ int v9fs_file_fsync_dotl(struct file *filp, loff_t start, loff_t end,
575 return retval; 576 return retval;
576 577
577 mutex_lock(&inode->i_mutex); 578 mutex_lock(&inode->i_mutex);
578 P9_DPRINTK(P9_DEBUG_VFS, "v9fs_file_fsync_dotl: filp %p datasync %x\n", 579 p9_debug(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync);
579 filp, datasync);
580 580
581 fid = filp->private_data; 581 fid = filp->private_data;
582 582
@@ -607,8 +607,8 @@ v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
607 struct inode *inode = filp->f_path.dentry->d_inode; 607 struct inode *inode = filp->f_path.dentry->d_inode;
608 608
609 609
610 P9_DPRINTK(P9_DEBUG_VFS, "page %p fid %lx\n", 610 p9_debug(P9_DEBUG_VFS, "page %p fid %lx\n",
611 page, (unsigned long)filp->private_data); 611 page, (unsigned long)filp->private_data);
612 612
613 v9inode = V9FS_I(inode); 613 v9inode = V9FS_I(inode);
614 /* make sure the cache has finished storing the page */ 614 /* make sure the cache has finished storing the page */
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index e0f20de6aa2b..014c8dd62962 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -23,6 +23,8 @@
23 * 23 *
24 */ 24 */
25 25
26#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27
26#include <linux/module.h> 28#include <linux/module.h>
27#include <linux/errno.h> 29#include <linux/errno.h>
28#include <linux/fs.h> 30#include <linux/fs.h>
@@ -88,6 +90,32 @@ static u32 unixmode2p9mode(struct v9fs_session_info *v9ses, umode_t mode)
88} 90}
89 91
90/** 92/**
93 * p9mode2perm- convert plan9 mode bits to unix permission bits
94 * @v9ses: v9fs session information
95 * @stat: p9_wstat from which mode need to be derived
96 *
97 */
98static int p9mode2perm(struct v9fs_session_info *v9ses,
99 struct p9_wstat *stat)
100{
101 int res;
102 int mode = stat->mode;
103
104 res = mode & S_IALLUGO;
105 if (v9fs_proto_dotu(v9ses)) {
106 if ((mode & P9_DMSETUID) == P9_DMSETUID)
107 res |= S_ISUID;
108
109 if ((mode & P9_DMSETGID) == P9_DMSETGID)
110 res |= S_ISGID;
111
112 if ((mode & P9_DMSETVTX) == P9_DMSETVTX)
113 res |= S_ISVTX;
114 }
115 return res;
116}
117
118/**
91 * p9mode2unixmode- convert plan9 mode bits to unix mode bits 119 * p9mode2unixmode- convert plan9 mode bits to unix mode bits
92 * @v9ses: v9fs session information 120 * @v9ses: v9fs session information
93 * @stat: p9_wstat from which mode need to be derived 121 * @stat: p9_wstat from which mode need to be derived
@@ -100,8 +128,8 @@ static umode_t p9mode2unixmode(struct v9fs_session_info *v9ses,
100 int res; 128 int res;
101 u32 mode = stat->mode; 129 u32 mode = stat->mode;
102 130
103 res = mode & S_IALLUGO;
104 *rdev = 0; 131 *rdev = 0;
132 res = p9mode2perm(v9ses, stat);
105 133
106 if ((mode & P9_DMDIR) == P9_DMDIR) 134 if ((mode & P9_DMDIR) == P9_DMDIR)
107 res |= S_IFDIR; 135 res |= S_IFDIR;
@@ -128,24 +156,13 @@ static umode_t p9mode2unixmode(struct v9fs_session_info *v9ses,
128 res |= S_IFBLK; 156 res |= S_IFBLK;
129 break; 157 break;
130 default: 158 default:
131 P9_DPRINTK(P9_DEBUG_ERROR, 159 p9_debug(P9_DEBUG_ERROR, "Unknown special type %c %s\n",
132 "Unknown special type %c %s\n", type, 160 type, stat->extension);
133 stat->extension);
134 }; 161 };
135 *rdev = MKDEV(major, minor); 162 *rdev = MKDEV(major, minor);
136 } else 163 } else
137 res |= S_IFREG; 164 res |= S_IFREG;
138 165
139 if (v9fs_proto_dotu(v9ses)) {
140 if ((mode & P9_DMSETUID) == P9_DMSETUID)
141 res |= S_ISUID;
142
143 if ((mode & P9_DMSETGID) == P9_DMSETGID)
144 res |= S_ISGID;
145
146 if ((mode & P9_DMSETVTX) == P9_DMSETVTX)
147 res |= S_ISVTX;
148 }
149 return res; 166 return res;
150} 167}
151 168
@@ -275,8 +292,8 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,
275 } else if (v9fs_proto_dotu(v9ses)) { 292 } else if (v9fs_proto_dotu(v9ses)) {
276 inode->i_op = &v9fs_file_inode_operations; 293 inode->i_op = &v9fs_file_inode_operations;
277 } else { 294 } else {
278 P9_DPRINTK(P9_DEBUG_ERROR, 295 p9_debug(P9_DEBUG_ERROR,
279 "special files without extended mode\n"); 296 "special files without extended mode\n");
280 err = -EINVAL; 297 err = -EINVAL;
281 goto error; 298 goto error;
282 } 299 }
@@ -301,8 +318,8 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,
301 break; 318 break;
302 case S_IFLNK: 319 case S_IFLNK:
303 if (!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses)) { 320 if (!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses)) {
304 P9_DPRINTK(P9_DEBUG_ERROR, "extended modes used with " 321 p9_debug(P9_DEBUG_ERROR,
305 "legacy protocol.\n"); 322 "extended modes used with legacy protocol\n");
306 err = -EINVAL; 323 err = -EINVAL;
307 goto error; 324 goto error;
308 } 325 }
@@ -329,8 +346,8 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,
329 346
330 break; 347 break;
331 default: 348 default:
332 P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%hx S_IFMT 0x%x\n", 349 p9_debug(P9_DEBUG_ERROR, "BAD mode 0x%hx S_IFMT 0x%x\n",
333 mode, mode & S_IFMT); 350 mode, mode & S_IFMT);
334 err = -EINVAL; 351 err = -EINVAL;
335 goto error; 352 goto error;
336 } 353 }
@@ -352,11 +369,12 @@ struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev)
352 struct inode *inode; 369 struct inode *inode;
353 struct v9fs_session_info *v9ses = sb->s_fs_info; 370 struct v9fs_session_info *v9ses = sb->s_fs_info;
354 371
355 P9_DPRINTK(P9_DEBUG_VFS, "super block: %p mode: %ho\n", sb, mode); 372 p9_debug(P9_DEBUG_VFS, "super block: %p mode: %ho\n", sb, mode);
356 373
357 inode = new_inode(sb); 374 inode = new_inode(sb);
358 if (!inode) { 375 if (!inode) {
359 P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n"); 376 pr_warn("%s (%d): Problem allocating inode\n",
377 __func__, task_pid_nr(current));
360 return ERR_PTR(-ENOMEM); 378 return ERR_PTR(-ENOMEM);
361 } 379 }
362 err = v9fs_init_inode(v9ses, inode, mode, rdev); 380 err = v9fs_init_inode(v9ses, inode, mode, rdev);
@@ -573,15 +591,15 @@ static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags)
573 struct p9_fid *v9fid, *dfid; 591 struct p9_fid *v9fid, *dfid;
574 struct v9fs_session_info *v9ses; 592 struct v9fs_session_info *v9ses;
575 593
576 P9_DPRINTK(P9_DEBUG_VFS, "inode: %p dentry: %p rmdir: %x\n", 594 p9_debug(P9_DEBUG_VFS, "inode: %p dentry: %p rmdir: %x\n",
577 dir, dentry, flags); 595 dir, dentry, flags);
578 596
579 v9ses = v9fs_inode2v9ses(dir); 597 v9ses = v9fs_inode2v9ses(dir);
580 inode = dentry->d_inode; 598 inode = dentry->d_inode;
581 dfid = v9fs_fid_lookup(dentry->d_parent); 599 dfid = v9fs_fid_lookup(dentry->d_parent);
582 if (IS_ERR(dfid)) { 600 if (IS_ERR(dfid)) {
583 retval = PTR_ERR(dfid); 601 retval = PTR_ERR(dfid);
584 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", retval); 602 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", retval);
585 return retval; 603 return retval;
586 } 604 }
587 if (v9fs_proto_dotl(v9ses)) 605 if (v9fs_proto_dotl(v9ses))
@@ -630,7 +648,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
630 struct p9_fid *dfid, *ofid, *fid; 648 struct p9_fid *dfid, *ofid, *fid;
631 struct inode *inode; 649 struct inode *inode;
632 650
633 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name); 651 p9_debug(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
634 652
635 err = 0; 653 err = 0;
636 ofid = NULL; 654 ofid = NULL;
@@ -639,7 +657,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
639 dfid = v9fs_fid_lookup(dentry->d_parent); 657 dfid = v9fs_fid_lookup(dentry->d_parent);
640 if (IS_ERR(dfid)) { 658 if (IS_ERR(dfid)) {
641 err = PTR_ERR(dfid); 659 err = PTR_ERR(dfid);
642 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 660 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
643 return ERR_PTR(err); 661 return ERR_PTR(err);
644 } 662 }
645 663
@@ -647,36 +665,41 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
647 ofid = p9_client_walk(dfid, 0, NULL, 1); 665 ofid = p9_client_walk(dfid, 0, NULL, 1);
648 if (IS_ERR(ofid)) { 666 if (IS_ERR(ofid)) {
649 err = PTR_ERR(ofid); 667 err = PTR_ERR(ofid);
650 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); 668 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
651 return ERR_PTR(err); 669 return ERR_PTR(err);
652 } 670 }
653 671
654 err = p9_client_fcreate(ofid, name, perm, mode, extension); 672 err = p9_client_fcreate(ofid, name, perm, mode, extension);
655 if (err < 0) { 673 if (err < 0) {
656 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_fcreate failed %d\n", err); 674 p9_debug(P9_DEBUG_VFS, "p9_client_fcreate failed %d\n", err);
657 goto error;
658 }
659
660 /* now walk from the parent so we can get unopened fid */
661 fid = p9_client_walk(dfid, 1, &name, 1);
662 if (IS_ERR(fid)) {
663 err = PTR_ERR(fid);
664 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
665 fid = NULL;
666 goto error; 675 goto error;
667 } 676 }
668 677
669 /* instantiate inode and assign the unopened fid to the dentry */ 678 if (!(perm & P9_DMLINK)) {
670 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 679 /* now walk from the parent so we can get unopened fid */
671 if (IS_ERR(inode)) { 680 fid = p9_client_walk(dfid, 1, &name, 1);
672 err = PTR_ERR(inode); 681 if (IS_ERR(fid)) {
673 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err); 682 err = PTR_ERR(fid);
674 goto error; 683 p9_debug(P9_DEBUG_VFS,
684 "p9_client_walk failed %d\n", err);
685 fid = NULL;
686 goto error;
687 }
688 /*
689 * instantiate inode and assign the unopened fid to the dentry
690 */
691 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
692 if (IS_ERR(inode)) {
693 err = PTR_ERR(inode);
694 p9_debug(P9_DEBUG_VFS,
695 "inode creation failed %d\n", err);
696 goto error;
697 }
698 err = v9fs_fid_add(dentry, fid);
699 if (err < 0)
700 goto error;
701 d_instantiate(dentry, inode);
675 } 702 }
676 err = v9fs_fid_add(dentry, fid);
677 if (err < 0)
678 goto error;
679 d_instantiate(dentry, inode);
680 return ofid; 703 return ofid;
681error: 704error:
682 if (ofid) 705 if (ofid)
@@ -788,7 +811,7 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
788 struct p9_fid *fid; 811 struct p9_fid *fid;
789 struct v9fs_session_info *v9ses; 812 struct v9fs_session_info *v9ses;
790 813
791 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name); 814 p9_debug(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
792 err = 0; 815 err = 0;
793 v9ses = v9fs_inode2v9ses(dir); 816 v9ses = v9fs_inode2v9ses(dir);
794 perm = unixmode2p9mode(v9ses, mode | S_IFDIR); 817 perm = unixmode2p9mode(v9ses, mode | S_IFDIR);
@@ -826,8 +849,8 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
826 char *name; 849 char *name;
827 int result = 0; 850 int result = 0;
828 851
829 P9_DPRINTK(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n", 852 p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",
830 dir, dentry->d_name.name, dentry, nameidata); 853 dir, dentry->d_name.name, dentry, nameidata);
831 854
832 if (dentry->d_name.len > NAME_MAX) 855 if (dentry->d_name.len > NAME_MAX)
833 return ERR_PTR(-ENAMETOOLONG); 856 return ERR_PTR(-ENAMETOOLONG);
@@ -933,7 +956,7 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
933 struct p9_fid *newdirfid; 956 struct p9_fid *newdirfid;
934 struct p9_wstat wstat; 957 struct p9_wstat wstat;
935 958
936 P9_DPRINTK(P9_DEBUG_VFS, "\n"); 959 p9_debug(P9_DEBUG_VFS, "\n");
937 retval = 0; 960 retval = 0;
938 old_inode = old_dentry->d_inode; 961 old_inode = old_dentry->d_inode;
939 new_inode = new_dentry->d_inode; 962 new_inode = new_dentry->d_inode;
@@ -969,8 +992,7 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
969 * 9P .u can only handle file rename in the same directory 992 * 9P .u can only handle file rename in the same directory
970 */ 993 */
971 994
972 P9_DPRINTK(P9_DEBUG_ERROR, 995 p9_debug(P9_DEBUG_ERROR, "old dir and new dir are different\n");
973 "old dir and new dir are different\n");
974 retval = -EXDEV; 996 retval = -EXDEV;
975 goto clunk_newdir; 997 goto clunk_newdir;
976 } 998 }
@@ -1026,7 +1048,7 @@ v9fs_vfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
1026 struct p9_fid *fid; 1048 struct p9_fid *fid;
1027 struct p9_wstat *st; 1049 struct p9_wstat *st;
1028 1050
1029 P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry); 1051 p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
1030 err = -EPERM; 1052 err = -EPERM;
1031 v9ses = v9fs_dentry2v9ses(dentry); 1053 v9ses = v9fs_dentry2v9ses(dentry);
1032 if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) { 1054 if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
@@ -1063,7 +1085,7 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
1063 struct p9_fid *fid; 1085 struct p9_fid *fid;
1064 struct p9_wstat wstat; 1086 struct p9_wstat wstat;
1065 1087
1066 P9_DPRINTK(P9_DEBUG_VFS, "\n"); 1088 p9_debug(P9_DEBUG_VFS, "\n");
1067 retval = inode_change_ok(dentry->d_inode, iattr); 1089 retval = inode_change_ok(dentry->d_inode, iattr);
1068 if (retval) 1090 if (retval)
1069 return retval; 1091 return retval;
@@ -1162,7 +1184,7 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
1162 set_nlink(inode, i_nlink); 1184 set_nlink(inode, i_nlink);
1163 } 1185 }
1164 } 1186 }
1165 mode = stat->mode & S_IALLUGO; 1187 mode = p9mode2perm(v9ses, stat);
1166 mode |= inode->i_mode & ~S_IALLUGO; 1188 mode |= inode->i_mode & ~S_IALLUGO;
1167 inode->i_mode = mode; 1189 inode->i_mode = mode;
1168 i_size_write(inode, stat->length); 1190 i_size_write(inode, stat->length);
@@ -1208,7 +1230,7 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen)
1208 struct p9_fid *fid; 1230 struct p9_fid *fid;
1209 struct p9_wstat *st; 1231 struct p9_wstat *st;
1210 1232
1211 P9_DPRINTK(P9_DEBUG_VFS, " %s\n", dentry->d_name.name); 1233 p9_debug(P9_DEBUG_VFS, " %s\n", dentry->d_name.name);
1212 retval = -EPERM; 1234 retval = -EPERM;
1213 v9ses = v9fs_dentry2v9ses(dentry); 1235 v9ses = v9fs_dentry2v9ses(dentry);
1214 fid = v9fs_fid_lookup(dentry); 1236 fid = v9fs_fid_lookup(dentry);
@@ -1230,8 +1252,8 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen)
1230 /* copy extension buffer into buffer */ 1252 /* copy extension buffer into buffer */
1231 strncpy(buffer, st->extension, buflen); 1253 strncpy(buffer, st->extension, buflen);
1232 1254
1233 P9_DPRINTK(P9_DEBUG_VFS, 1255 p9_debug(P9_DEBUG_VFS, "%s -> %s (%s)\n",
1234 "%s -> %s (%s)\n", dentry->d_name.name, st->extension, buffer); 1256 dentry->d_name.name, st->extension, buffer);
1235 1257
1236 retval = strnlen(buffer, buflen); 1258 retval = strnlen(buffer, buflen);
1237done: 1259done:
@@ -1252,7 +1274,7 @@ static void *v9fs_vfs_follow_link(struct dentry *dentry, struct nameidata *nd)
1252 int len = 0; 1274 int len = 0;
1253 char *link = __getname(); 1275 char *link = __getname();
1254 1276
1255 P9_DPRINTK(P9_DEBUG_VFS, "%s n", dentry->d_name.name); 1277 p9_debug(P9_DEBUG_VFS, "%s\n", dentry->d_name.name);
1256 1278
1257 if (!link) 1279 if (!link)
1258 link = ERR_PTR(-ENOMEM); 1280 link = ERR_PTR(-ENOMEM);
@@ -1283,8 +1305,8 @@ v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
1283{ 1305{
1284 char *s = nd_get_link(nd); 1306 char *s = nd_get_link(nd);
1285 1307
1286 P9_DPRINTK(P9_DEBUG_VFS, " %s %s\n", dentry->d_name.name, 1308 p9_debug(P9_DEBUG_VFS, " %s %s\n",
1287 IS_ERR(s) ? "<error>" : s); 1309 dentry->d_name.name, IS_ERR(s) ? "<error>" : s);
1288 if (!IS_ERR(s)) 1310 if (!IS_ERR(s))
1289 __putname(s); 1311 __putname(s);
1290} 1312}
@@ -1306,7 +1328,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,
1306 1328
1307 v9ses = v9fs_inode2v9ses(dir); 1329 v9ses = v9fs_inode2v9ses(dir);
1308 if (!v9fs_proto_dotu(v9ses)) { 1330 if (!v9fs_proto_dotu(v9ses)) {
1309 P9_DPRINTK(P9_DEBUG_ERROR, "not extended\n"); 1331 p9_debug(P9_DEBUG_ERROR, "not extended\n");
1310 return -EPERM; 1332 return -EPERM;
1311 } 1333 }
1312 1334
@@ -1333,8 +1355,8 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,
1333static int 1355static int
1334v9fs_vfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) 1356v9fs_vfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
1335{ 1357{
1336 P9_DPRINTK(P9_DEBUG_VFS, " %lu,%s,%s\n", dir->i_ino, 1358 p9_debug(P9_DEBUG_VFS, " %lu,%s,%s\n",
1337 dentry->d_name.name, symname); 1359 dir->i_ino, dentry->d_name.name, symname);
1338 1360
1339 return v9fs_vfs_mkspecial(dir, dentry, P9_DMSYMLINK, symname); 1361 return v9fs_vfs_mkspecial(dir, dentry, P9_DMSYMLINK, symname);
1340} 1362}
@@ -1355,9 +1377,8 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir,
1355 char *name; 1377 char *name;
1356 struct p9_fid *oldfid; 1378 struct p9_fid *oldfid;
1357 1379
1358 P9_DPRINTK(P9_DEBUG_VFS, 1380 p9_debug(P9_DEBUG_VFS, " %lu,%s,%s\n",
1359 " %lu,%s,%s\n", dir->i_ino, dentry->d_name.name, 1381 dir->i_ino, dentry->d_name.name, old_dentry->d_name.name);
1360 old_dentry->d_name.name);
1361 1382
1362 oldfid = v9fs_fid_clone(old_dentry); 1383 oldfid = v9fs_fid_clone(old_dentry);
1363 if (IS_ERR(oldfid)) 1384 if (IS_ERR(oldfid))
@@ -1398,9 +1419,9 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rde
1398 char *name; 1419 char *name;
1399 u32 perm; 1420 u32 perm;
1400 1421
1401 P9_DPRINTK(P9_DEBUG_VFS, 1422 p9_debug(P9_DEBUG_VFS, " %lu,%s mode: %hx MAJOR: %u MINOR: %u\n",
1402 " %lu,%s mode: %hx MAJOR: %u MINOR: %u\n", dir->i_ino, 1423 dir->i_ino, dentry->d_name.name, mode,
1403 dentry->d_name.name, mode, MAJOR(rdev), MINOR(rdev)); 1424 MAJOR(rdev), MINOR(rdev));
1404 1425
1405 if (!new_valid_dev(rdev)) 1426 if (!new_valid_dev(rdev))
1406 return -EINVAL; 1427 return -EINVAL;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 8ef152ac6a16..a1e6c990cd41 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -283,13 +283,13 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
283 } 283 }
284 284
285 name = (char *) dentry->d_name.name; 285 name = (char *) dentry->d_name.name;
286 P9_DPRINTK(P9_DEBUG_VFS, "v9fs_vfs_create_dotl: name:%s flags:0x%x " 286 p9_debug(P9_DEBUG_VFS, "name:%s flags:0x%x mode:0x%hx\n",
287 "mode:0x%hx\n", name, flags, omode); 287 name, flags, omode);
288 288
289 dfid = v9fs_fid_lookup(dentry->d_parent); 289 dfid = v9fs_fid_lookup(dentry->d_parent);
290 if (IS_ERR(dfid)) { 290 if (IS_ERR(dfid)) {
291 err = PTR_ERR(dfid); 291 err = PTR_ERR(dfid);
292 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 292 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
293 return err; 293 return err;
294 } 294 }
295 295
@@ -297,7 +297,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
297 ofid = p9_client_walk(dfid, 0, NULL, 1); 297 ofid = p9_client_walk(dfid, 0, NULL, 1);
298 if (IS_ERR(ofid)) { 298 if (IS_ERR(ofid)) {
299 err = PTR_ERR(ofid); 299 err = PTR_ERR(ofid);
300 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); 300 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
301 return err; 301 return err;
302 } 302 }
303 303
@@ -307,16 +307,15 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
307 /* Update mode based on ACL value */ 307 /* Update mode based on ACL value */
308 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl); 308 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
309 if (err) { 309 if (err) {
310 P9_DPRINTK(P9_DEBUG_VFS, 310 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n",
311 "Failed to get acl values in creat %d\n", err); 311 err);
312 goto error; 312 goto error;
313 } 313 }
314 err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags), 314 err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags),
315 mode, gid, &qid); 315 mode, gid, &qid);
316 if (err < 0) { 316 if (err < 0) {
317 P9_DPRINTK(P9_DEBUG_VFS, 317 p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n",
318 "p9_client_open_dotl failed in creat %d\n", 318 err);
319 err);
320 goto error; 319 goto error;
321 } 320 }
322 v9fs_invalidate_inode_attr(dir); 321 v9fs_invalidate_inode_attr(dir);
@@ -325,14 +324,14 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
325 fid = p9_client_walk(dfid, 1, &name, 1); 324 fid = p9_client_walk(dfid, 1, &name, 1);
326 if (IS_ERR(fid)) { 325 if (IS_ERR(fid)) {
327 err = PTR_ERR(fid); 326 err = PTR_ERR(fid);
328 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); 327 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
329 fid = NULL; 328 fid = NULL;
330 goto error; 329 goto error;
331 } 330 }
332 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 331 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
333 if (IS_ERR(inode)) { 332 if (IS_ERR(inode)) {
334 err = PTR_ERR(inode); 333 err = PTR_ERR(inode);
335 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err); 334 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n", err);
336 goto error; 335 goto error;
337 } 336 }
338 err = v9fs_fid_add(dentry, fid); 337 err = v9fs_fid_add(dentry, fid);
@@ -408,7 +407,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
408 struct dentry *dir_dentry; 407 struct dentry *dir_dentry;
409 struct posix_acl *dacl = NULL, *pacl = NULL; 408 struct posix_acl *dacl = NULL, *pacl = NULL;
410 409
411 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name); 410 p9_debug(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
412 err = 0; 411 err = 0;
413 v9ses = v9fs_inode2v9ses(dir); 412 v9ses = v9fs_inode2v9ses(dir);
414 413
@@ -420,7 +419,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
420 dfid = v9fs_fid_lookup(dir_dentry); 419 dfid = v9fs_fid_lookup(dir_dentry);
421 if (IS_ERR(dfid)) { 420 if (IS_ERR(dfid)) {
422 err = PTR_ERR(dfid); 421 err = PTR_ERR(dfid);
423 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 422 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
424 dfid = NULL; 423 dfid = NULL;
425 goto error; 424 goto error;
426 } 425 }
@@ -430,8 +429,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
430 /* Update mode based on ACL value */ 429 /* Update mode based on ACL value */
431 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl); 430 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
432 if (err) { 431 if (err) {
433 P9_DPRINTK(P9_DEBUG_VFS, 432 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in mkdir %d\n",
434 "Failed to get acl values in mkdir %d\n", err); 433 err);
435 goto error; 434 goto error;
436 } 435 }
437 name = (char *) dentry->d_name.name; 436 name = (char *) dentry->d_name.name;
@@ -444,8 +443,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
444 fid = p9_client_walk(dfid, 1, &name, 1); 443 fid = p9_client_walk(dfid, 1, &name, 1);
445 if (IS_ERR(fid)) { 444 if (IS_ERR(fid)) {
446 err = PTR_ERR(fid); 445 err = PTR_ERR(fid);
447 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", 446 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
448 err); 447 err);
449 fid = NULL; 448 fid = NULL;
450 goto error; 449 goto error;
451 } 450 }
@@ -453,8 +452,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
453 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 452 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
454 if (IS_ERR(inode)) { 453 if (IS_ERR(inode)) {
455 err = PTR_ERR(inode); 454 err = PTR_ERR(inode);
456 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", 455 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
457 err); 456 err);
458 goto error; 457 goto error;
459 } 458 }
460 err = v9fs_fid_add(dentry, fid); 459 err = v9fs_fid_add(dentry, fid);
@@ -495,7 +494,7 @@ v9fs_vfs_getattr_dotl(struct vfsmount *mnt, struct dentry *dentry,
495 struct p9_fid *fid; 494 struct p9_fid *fid;
496 struct p9_stat_dotl *st; 495 struct p9_stat_dotl *st;
497 496
498 P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry); 497 p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
499 err = -EPERM; 498 err = -EPERM;
500 v9ses = v9fs_dentry2v9ses(dentry); 499 v9ses = v9fs_dentry2v9ses(dentry);
501 if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) { 500 if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
@@ -523,6 +522,46 @@ v9fs_vfs_getattr_dotl(struct vfsmount *mnt, struct dentry *dentry,
523 return 0; 522 return 0;
524} 523}
525 524
525/*
526 * Attribute flags.
527 */
528#define P9_ATTR_MODE (1 << 0)
529#define P9_ATTR_UID (1 << 1)
530#define P9_ATTR_GID (1 << 2)
531#define P9_ATTR_SIZE (1 << 3)
532#define P9_ATTR_ATIME (1 << 4)
533#define P9_ATTR_MTIME (1 << 5)
534#define P9_ATTR_CTIME (1 << 6)
535#define P9_ATTR_ATIME_SET (1 << 7)
536#define P9_ATTR_MTIME_SET (1 << 8)
537
538struct dotl_iattr_map {
539 int iattr_valid;
540 int p9_iattr_valid;
541};
542
543static int v9fs_mapped_iattr_valid(int iattr_valid)
544{
545 int i;
546 int p9_iattr_valid = 0;
547 struct dotl_iattr_map dotl_iattr_map[] = {
548 { ATTR_MODE, P9_ATTR_MODE },
549 { ATTR_UID, P9_ATTR_UID },
550 { ATTR_GID, P9_ATTR_GID },
551 { ATTR_SIZE, P9_ATTR_SIZE },
552 { ATTR_ATIME, P9_ATTR_ATIME },
553 { ATTR_MTIME, P9_ATTR_MTIME },
554 { ATTR_CTIME, P9_ATTR_CTIME },
555 { ATTR_ATIME_SET, P9_ATTR_ATIME_SET },
556 { ATTR_MTIME_SET, P9_ATTR_MTIME_SET },
557 };
558 for (i = 0; i < ARRAY_SIZE(dotl_iattr_map); i++) {
559 if (iattr_valid & dotl_iattr_map[i].iattr_valid)
560 p9_iattr_valid |= dotl_iattr_map[i].p9_iattr_valid;
561 }
562 return p9_iattr_valid;
563}
564
526/** 565/**
527 * v9fs_vfs_setattr_dotl - set file metadata 566 * v9fs_vfs_setattr_dotl - set file metadata
528 * @dentry: file whose metadata to set 567 * @dentry: file whose metadata to set
@@ -537,13 +576,13 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
537 struct p9_fid *fid; 576 struct p9_fid *fid;
538 struct p9_iattr_dotl p9attr; 577 struct p9_iattr_dotl p9attr;
539 578
540 P9_DPRINTK(P9_DEBUG_VFS, "\n"); 579 p9_debug(P9_DEBUG_VFS, "\n");
541 580
542 retval = inode_change_ok(dentry->d_inode, iattr); 581 retval = inode_change_ok(dentry->d_inode, iattr);
543 if (retval) 582 if (retval)
544 return retval; 583 return retval;
545 584
546 p9attr.valid = iattr->ia_valid; 585 p9attr.valid = v9fs_mapped_iattr_valid(iattr->ia_valid);
547 p9attr.mode = iattr->ia_mode; 586 p9attr.mode = iattr->ia_mode;
548 p9attr.uid = iattr->ia_uid; 587 p9attr.uid = iattr->ia_uid;
549 p9attr.gid = iattr->ia_gid; 588 p9attr.gid = iattr->ia_gid;
@@ -670,14 +709,13 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
670 struct v9fs_session_info *v9ses; 709 struct v9fs_session_info *v9ses;
671 710
672 name = (char *) dentry->d_name.name; 711 name = (char *) dentry->d_name.name;
673 P9_DPRINTK(P9_DEBUG_VFS, "v9fs_vfs_symlink_dotl : %lu,%s,%s\n", 712 p9_debug(P9_DEBUG_VFS, "%lu,%s,%s\n", dir->i_ino, name, symname);
674 dir->i_ino, name, symname);
675 v9ses = v9fs_inode2v9ses(dir); 713 v9ses = v9fs_inode2v9ses(dir);
676 714
677 dfid = v9fs_fid_lookup(dentry->d_parent); 715 dfid = v9fs_fid_lookup(dentry->d_parent);
678 if (IS_ERR(dfid)) { 716 if (IS_ERR(dfid)) {
679 err = PTR_ERR(dfid); 717 err = PTR_ERR(dfid);
680 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 718 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
681 return err; 719 return err;
682 } 720 }
683 721
@@ -687,7 +725,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
687 err = p9_client_symlink(dfid, name, (char *)symname, gid, &qid); 725 err = p9_client_symlink(dfid, name, (char *)symname, gid, &qid);
688 726
689 if (err < 0) { 727 if (err < 0) {
690 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_symlink failed %d\n", err); 728 p9_debug(P9_DEBUG_VFS, "p9_client_symlink failed %d\n", err);
691 goto error; 729 goto error;
692 } 730 }
693 731
@@ -697,8 +735,8 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
697 fid = p9_client_walk(dfid, 1, &name, 1); 735 fid = p9_client_walk(dfid, 1, &name, 1);
698 if (IS_ERR(fid)) { 736 if (IS_ERR(fid)) {
699 err = PTR_ERR(fid); 737 err = PTR_ERR(fid);
700 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", 738 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
701 err); 739 err);
702 fid = NULL; 740 fid = NULL;
703 goto error; 741 goto error;
704 } 742 }
@@ -707,8 +745,8 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
707 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 745 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
708 if (IS_ERR(inode)) { 746 if (IS_ERR(inode)) {
709 err = PTR_ERR(inode); 747 err = PTR_ERR(inode);
710 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", 748 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
711 err); 749 err);
712 goto error; 750 goto error;
713 } 751 }
714 err = v9fs_fid_add(dentry, fid); 752 err = v9fs_fid_add(dentry, fid);
@@ -751,9 +789,8 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
751 struct p9_fid *dfid, *oldfid; 789 struct p9_fid *dfid, *oldfid;
752 struct v9fs_session_info *v9ses; 790 struct v9fs_session_info *v9ses;
753 791
754 P9_DPRINTK(P9_DEBUG_VFS, "dir ino: %lu, old_name: %s, new_name: %s\n", 792 p9_debug(P9_DEBUG_VFS, "dir ino: %lu, old_name: %s, new_name: %s\n",
755 dir->i_ino, old_dentry->d_name.name, 793 dir->i_ino, old_dentry->d_name.name, dentry->d_name.name);
756 dentry->d_name.name);
757 794
758 v9ses = v9fs_inode2v9ses(dir); 795 v9ses = v9fs_inode2v9ses(dir);
759 dir_dentry = v9fs_dentry_from_dir_inode(dir); 796 dir_dentry = v9fs_dentry_from_dir_inode(dir);
@@ -770,7 +807,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
770 err = p9_client_link(dfid, oldfid, (char *)dentry->d_name.name); 807 err = p9_client_link(dfid, oldfid, (char *)dentry->d_name.name);
771 808
772 if (err < 0) { 809 if (err < 0) {
773 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_link failed %d\n", err); 810 p9_debug(P9_DEBUG_VFS, "p9_client_link failed %d\n", err);
774 return err; 811 return err;
775 } 812 }
776 813
@@ -813,9 +850,9 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
813 struct dentry *dir_dentry; 850 struct dentry *dir_dentry;
814 struct posix_acl *dacl = NULL, *pacl = NULL; 851 struct posix_acl *dacl = NULL, *pacl = NULL;
815 852
816 P9_DPRINTK(P9_DEBUG_VFS, 853 p9_debug(P9_DEBUG_VFS, " %lu,%s mode: %hx MAJOR: %u MINOR: %u\n",
817 " %lu,%s mode: %hx MAJOR: %u MINOR: %u\n", dir->i_ino, 854 dir->i_ino, dentry->d_name.name, omode,
818 dentry->d_name.name, omode, MAJOR(rdev), MINOR(rdev)); 855 MAJOR(rdev), MINOR(rdev));
819 856
820 if (!new_valid_dev(rdev)) 857 if (!new_valid_dev(rdev))
821 return -EINVAL; 858 return -EINVAL;
@@ -825,7 +862,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
825 dfid = v9fs_fid_lookup(dir_dentry); 862 dfid = v9fs_fid_lookup(dir_dentry);
826 if (IS_ERR(dfid)) { 863 if (IS_ERR(dfid)) {
827 err = PTR_ERR(dfid); 864 err = PTR_ERR(dfid);
828 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 865 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
829 dfid = NULL; 866 dfid = NULL;
830 goto error; 867 goto error;
831 } 868 }
@@ -835,8 +872,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
835 /* Update mode based on ACL value */ 872 /* Update mode based on ACL value */
836 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl); 873 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
837 if (err) { 874 if (err) {
838 P9_DPRINTK(P9_DEBUG_VFS, 875 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in mknod %d\n",
839 "Failed to get acl values in mknod %d\n", err); 876 err);
840 goto error; 877 goto error;
841 } 878 }
842 name = (char *) dentry->d_name.name; 879 name = (char *) dentry->d_name.name;
@@ -851,8 +888,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
851 fid = p9_client_walk(dfid, 1, &name, 1); 888 fid = p9_client_walk(dfid, 1, &name, 1);
852 if (IS_ERR(fid)) { 889 if (IS_ERR(fid)) {
853 err = PTR_ERR(fid); 890 err = PTR_ERR(fid);
854 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", 891 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
855 err); 892 err);
856 fid = NULL; 893 fid = NULL;
857 goto error; 894 goto error;
858 } 895 }
@@ -860,8 +897,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
860 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 897 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
861 if (IS_ERR(inode)) { 898 if (IS_ERR(inode)) {
862 err = PTR_ERR(inode); 899 err = PTR_ERR(inode);
863 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", 900 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
864 err); 901 err);
865 goto error; 902 goto error;
866 } 903 }
867 err = v9fs_fid_add(dentry, fid); 904 err = v9fs_fid_add(dentry, fid);
@@ -905,7 +942,7 @@ v9fs_vfs_follow_link_dotl(struct dentry *dentry, struct nameidata *nd)
905 char *link = __getname(); 942 char *link = __getname();
906 char *target; 943 char *target;
907 944
908 P9_DPRINTK(P9_DEBUG_VFS, "%s\n", dentry->d_name.name); 945 p9_debug(P9_DEBUG_VFS, "%s\n", dentry->d_name.name);
909 946
910 if (!link) { 947 if (!link) {
911 link = ERR_PTR(-ENOMEM); 948 link = ERR_PTR(-ENOMEM);
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index f68ff65a32a5..7b0cd87b07c2 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -121,7 +121,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
121 struct p9_fid *fid; 121 struct p9_fid *fid;
122 int retval = 0; 122 int retval = 0;
123 123
124 P9_DPRINTK(P9_DEBUG_VFS, " \n"); 124 p9_debug(P9_DEBUG_VFS, "\n");
125 125
126 v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); 126 v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
127 if (!v9ses) 127 if (!v9ses)
@@ -191,7 +191,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
191 goto release_sb; 191 goto release_sb;
192 v9fs_fid_add(root, fid); 192 v9fs_fid_add(root, fid);
193 193
194 P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n"); 194 p9_debug(P9_DEBUG_VFS, " simple set mount, return 0\n");
195 return dget(sb->s_root); 195 return dget(sb->s_root);
196 196
197clunk_fid: 197clunk_fid:
@@ -223,7 +223,7 @@ static void v9fs_kill_super(struct super_block *s)
223{ 223{
224 struct v9fs_session_info *v9ses = s->s_fs_info; 224 struct v9fs_session_info *v9ses = s->s_fs_info;
225 225
226 P9_DPRINTK(P9_DEBUG_VFS, " %p\n", s); 226 p9_debug(P9_DEBUG_VFS, " %p\n", s);
227 227
228 kill_anon_super(s); 228 kill_anon_super(s);
229 229
@@ -231,7 +231,7 @@ static void v9fs_kill_super(struct super_block *s)
231 v9fs_session_close(v9ses); 231 v9fs_session_close(v9ses);
232 kfree(v9ses); 232 kfree(v9ses);
233 s->s_fs_info = NULL; 233 s->s_fs_info = NULL;
234 P9_DPRINTK(P9_DEBUG_VFS, "exiting kill_super\n"); 234 p9_debug(P9_DEBUG_VFS, "exiting kill_super\n");
235} 235}
236 236
237static void 237static void
@@ -303,7 +303,7 @@ static int v9fs_write_inode(struct inode *inode,
303 * send an fsync request to server irrespective of 303 * send an fsync request to server irrespective of
304 * wbc->sync_mode. 304 * wbc->sync_mode.
305 */ 305 */
306 P9_DPRINTK(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode); 306 p9_debug(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
307 v9inode = V9FS_I(inode); 307 v9inode = V9FS_I(inode);
308 if (!v9inode->writeback_fid) 308 if (!v9inode->writeback_fid)
309 return 0; 309 return 0;
@@ -326,7 +326,7 @@ static int v9fs_write_inode_dotl(struct inode *inode,
326 * send an fsync request to server irrespective of 326 * send an fsync request to server irrespective of
327 * wbc->sync_mode. 327 * wbc->sync_mode.
328 */ 328 */
329 P9_DPRINTK(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode); 329 p9_debug(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
330 v9inode = V9FS_I(inode); 330 v9inode = V9FS_I(inode);
331 if (!v9inode->writeback_fid) 331 if (!v9inode->writeback_fid)
332 return 0; 332 return 0;
diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c
index d288773871b3..29653b70a9c3 100644
--- a/fs/9p/xattr.c
+++ b/fs/9p/xattr.c
@@ -32,8 +32,8 @@ ssize_t v9fs_fid_xattr_get(struct p9_fid *fid, const char *name,
32 attr_fid = p9_client_xattrwalk(fid, name, &attr_size); 32 attr_fid = p9_client_xattrwalk(fid, name, &attr_size);
33 if (IS_ERR(attr_fid)) { 33 if (IS_ERR(attr_fid)) {
34 retval = PTR_ERR(attr_fid); 34 retval = PTR_ERR(attr_fid);
35 P9_DPRINTK(P9_DEBUG_VFS, 35 p9_debug(P9_DEBUG_VFS, "p9_client_attrwalk failed %zd\n",
36 "p9_client_attrwalk failed %zd\n", retval); 36 retval);
37 attr_fid = NULL; 37 attr_fid = NULL;
38 goto error; 38 goto error;
39 } 39 }
@@ -87,8 +87,8 @@ ssize_t v9fs_xattr_get(struct dentry *dentry, const char *name,
87{ 87{
88 struct p9_fid *fid; 88 struct p9_fid *fid;
89 89
90 P9_DPRINTK(P9_DEBUG_VFS, "%s: name = %s value_len = %zu\n", 90 p9_debug(P9_DEBUG_VFS, "name = %s value_len = %zu\n",
91 __func__, name, buffer_size); 91 name, buffer_size);
92 fid = v9fs_fid_lookup(dentry); 92 fid = v9fs_fid_lookup(dentry);
93 if (IS_ERR(fid)) 93 if (IS_ERR(fid))
94 return PTR_ERR(fid); 94 return PTR_ERR(fid);
@@ -115,8 +115,8 @@ int v9fs_xattr_set(struct dentry *dentry, const char *name,
115 int retval, msize, write_count; 115 int retval, msize, write_count;
116 struct p9_fid *fid = NULL; 116 struct p9_fid *fid = NULL;
117 117
118 P9_DPRINTK(P9_DEBUG_VFS, "%s: name = %s value_len = %zu flags = %d\n", 118 p9_debug(P9_DEBUG_VFS, "name = %s value_len = %zu flags = %d\n",
119 __func__, name, value_len, flags); 119 name, value_len, flags);
120 120
121 fid = v9fs_fid_clone(dentry); 121 fid = v9fs_fid_clone(dentry);
122 if (IS_ERR(fid)) { 122 if (IS_ERR(fid)) {
@@ -129,8 +129,8 @@ int v9fs_xattr_set(struct dentry *dentry, const char *name,
129 */ 129 */
130 retval = p9_client_xattrcreate(fid, name, value_len, flags); 130 retval = p9_client_xattrcreate(fid, name, value_len, flags);
131 if (retval < 0) { 131 if (retval < 0) {
132 P9_DPRINTK(P9_DEBUG_VFS, 132 p9_debug(P9_DEBUG_VFS, "p9_client_xattrcreate failed %d\n",
133 "p9_client_xattrcreate failed %d\n", retval); 133 retval);
134 goto error; 134 goto error;
135 } 135 }
136 msize = fid->clnt->msize; 136 msize = fid->clnt->msize;