diff options
Diffstat (limited to 'fs/fat/inode.c')
| -rw-r--r-- | fs/fat/inode.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 7bf45aee56d7..830058057d33 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
| @@ -159,7 +159,7 @@ static int fat_write_begin(struct file *file, struct address_space *mapping, | |||
| 159 | int err; | 159 | int err; |
| 160 | 160 | ||
| 161 | *pagep = NULL; | 161 | *pagep = NULL; |
| 162 | err = cont_write_begin_newtrunc(file, mapping, pos, len, flags, | 162 | err = cont_write_begin(file, mapping, pos, len, flags, |
| 163 | pagep, fsdata, fat_get_block, | 163 | pagep, fsdata, fat_get_block, |
| 164 | &MSDOS_I(mapping->host)->mmu_private); | 164 | &MSDOS_I(mapping->host)->mmu_private); |
| 165 | if (err < 0) | 165 | if (err < 0) |
| @@ -212,8 +212,8 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, | |||
| 212 | * FAT need to use the DIO_LOCKING for avoiding the race | 212 | * FAT need to use the DIO_LOCKING for avoiding the race |
| 213 | * condition of fat_get_block() and ->truncate(). | 213 | * condition of fat_get_block() and ->truncate(). |
| 214 | */ | 214 | */ |
| 215 | ret = blockdev_direct_IO_newtrunc(rw, iocb, inode, inode->i_sb->s_bdev, | 215 | ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, |
| 216 | iov, offset, nr_segs, fat_get_block, NULL); | 216 | iov, offset, nr_segs, fat_get_block, NULL); |
| 217 | if (ret < 0 && (rw & WRITE)) | 217 | if (ret < 0 && (rw & WRITE)) |
| 218 | fat_write_failed(mapping, offset + iov_length(iov, nr_segs)); | 218 | fat_write_failed(mapping, offset + iov_length(iov, nr_segs)); |
| 219 | 219 | ||
| @@ -263,7 +263,7 @@ static const struct address_space_operations fat_aops = { | |||
| 263 | * check if the location is still valid and retry if it | 263 | * check if the location is still valid and retry if it |
| 264 | * isn't. Otherwise we do changes. | 264 | * isn't. Otherwise we do changes. |
| 265 | * 5. Spinlock is used to protect hash/unhash/location check/lookup | 265 | * 5. Spinlock is used to protect hash/unhash/location check/lookup |
| 266 | * 6. fat_clear_inode() unhashes the F-d-c entry. | 266 | * 6. fat_evict_inode() unhashes the F-d-c entry. |
| 267 | * 7. lookup() and readdir() do igrab() if they find a F-d-c entry | 267 | * 7. lookup() and readdir() do igrab() if they find a F-d-c entry |
| 268 | * and consider negative result as cache miss. | 268 | * and consider negative result as cache miss. |
| 269 | */ | 269 | */ |
| @@ -448,16 +448,15 @@ out: | |||
| 448 | 448 | ||
| 449 | EXPORT_SYMBOL_GPL(fat_build_inode); | 449 | EXPORT_SYMBOL_GPL(fat_build_inode); |
| 450 | 450 | ||
| 451 | static void fat_delete_inode(struct inode *inode) | 451 | static void fat_evict_inode(struct inode *inode) |
| 452 | { | 452 | { |
| 453 | truncate_inode_pages(&inode->i_data, 0); | 453 | truncate_inode_pages(&inode->i_data, 0); |
| 454 | inode->i_size = 0; | 454 | if (!inode->i_nlink) { |
| 455 | fat_truncate_blocks(inode, 0); | 455 | inode->i_size = 0; |
| 456 | clear_inode(inode); | 456 | fat_truncate_blocks(inode, 0); |
| 457 | } | 457 | } |
| 458 | 458 | invalidate_inode_buffers(inode); | |
| 459 | static void fat_clear_inode(struct inode *inode) | 459 | end_writeback(inode); |
| 460 | { | ||
| 461 | fat_cache_inval_inode(inode); | 460 | fat_cache_inval_inode(inode); |
| 462 | fat_detach(inode); | 461 | fat_detach(inode); |
| 463 | } | 462 | } |
| @@ -674,12 +673,11 @@ static const struct super_operations fat_sops = { | |||
| 674 | .alloc_inode = fat_alloc_inode, | 673 | .alloc_inode = fat_alloc_inode, |
| 675 | .destroy_inode = fat_destroy_inode, | 674 | .destroy_inode = fat_destroy_inode, |
| 676 | .write_inode = fat_write_inode, | 675 | .write_inode = fat_write_inode, |
| 677 | .delete_inode = fat_delete_inode, | 676 | .evict_inode = fat_evict_inode, |
| 678 | .put_super = fat_put_super, | 677 | .put_super = fat_put_super, |
| 679 | .write_super = fat_write_super, | 678 | .write_super = fat_write_super, |
| 680 | .sync_fs = fat_sync_fs, | 679 | .sync_fs = fat_sync_fs, |
| 681 | .statfs = fat_statfs, | 680 | .statfs = fat_statfs, |
| 682 | .clear_inode = fat_clear_inode, | ||
| 683 | .remount_fs = fat_remount, | 681 | .remount_fs = fat_remount, |
| 684 | 682 | ||
| 685 | .show_options = fat_show_options, | 683 | .show_options = fat_show_options, |
