diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-06-05 19:40:56 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:48:02 -0400 |
commit | 58e8268c7bae538ccb8b7eccc817c1c28bcd4da2 (patch) | |
tree | 80854bf79ee052673ff47f69656fe01a538bed6c | |
parent | deee3ce466a3e2cfb54c93b8fd22bbccd19ea7d6 (diff) |
switch ufs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/ufs/ialloc.c | 2 | ||||
-rw-r--r-- | fs/ufs/inode.c | 43 | ||||
-rw-r--r-- | fs/ufs/super.c | 2 | ||||
-rw-r--r-- | fs/ufs/ufs.h | 2 |
4 files changed, 28 insertions, 21 deletions
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index 594480e537d2..428017e018fe 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c | |||
@@ -94,8 +94,6 @@ void ufs_free_inode (struct inode * inode) | |||
94 | 94 | ||
95 | is_directory = S_ISDIR(inode->i_mode); | 95 | is_directory = S_ISDIR(inode->i_mode); |
96 | 96 | ||
97 | clear_inode (inode); | ||
98 | |||
99 | if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_iusedoff, bit)) | 97 | if (ubh_isclr (UCPI_UBH(ucpi), ucpi->c_iusedoff, bit)) |
100 | ufs_error(sb, "ufs_free_inode", "bit already cleared for inode %u", ino); | 98 | ufs_error(sb, "ufs_free_inode", "bit already cleared for inode %u", ino); |
101 | else { | 99 | else { |
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 45cafa937a4b..2b251f2093af 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -911,24 +911,33 @@ int ufs_sync_inode (struct inode *inode) | |||
911 | return ufs_update_inode (inode, 1); | 911 | return ufs_update_inode (inode, 1); |
912 | } | 912 | } |
913 | 913 | ||
914 | void ufs_delete_inode (struct inode * inode) | 914 | void ufs_evict_inode(struct inode * inode) |
915 | { | 915 | { |
916 | loff_t old_i_size; | 916 | int want_delete = 0; |
917 | |||
918 | if (!inode->i_nlink && !is_bad_inode(inode)) | ||
919 | want_delete = 1; | ||
917 | 920 | ||
918 | truncate_inode_pages(&inode->i_data, 0); | 921 | truncate_inode_pages(&inode->i_data, 0); |
919 | if (is_bad_inode(inode)) | 922 | if (want_delete) { |
920 | goto no_delete; | 923 | loff_t old_i_size; |
921 | /*UFS_I(inode)->i_dtime = CURRENT_TIME;*/ | 924 | /*UFS_I(inode)->i_dtime = CURRENT_TIME;*/ |
922 | lock_kernel(); | 925 | lock_kernel(); |
923 | mark_inode_dirty(inode); | 926 | mark_inode_dirty(inode); |
924 | ufs_update_inode(inode, IS_SYNC(inode)); | 927 | ufs_update_inode(inode, IS_SYNC(inode)); |
925 | old_i_size = inode->i_size; | 928 | old_i_size = inode->i_size; |
926 | inode->i_size = 0; | 929 | inode->i_size = 0; |
927 | if (inode->i_blocks && ufs_truncate(inode, old_i_size)) | 930 | if (inode->i_blocks && ufs_truncate(inode, old_i_size)) |
928 | ufs_warning(inode->i_sb, __func__, "ufs_truncate failed\n"); | 931 | ufs_warning(inode->i_sb, __func__, "ufs_truncate failed\n"); |
929 | ufs_free_inode (inode); | 932 | unlock_kernel(); |
930 | unlock_kernel(); | 933 | } |
931 | return; | 934 | |
932 | no_delete: | 935 | invalidate_inode_buffers(inode); |
933 | clear_inode(inode); /* We must guarantee clearing of inode... */ | 936 | end_writeback(inode); |
937 | |||
938 | if (want_delete) { | ||
939 | lock_kernel(); | ||
940 | ufs_free_inode (inode); | ||
941 | unlock_kernel(); | ||
942 | } | ||
934 | } | 943 | } |
diff --git a/fs/ufs/super.c b/fs/ufs/super.c index 3ec5a9eb6efb..d510c1b91817 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c | |||
@@ -1440,7 +1440,7 @@ static const struct super_operations ufs_super_ops = { | |||
1440 | .alloc_inode = ufs_alloc_inode, | 1440 | .alloc_inode = ufs_alloc_inode, |
1441 | .destroy_inode = ufs_destroy_inode, | 1441 | .destroy_inode = ufs_destroy_inode, |
1442 | .write_inode = ufs_write_inode, | 1442 | .write_inode = ufs_write_inode, |
1443 | .delete_inode = ufs_delete_inode, | 1443 | .evict_inode = ufs_evict_inode, |
1444 | .put_super = ufs_put_super, | 1444 | .put_super = ufs_put_super, |
1445 | .write_super = ufs_write_super, | 1445 | .write_super = ufs_write_super, |
1446 | .sync_fs = ufs_sync_fs, | 1446 | .sync_fs = ufs_sync_fs, |
diff --git a/fs/ufs/ufs.h b/fs/ufs/ufs.h index 179ae6b3180a..c08782e1b48a 100644 --- a/fs/ufs/ufs.h +++ b/fs/ufs/ufs.h | |||
@@ -108,7 +108,7 @@ extern struct inode * ufs_new_inode (struct inode *, int); | |||
108 | extern struct inode *ufs_iget(struct super_block *, unsigned long); | 108 | extern struct inode *ufs_iget(struct super_block *, unsigned long); |
109 | extern int ufs_write_inode (struct inode *, struct writeback_control *); | 109 | extern int ufs_write_inode (struct inode *, struct writeback_control *); |
110 | extern int ufs_sync_inode (struct inode *); | 110 | extern int ufs_sync_inode (struct inode *); |
111 | extern void ufs_delete_inode (struct inode *); | 111 | extern void ufs_evict_inode (struct inode *); |
112 | extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); | 112 | extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); |
113 | extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); | 113 | extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); |
114 | 114 | ||