diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-06-07 00:43:39 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:48:19 -0400 |
commit | 3aac2b62e0f345c8a637cf94dc62e9000de9d8b6 (patch) | |
tree | df5db650878c0e6b377fbf861597dc1fecaaa883 /fs/udf/inode.c | |
parent | d640e1b50885b5beb61ccacdebf9f3f05ee2119c (diff) |
switch udf to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r-- | fs/udf/inode.c | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index ecddcc2ed746..fc48f37aa2dd 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -68,37 +68,23 @@ static void udf_update_extents(struct inode *, | |||
68 | static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int); | 68 | static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int); |
69 | 69 | ||
70 | 70 | ||
71 | void udf_delete_inode(struct inode *inode) | 71 | void udf_evict_inode(struct inode *inode) |
72 | { | ||
73 | truncate_inode_pages(&inode->i_data, 0); | ||
74 | |||
75 | if (is_bad_inode(inode)) | ||
76 | goto no_delete; | ||
77 | |||
78 | inode->i_size = 0; | ||
79 | udf_truncate(inode); | ||
80 | lock_kernel(); | ||
81 | |||
82 | udf_update_inode(inode, IS_SYNC(inode)); | ||
83 | udf_free_inode(inode); | ||
84 | |||
85 | unlock_kernel(); | ||
86 | return; | ||
87 | |||
88 | no_delete: | ||
89 | clear_inode(inode); | ||
90 | } | ||
91 | |||
92 | /* | ||
93 | * If we are going to release inode from memory, we truncate last inode extent | ||
94 | * to proper length. We could use drop_inode() but it's called under inode_lock | ||
95 | * and thus we cannot mark inode dirty there. We use clear_inode() but we have | ||
96 | * to make sure to write inode as it's not written automatically. | ||
97 | */ | ||
98 | void udf_clear_inode(struct inode *inode) | ||
99 | { | 72 | { |
100 | struct udf_inode_info *iinfo = UDF_I(inode); | 73 | struct udf_inode_info *iinfo = UDF_I(inode); |
74 | int want_delete = 0; | ||
101 | 75 | ||
76 | truncate_inode_pages(&inode->i_data, 0); | ||
77 | |||
78 | if (!inode->i_nlink && !is_bad_inode(inode)) { | ||
79 | want_delete = 1; | ||
80 | inode->i_size = 0; | ||
81 | udf_truncate(inode); | ||
82 | lock_kernel(); | ||
83 | udf_update_inode(inode, IS_SYNC(inode)); | ||
84 | unlock_kernel(); | ||
85 | } | ||
86 | invalidate_inode_buffers(inode); | ||
87 | end_writeback(inode); | ||
102 | if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB && | 88 | if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB && |
103 | inode->i_size != iinfo->i_lenExtents) { | 89 | inode->i_size != iinfo->i_lenExtents) { |
104 | printk(KERN_WARNING "UDF-fs (%s): Inode %lu (mode %o) has " | 90 | printk(KERN_WARNING "UDF-fs (%s): Inode %lu (mode %o) has " |
@@ -108,9 +94,13 @@ void udf_clear_inode(struct inode *inode) | |||
108 | (unsigned long long)inode->i_size, | 94 | (unsigned long long)inode->i_size, |
109 | (unsigned long long)iinfo->i_lenExtents); | 95 | (unsigned long long)iinfo->i_lenExtents); |
110 | } | 96 | } |
111 | |||
112 | kfree(iinfo->i_ext.i_data); | 97 | kfree(iinfo->i_ext.i_data); |
113 | iinfo->i_ext.i_data = NULL; | 98 | iinfo->i_ext.i_data = NULL; |
99 | if (want_delete) { | ||
100 | lock_kernel(); | ||
101 | udf_free_inode(inode); | ||
102 | unlock_kernel(); | ||
103 | } | ||
114 | } | 104 | } |
115 | 105 | ||
116 | static int udf_writepage(struct page *page, struct writeback_control *wbc) | 106 | static int udf_writepage(struct page *page, struct writeback_control *wbc) |