diff options
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 95bc22bdd060..fdff346e96fd 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | FUSE: Filesystem in Userspace | 2 | FUSE: Filesystem in Userspace |
3 | Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> | 3 | Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> |
4 | 4 | ||
5 | This program can be distributed under the terms of the GNU GPL. | 5 | This program can be distributed under the terms of the GNU GPL. |
6 | See the file COPYING. | 6 | See the file COPYING. |
@@ -189,7 +189,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) | |||
189 | parent = dget_parent(entry); | 189 | parent = dget_parent(entry); |
190 | fuse_lookup_init(fc, req, get_node_id(parent->d_inode), | 190 | fuse_lookup_init(fc, req, get_node_id(parent->d_inode), |
191 | &entry->d_name, &outarg); | 191 | &entry->d_name, &outarg); |
192 | request_send(fc, req); | 192 | fuse_request_send(fc, req); |
193 | dput(parent); | 193 | dput(parent); |
194 | err = req->out.h.error; | 194 | err = req->out.h.error; |
195 | fuse_put_request(fc, req); | 195 | fuse_put_request(fc, req); |
@@ -204,7 +204,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) | |||
204 | return 0; | 204 | return 0; |
205 | } | 205 | } |
206 | spin_lock(&fc->lock); | 206 | spin_lock(&fc->lock); |
207 | fi->nlookup ++; | 207 | fi->nlookup++; |
208 | spin_unlock(&fc->lock); | 208 | spin_unlock(&fc->lock); |
209 | } | 209 | } |
210 | fuse_put_request(fc, forget_req); | 210 | fuse_put_request(fc, forget_req); |
@@ -283,7 +283,7 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name, | |||
283 | attr_version = fuse_get_attr_version(fc); | 283 | attr_version = fuse_get_attr_version(fc); |
284 | 284 | ||
285 | fuse_lookup_init(fc, req, nodeid, name, outarg); | 285 | fuse_lookup_init(fc, req, nodeid, name, outarg); |
286 | request_send(fc, req); | 286 | fuse_request_send(fc, req); |
287 | err = req->out.h.error; | 287 | err = req->out.h.error; |
288 | fuse_put_request(fc, req); | 288 | fuse_put_request(fc, req); |
289 | /* Zero nodeid is same as -ENOENT, but with valid timeout */ | 289 | /* Zero nodeid is same as -ENOENT, but with valid timeout */ |
@@ -369,7 +369,7 @@ static void fuse_sync_release(struct fuse_conn *fc, struct fuse_file *ff, | |||
369 | { | 369 | { |
370 | fuse_release_fill(ff, nodeid, flags, FUSE_RELEASE); | 370 | fuse_release_fill(ff, nodeid, flags, FUSE_RELEASE); |
371 | ff->reserved_req->force = 1; | 371 | ff->reserved_req->force = 1; |
372 | request_send(fc, ff->reserved_req); | 372 | fuse_request_send(fc, ff->reserved_req); |
373 | fuse_put_request(fc, ff->reserved_req); | 373 | fuse_put_request(fc, ff->reserved_req); |
374 | kfree(ff); | 374 | kfree(ff); |
375 | } | 375 | } |
@@ -408,7 +408,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode, | |||
408 | goto out_put_forget_req; | 408 | goto out_put_forget_req; |
409 | 409 | ||
410 | err = -ENOMEM; | 410 | err = -ENOMEM; |
411 | ff = fuse_file_alloc(); | 411 | ff = fuse_file_alloc(fc); |
412 | if (!ff) | 412 | if (!ff) |
413 | goto out_put_request; | 413 | goto out_put_request; |
414 | 414 | ||
@@ -432,7 +432,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode, | |||
432 | req->out.args[0].value = &outentry; | 432 | req->out.args[0].value = &outentry; |
433 | req->out.args[1].size = sizeof(outopen); | 433 | req->out.args[1].size = sizeof(outopen); |
434 | req->out.args[1].value = &outopen; | 434 | req->out.args[1].value = &outopen; |
435 | request_send(fc, req); | 435 | fuse_request_send(fc, req); |
436 | err = req->out.h.error; | 436 | err = req->out.h.error; |
437 | if (err) { | 437 | if (err) { |
438 | if (err == -ENOSYS) | 438 | if (err == -ENOSYS) |
@@ -502,7 +502,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req, | |||
502 | else | 502 | else |
503 | req->out.args[0].size = sizeof(outarg); | 503 | req->out.args[0].size = sizeof(outarg); |
504 | req->out.args[0].value = &outarg; | 504 | req->out.args[0].value = &outarg; |
505 | request_send(fc, req); | 505 | fuse_request_send(fc, req); |
506 | err = req->out.h.error; | 506 | err = req->out.h.error; |
507 | fuse_put_request(fc, req); | 507 | fuse_put_request(fc, req); |
508 | if (err) | 508 | if (err) |
@@ -631,15 +631,17 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry) | |||
631 | req->in.numargs = 1; | 631 | req->in.numargs = 1; |
632 | req->in.args[0].size = entry->d_name.len + 1; | 632 | req->in.args[0].size = entry->d_name.len + 1; |
633 | req->in.args[0].value = entry->d_name.name; | 633 | req->in.args[0].value = entry->d_name.name; |
634 | request_send(fc, req); | 634 | fuse_request_send(fc, req); |
635 | err = req->out.h.error; | 635 | err = req->out.h.error; |
636 | fuse_put_request(fc, req); | 636 | fuse_put_request(fc, req); |
637 | if (!err) { | 637 | if (!err) { |
638 | struct inode *inode = entry->d_inode; | 638 | struct inode *inode = entry->d_inode; |
639 | 639 | ||
640 | /* Set nlink to zero so the inode can be cleared, if | 640 | /* |
641 | the inode does have more links this will be | 641 | * Set nlink to zero so the inode can be cleared, if the inode |
642 | discovered at the next lookup/getattr */ | 642 | * does have more links this will be discovered at the next |
643 | * lookup/getattr. | ||
644 | */ | ||
643 | clear_nlink(inode); | 645 | clear_nlink(inode); |
644 | fuse_invalidate_attr(inode); | 646 | fuse_invalidate_attr(inode); |
645 | fuse_invalidate_attr(dir); | 647 | fuse_invalidate_attr(dir); |
@@ -662,7 +664,7 @@ static int fuse_rmdir(struct inode *dir, struct dentry *entry) | |||
662 | req->in.numargs = 1; | 664 | req->in.numargs = 1; |
663 | req->in.args[0].size = entry->d_name.len + 1; | 665 | req->in.args[0].size = entry->d_name.len + 1; |
664 | req->in.args[0].value = entry->d_name.name; | 666 | req->in.args[0].value = entry->d_name.name; |
665 | request_send(fc, req); | 667 | fuse_request_send(fc, req); |
666 | err = req->out.h.error; | 668 | err = req->out.h.error; |
667 | fuse_put_request(fc, req); | 669 | fuse_put_request(fc, req); |
668 | if (!err) { | 670 | if (!err) { |
@@ -695,7 +697,7 @@ static int fuse_rename(struct inode *olddir, struct dentry *oldent, | |||
695 | req->in.args[1].value = oldent->d_name.name; | 697 | req->in.args[1].value = oldent->d_name.name; |
696 | req->in.args[2].size = newent->d_name.len + 1; | 698 | req->in.args[2].size = newent->d_name.len + 1; |
697 | req->in.args[2].value = newent->d_name.name; | 699 | req->in.args[2].value = newent->d_name.name; |
698 | request_send(fc, req); | 700 | fuse_request_send(fc, req); |
699 | err = req->out.h.error; | 701 | err = req->out.h.error; |
700 | fuse_put_request(fc, req); | 702 | fuse_put_request(fc, req); |
701 | if (!err) { | 703 | if (!err) { |
@@ -811,7 +813,7 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat, | |||
811 | else | 813 | else |
812 | req->out.args[0].size = sizeof(outarg); | 814 | req->out.args[0].size = sizeof(outarg); |
813 | req->out.args[0].value = &outarg; | 815 | req->out.args[0].value = &outarg; |
814 | request_send(fc, req); | 816 | fuse_request_send(fc, req); |
815 | err = req->out.h.error; | 817 | err = req->out.h.error; |
816 | fuse_put_request(fc, req); | 818 | fuse_put_request(fc, req); |
817 | if (!err) { | 819 | if (!err) { |
@@ -911,7 +913,7 @@ static int fuse_access(struct inode *inode, int mask) | |||
911 | req->in.numargs = 1; | 913 | req->in.numargs = 1; |
912 | req->in.args[0].size = sizeof(inarg); | 914 | req->in.args[0].size = sizeof(inarg); |
913 | req->in.args[0].value = &inarg; | 915 | req->in.args[0].value = &inarg; |
914 | request_send(fc, req); | 916 | fuse_request_send(fc, req); |
915 | err = req->out.h.error; | 917 | err = req->out.h.error; |
916 | fuse_put_request(fc, req); | 918 | fuse_put_request(fc, req); |
917 | if (err == -ENOSYS) { | 919 | if (err == -ENOSYS) { |
@@ -1033,7 +1035,7 @@ static int fuse_readdir(struct file *file, void *dstbuf, filldir_t filldir) | |||
1033 | req->num_pages = 1; | 1035 | req->num_pages = 1; |
1034 | req->pages[0] = page; | 1036 | req->pages[0] = page; |
1035 | fuse_read_fill(req, file, inode, file->f_pos, PAGE_SIZE, FUSE_READDIR); | 1037 | fuse_read_fill(req, file, inode, file->f_pos, PAGE_SIZE, FUSE_READDIR); |
1036 | request_send(fc, req); | 1038 | fuse_request_send(fc, req); |
1037 | nbytes = req->out.args[0].size; | 1039 | nbytes = req->out.args[0].size; |
1038 | err = req->out.h.error; | 1040 | err = req->out.h.error; |
1039 | fuse_put_request(fc, req); | 1041 | fuse_put_request(fc, req); |
@@ -1067,7 +1069,7 @@ static char *read_link(struct dentry *dentry) | |||
1067 | req->out.numargs = 1; | 1069 | req->out.numargs = 1; |
1068 | req->out.args[0].size = PAGE_SIZE - 1; | 1070 | req->out.args[0].size = PAGE_SIZE - 1; |
1069 | req->out.args[0].value = link; | 1071 | req->out.args[0].value = link; |
1070 | request_send(fc, req); | 1072 | fuse_request_send(fc, req); |
1071 | if (req->out.h.error) { | 1073 | if (req->out.h.error) { |
1072 | free_page((unsigned long) link); | 1074 | free_page((unsigned long) link); |
1073 | link = ERR_PTR(req->out.h.error); | 1075 | link = ERR_PTR(req->out.h.error); |
@@ -1273,7 +1275,7 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, | |||
1273 | else | 1275 | else |
1274 | req->out.args[0].size = sizeof(outarg); | 1276 | req->out.args[0].size = sizeof(outarg); |
1275 | req->out.args[0].value = &outarg; | 1277 | req->out.args[0].value = &outarg; |
1276 | request_send(fc, req); | 1278 | fuse_request_send(fc, req); |
1277 | err = req->out.h.error; | 1279 | err = req->out.h.error; |
1278 | fuse_put_request(fc, req); | 1280 | fuse_put_request(fc, req); |
1279 | if (err) { | 1281 | if (err) { |
@@ -1367,7 +1369,7 @@ static int fuse_setxattr(struct dentry *entry, const char *name, | |||
1367 | req->in.args[1].value = name; | 1369 | req->in.args[1].value = name; |
1368 | req->in.args[2].size = size; | 1370 | req->in.args[2].size = size; |
1369 | req->in.args[2].value = value; | 1371 | req->in.args[2].value = value; |
1370 | request_send(fc, req); | 1372 | fuse_request_send(fc, req); |
1371 | err = req->out.h.error; | 1373 | err = req->out.h.error; |
1372 | fuse_put_request(fc, req); | 1374 | fuse_put_request(fc, req); |
1373 | if (err == -ENOSYS) { | 1375 | if (err == -ENOSYS) { |
@@ -1413,7 +1415,7 @@ static ssize_t fuse_getxattr(struct dentry *entry, const char *name, | |||
1413 | req->out.args[0].size = sizeof(outarg); | 1415 | req->out.args[0].size = sizeof(outarg); |
1414 | req->out.args[0].value = &outarg; | 1416 | req->out.args[0].value = &outarg; |
1415 | } | 1417 | } |
1416 | request_send(fc, req); | 1418 | fuse_request_send(fc, req); |
1417 | ret = req->out.h.error; | 1419 | ret = req->out.h.error; |
1418 | if (!ret) | 1420 | if (!ret) |
1419 | ret = size ? req->out.args[0].size : outarg.size; | 1421 | ret = size ? req->out.args[0].size : outarg.size; |
@@ -1463,7 +1465,7 @@ static ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size) | |||
1463 | req->out.args[0].size = sizeof(outarg); | 1465 | req->out.args[0].size = sizeof(outarg); |
1464 | req->out.args[0].value = &outarg; | 1466 | req->out.args[0].value = &outarg; |
1465 | } | 1467 | } |
1466 | request_send(fc, req); | 1468 | fuse_request_send(fc, req); |
1467 | ret = req->out.h.error; | 1469 | ret = req->out.h.error; |
1468 | if (!ret) | 1470 | if (!ret) |
1469 | ret = size ? req->out.args[0].size : outarg.size; | 1471 | ret = size ? req->out.args[0].size : outarg.size; |
@@ -1496,7 +1498,7 @@ static int fuse_removexattr(struct dentry *entry, const char *name) | |||
1496 | req->in.numargs = 1; | 1498 | req->in.numargs = 1; |
1497 | req->in.args[0].size = strlen(name) + 1; | 1499 | req->in.args[0].size = strlen(name) + 1; |
1498 | req->in.args[0].value = name; | 1500 | req->in.args[0].value = name; |
1499 | request_send(fc, req); | 1501 | fuse_request_send(fc, req); |
1500 | err = req->out.h.error; | 1502 | err = req->out.h.error; |
1501 | fuse_put_request(fc, req); | 1503 | fuse_put_request(fc, req); |
1502 | if (err == -ENOSYS) { | 1504 | if (err == -ENOSYS) { |