diff options
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 206632887bb4..df5ac048dc74 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -387,9 +387,6 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, | |||
387 | if (fc->no_create) | 387 | if (fc->no_create) |
388 | return -ENOSYS; | 388 | return -ENOSYS; |
389 | 389 | ||
390 | if (flags & O_DIRECT) | ||
391 | return -EINVAL; | ||
392 | |||
393 | forget = fuse_alloc_forget(); | 390 | forget = fuse_alloc_forget(); |
394 | if (!forget) | 391 | if (!forget) |
395 | return -ENOMEM; | 392 | return -ENOMEM; |
@@ -644,13 +641,12 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry) | |||
644 | fuse_put_request(fc, req); | 641 | fuse_put_request(fc, req); |
645 | if (!err) { | 642 | if (!err) { |
646 | struct inode *inode = entry->d_inode; | 643 | struct inode *inode = entry->d_inode; |
644 | struct fuse_inode *fi = get_fuse_inode(inode); | ||
647 | 645 | ||
648 | /* | 646 | spin_lock(&fc->lock); |
649 | * Set nlink to zero so the inode can be cleared, if the inode | 647 | fi->attr_version = ++fc->attr_version; |
650 | * does have more links this will be discovered at the next | 648 | drop_nlink(inode); |
651 | * lookup/getattr. | 649 | spin_unlock(&fc->lock); |
652 | */ | ||
653 | clear_nlink(inode); | ||
654 | fuse_invalidate_attr(inode); | 650 | fuse_invalidate_attr(inode); |
655 | fuse_invalidate_attr(dir); | 651 | fuse_invalidate_attr(dir); |
656 | fuse_invalidate_entry_cache(entry); | 652 | fuse_invalidate_entry_cache(entry); |
@@ -762,8 +758,17 @@ static int fuse_link(struct dentry *entry, struct inode *newdir, | |||
762 | will reflect changes in the backing inode (link count, | 758 | will reflect changes in the backing inode (link count, |
763 | etc.) | 759 | etc.) |
764 | */ | 760 | */ |
765 | if (!err || err == -EINTR) | 761 | if (!err) { |
762 | struct fuse_inode *fi = get_fuse_inode(inode); | ||
763 | |||
764 | spin_lock(&fc->lock); | ||
765 | fi->attr_version = ++fc->attr_version; | ||
766 | inc_nlink(inode); | ||
767 | spin_unlock(&fc->lock); | ||
768 | fuse_invalidate_attr(inode); | ||
769 | } else if (err == -EINTR) { | ||
766 | fuse_invalidate_attr(inode); | 770 | fuse_invalidate_attr(inode); |
771 | } | ||
767 | return err; | 772 | return err; |
768 | } | 773 | } |
769 | 774 | ||