aboutsummaryrefslogtreecommitdiffstats
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
parentdeee3ce466a3e2cfb54c93b8fd22bbccd19ea7d6 (diff)
switch ufs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/ufs/ialloc.c2
-rw-r--r--fs/ufs/inode.c43
-rw-r--r--fs/ufs/super.c2
-rw-r--r--fs/ufs/ufs.h2
4 files changed, 28 insertions, 21 deletions
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c
index 594480e537d..428017e018f 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 45cafa937a4..2b251f2093a 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}
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 3ec5a9eb6ef..d510c1b9181 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 179ae6b3180..c08782e1b48 100644
--- a/fs/ufs/ufs.h
+++ b/fs/ufs/ufs.h
@@ -108,7 +108,7 @@ extern struct inode * ufs_new_inode (struct inode *, int);
108extern struct inode *ufs_iget(struct super_block *, unsigned long); 108extern struct inode *ufs_iget(struct super_block *, unsigned long);
109extern int ufs_write_inode (struct inode *, struct writeback_control *); 109extern int ufs_write_inode (struct inode *, struct writeback_control *);
110extern int ufs_sync_inode (struct inode *); 110extern int ufs_sync_inode (struct inode *);
111extern void ufs_delete_inode (struct inode *); 111extern void ufs_evict_inode (struct inode *);
112extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); 112extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
113extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); 113extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create);
114 114