diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/hfsplus/dir.c | 23 | ||||
-rw-r--r-- | fs/nfs/file.c | 4 | ||||
-rw-r--r-- | fs/nfs/inode.c | 1 | ||||
-rw-r--r-- | fs/splice.c | 31 |
4 files changed, 26 insertions, 33 deletions
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 29683645fa0a..5f4023678251 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c | |||
@@ -340,16 +340,23 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry) | |||
340 | 340 | ||
341 | if (inode->i_nlink > 0) | 341 | if (inode->i_nlink > 0) |
342 | drop_nlink(inode); | 342 | drop_nlink(inode); |
343 | hfsplus_delete_inode(inode); | 343 | if (inode->i_ino == cnid) |
344 | if (inode->i_ino != cnid && !inode->i_nlink) { | 344 | clear_nlink(inode); |
345 | if (!atomic_read(&HFSPLUS_I(inode).opencnt)) { | 345 | if (!inode->i_nlink) { |
346 | res = hfsplus_delete_cat(inode->i_ino, HFSPLUS_SB(sb).hidden_dir, NULL); | 346 | if (inode->i_ino != cnid) { |
347 | if (!res) | 347 | HFSPLUS_SB(sb).file_count--; |
348 | hfsplus_delete_inode(inode); | 348 | if (!atomic_read(&HFSPLUS_I(inode).opencnt)) { |
349 | res = hfsplus_delete_cat(inode->i_ino, | ||
350 | HFSPLUS_SB(sb).hidden_dir, | ||
351 | NULL); | ||
352 | if (!res) | ||
353 | hfsplus_delete_inode(inode); | ||
354 | } else | ||
355 | inode->i_flags |= S_DEAD; | ||
349 | } else | 356 | } else |
350 | inode->i_flags |= S_DEAD; | 357 | hfsplus_delete_inode(inode); |
351 | } else | 358 | } else |
352 | clear_nlink(inode); | 359 | HFSPLUS_SB(sb).file_count--; |
353 | inode->i_ctime = CURRENT_TIME_SEC; | 360 | inode->i_ctime = CURRENT_TIME_SEC; |
354 | mark_inode_dirty(inode); | 361 | mark_inode_dirty(inode); |
355 | 362 | ||
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index ef57a5ae5904..5d2e9d9a4e28 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -64,7 +64,11 @@ const struct file_operations nfs_file_operations = { | |||
64 | .write = do_sync_write, | 64 | .write = do_sync_write, |
65 | .aio_read = nfs_file_read, | 65 | .aio_read = nfs_file_read, |
66 | .aio_write = nfs_file_write, | 66 | .aio_write = nfs_file_write, |
67 | #ifdef CONFIG_MMU | ||
67 | .mmap = nfs_file_mmap, | 68 | .mmap = nfs_file_mmap, |
69 | #else | ||
70 | .mmap = generic_file_mmap, | ||
71 | #endif | ||
68 | .open = nfs_file_open, | 72 | .open = nfs_file_open, |
69 | .flush = nfs_file_flush, | 73 | .flush = nfs_file_flush, |
70 | .release = nfs_file_release, | 74 | .release = nfs_file_release, |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index a4c7cf2bff3a..6f88d7c77ac9 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -506,6 +506,7 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str | |||
506 | ctx->cred = get_rpccred(cred); | 506 | ctx->cred = get_rpccred(cred); |
507 | ctx->state = NULL; | 507 | ctx->state = NULL; |
508 | ctx->lockowner = current->files; | 508 | ctx->lockowner = current->files; |
509 | ctx->flags = 0; | ||
509 | ctx->error = 0; | 510 | ctx->error = 0; |
510 | ctx->dir_cookie = 0; | 511 | ctx->dir_cookie = 0; |
511 | atomic_set(&ctx->count, 1); | 512 | atomic_set(&ctx->count, 1); |
diff --git a/fs/splice.c b/fs/splice.c index a861bb318ac8..eeb1a86a7014 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -370,8 +370,10 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
370 | * for an in-flight io page | 370 | * for an in-flight io page |
371 | */ | 371 | */ |
372 | if (flags & SPLICE_F_NONBLOCK) { | 372 | if (flags & SPLICE_F_NONBLOCK) { |
373 | if (TestSetPageLocked(page)) | 373 | if (TestSetPageLocked(page)) { |
374 | error = -EAGAIN; | ||
374 | break; | 375 | break; |
376 | } | ||
375 | } else | 377 | } else |
376 | lock_page(page); | 378 | lock_page(page); |
377 | 379 | ||
@@ -479,9 +481,8 @@ ssize_t generic_file_splice_read(struct file *in, loff_t *ppos, | |||
479 | struct pipe_inode_info *pipe, size_t len, | 481 | struct pipe_inode_info *pipe, size_t len, |
480 | unsigned int flags) | 482 | unsigned int flags) |
481 | { | 483 | { |
482 | ssize_t spliced; | ||
483 | int ret; | ||
484 | loff_t isize, left; | 484 | loff_t isize, left; |
485 | int ret; | ||
485 | 486 | ||
486 | isize = i_size_read(in->f_mapping->host); | 487 | isize = i_size_read(in->f_mapping->host); |
487 | if (unlikely(*ppos >= isize)) | 488 | if (unlikely(*ppos >= isize)) |
@@ -491,29 +492,9 @@ ssize_t generic_file_splice_read(struct file *in, loff_t *ppos, | |||
491 | if (unlikely(left < len)) | 492 | if (unlikely(left < len)) |
492 | len = left; | 493 | len = left; |
493 | 494 | ||
494 | ret = 0; | 495 | ret = __generic_file_splice_read(in, ppos, pipe, len, flags); |
495 | spliced = 0; | 496 | if (ret > 0) |
496 | while (len && !spliced) { | ||
497 | ret = __generic_file_splice_read(in, ppos, pipe, len, flags); | ||
498 | |||
499 | if (ret < 0) | ||
500 | break; | ||
501 | else if (!ret) { | ||
502 | if (spliced) | ||
503 | break; | ||
504 | if (flags & SPLICE_F_NONBLOCK) { | ||
505 | ret = -EAGAIN; | ||
506 | break; | ||
507 | } | ||
508 | } | ||
509 | |||
510 | *ppos += ret; | 497 | *ppos += ret; |
511 | len -= ret; | ||
512 | spliced += ret; | ||
513 | } | ||
514 | |||
515 | if (spliced) | ||
516 | return spliced; | ||
517 | 498 | ||
518 | return ret; | 499 | return ret; |
519 | } | 500 | } |