aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-06-05 19:40:56 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:48:02 -0400
commit58e8268c7bae538ccb8b7eccc817c1c28bcd4da2 (patch)
tree80854bf79ee052673ff47f69656fe01a538bed6c /fs/ufs/inode.c
parentdeee3ce466a3e2cfb54c93b8fd22bbccd19ea7d6 (diff)
switch ufs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs/inode.c')
-rw-r--r--fs/ufs/inode.c43
1 files changed, 26 insertions, 17 deletions
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
914void ufs_delete_inode (struct inode * inode) 914void 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
932no_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}