diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 14:26:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 14:26:52 -0400 |
commit | 5f248c9c251c60af3403902b26e08de43964ea0b (patch) | |
tree | 6d3328e72a7e4015a64017eb30be18095c6a3c64 /fs/minix/inode.c | |
parent | f6cec0ae58c17522a7bc4e2f39dae19f199ab534 (diff) | |
parent | dca332528bc69e05f67161e1ed59929633d5e63d (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
no need for list_for_each_entry_safe()/resetting with superblock list
Fix sget() race with failing mount
vfs: don't hold s_umount over close_bdev_exclusive() call
sysv: do not mark superblock dirty on remount
sysv: do not mark superblock dirty on mount
btrfs: remove junk sb_dirt change
BFS: clean up the superblock usage
AFFS: wait for sb synchronization when needed
AFFS: clean up dirty flag usage
cifs: truncate fallout
mbcache: fix shrinker function return value
mbcache: Remove unused features
add f_flags to struct statfs(64)
pass a struct path to vfs_statfs
update VFS documentation for method changes.
All filesystems that need invalidate_inode_buffers() are doing that explicitly
convert remaining ->clear_inode() to ->evict_inode()
Make ->drop_inode() just return whether inode needs to be dropped
fs/inode.c:clear_inode() is gone
fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
...
Fix up trivial conflicts in fs/nilfs2/super.c
Diffstat (limited to 'fs/minix/inode.c')
-rw-r--r-- | fs/minix/inode.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/fs/minix/inode.c b/fs/minix/inode.c index 756f8c93780c..e39d6bf2e8fb 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c | |||
@@ -24,12 +24,17 @@ static int minix_write_inode(struct inode *inode, | |||
24 | static int minix_statfs(struct dentry *dentry, struct kstatfs *buf); | 24 | static int minix_statfs(struct dentry *dentry, struct kstatfs *buf); |
25 | static int minix_remount (struct super_block * sb, int * flags, char * data); | 25 | static int minix_remount (struct super_block * sb, int * flags, char * data); |
26 | 26 | ||
27 | static void minix_delete_inode(struct inode *inode) | 27 | static void minix_evict_inode(struct inode *inode) |
28 | { | 28 | { |
29 | truncate_inode_pages(&inode->i_data, 0); | 29 | truncate_inode_pages(&inode->i_data, 0); |
30 | inode->i_size = 0; | 30 | if (!inode->i_nlink) { |
31 | minix_truncate(inode); | 31 | inode->i_size = 0; |
32 | minix_free_inode(inode); | 32 | minix_truncate(inode); |
33 | } | ||
34 | invalidate_inode_buffers(inode); | ||
35 | end_writeback(inode); | ||
36 | if (!inode->i_nlink) | ||
37 | minix_free_inode(inode); | ||
33 | } | 38 | } |
34 | 39 | ||
35 | static void minix_put_super(struct super_block *sb) | 40 | static void minix_put_super(struct super_block *sb) |
@@ -96,7 +101,7 @@ static const struct super_operations minix_sops = { | |||
96 | .alloc_inode = minix_alloc_inode, | 101 | .alloc_inode = minix_alloc_inode, |
97 | .destroy_inode = minix_destroy_inode, | 102 | .destroy_inode = minix_destroy_inode, |
98 | .write_inode = minix_write_inode, | 103 | .write_inode = minix_write_inode, |
99 | .delete_inode = minix_delete_inode, | 104 | .evict_inode = minix_evict_inode, |
100 | .put_super = minix_put_super, | 105 | .put_super = minix_put_super, |
101 | .statfs = minix_statfs, | 106 | .statfs = minix_statfs, |
102 | .remount_fs = minix_remount, | 107 | .remount_fs = minix_remount, |
@@ -357,20 +362,26 @@ static int minix_readpage(struct file *file, struct page *page) | |||
357 | return block_read_full_page(page,minix_get_block); | 362 | return block_read_full_page(page,minix_get_block); |
358 | } | 363 | } |
359 | 364 | ||
360 | int __minix_write_begin(struct file *file, struct address_space *mapping, | 365 | int minix_prepare_chunk(struct page *page, loff_t pos, unsigned len) |
361 | loff_t pos, unsigned len, unsigned flags, | ||
362 | struct page **pagep, void **fsdata) | ||
363 | { | 366 | { |
364 | return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | 367 | return __block_write_begin(page, pos, len, minix_get_block); |
365 | minix_get_block); | ||
366 | } | 368 | } |
367 | 369 | ||
368 | static int minix_write_begin(struct file *file, struct address_space *mapping, | 370 | static int minix_write_begin(struct file *file, struct address_space *mapping, |
369 | loff_t pos, unsigned len, unsigned flags, | 371 | loff_t pos, unsigned len, unsigned flags, |
370 | struct page **pagep, void **fsdata) | 372 | struct page **pagep, void **fsdata) |
371 | { | 373 | { |
372 | *pagep = NULL; | 374 | int ret; |
373 | return __minix_write_begin(file, mapping, pos, len, flags, pagep, fsdata); | 375 | |
376 | ret = block_write_begin(mapping, pos, len, flags, pagep, | ||
377 | minix_get_block); | ||
378 | if (unlikely(ret)) { | ||
379 | loff_t isize = mapping->host->i_size; | ||
380 | if (pos + len > isize) | ||
381 | vmtruncate(mapping->host, isize); | ||
382 | } | ||
383 | |||
384 | return ret; | ||
374 | } | 385 | } |
375 | 386 | ||
376 | static sector_t minix_bmap(struct address_space *mapping, sector_t block) | 387 | static sector_t minix_bmap(struct address_space *mapping, sector_t block) |