diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-06-08 21:28:10 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:48:21 -0400 |
commit | 066d92dcbfa5842d98f6c4c671220cef50a9720f (patch) | |
tree | 0eb8f17c4ce6ff2a016e40ee6438881b1e61b86e /fs/ocfs2 | |
parent | 94ee8494ac84606f06d522a2c016d40aabffb378 (diff) |
convert ocfs2 to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/inode.c | 21 | ||||
-rw-r--r-- | fs/ocfs2/inode.h | 3 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 3 |
3 files changed, 16 insertions, 11 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index abb0a95cc717..eb7fd07c90f2 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -969,7 +969,7 @@ static void ocfs2_cleanup_delete_inode(struct inode *inode, | |||
969 | truncate_inode_pages(&inode->i_data, 0); | 969 | truncate_inode_pages(&inode->i_data, 0); |
970 | } | 970 | } |
971 | 971 | ||
972 | void ocfs2_delete_inode(struct inode *inode) | 972 | static void ocfs2_delete_inode(struct inode *inode) |
973 | { | 973 | { |
974 | int wipe, status; | 974 | int wipe, status; |
975 | sigset_t oldset; | 975 | sigset_t oldset; |
@@ -1075,20 +1075,17 @@ bail_unlock_nfs_sync: | |||
1075 | bail_unblock: | 1075 | bail_unblock: |
1076 | ocfs2_unblock_signals(&oldset); | 1076 | ocfs2_unblock_signals(&oldset); |
1077 | bail: | 1077 | bail: |
1078 | clear_inode(inode); | ||
1079 | mlog_exit_void(); | 1078 | mlog_exit_void(); |
1080 | } | 1079 | } |
1081 | 1080 | ||
1082 | void ocfs2_clear_inode(struct inode *inode) | 1081 | static void ocfs2_clear_inode(struct inode *inode) |
1083 | { | 1082 | { |
1084 | int status; | 1083 | int status; |
1085 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 1084 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
1086 | 1085 | ||
1087 | mlog_entry_void(); | 1086 | mlog_entry_void(); |
1088 | 1087 | ||
1089 | if (!inode) | 1088 | end_writeback(inode); |
1090 | goto bail; | ||
1091 | |||
1092 | mlog(0, "Clearing inode: %llu, nlink = %u\n", | 1089 | mlog(0, "Clearing inode: %llu, nlink = %u\n", |
1093 | (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_nlink); | 1090 | (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_nlink); |
1094 | 1091 | ||
@@ -1180,10 +1177,20 @@ void ocfs2_clear_inode(struct inode *inode) | |||
1180 | jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal, | 1177 | jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal, |
1181 | &oi->ip_jinode); | 1178 | &oi->ip_jinode); |
1182 | 1179 | ||
1183 | bail: | ||
1184 | mlog_exit_void(); | 1180 | mlog_exit_void(); |
1185 | } | 1181 | } |
1186 | 1182 | ||
1183 | void ocfs2_evict_inode(struct inode *inode) | ||
1184 | { | ||
1185 | if (!inode->i_nlink || | ||
1186 | (OCFS2_I(inode)->ip_flags & OCFS2_INODE_MAYBE_ORPHANED)) { | ||
1187 | ocfs2_delete_inode(inode); | ||
1188 | } else { | ||
1189 | truncate_inode_pages(&inode->i_data, 0); | ||
1190 | } | ||
1191 | ocfs2_clear_inode(inode); | ||
1192 | } | ||
1193 | |||
1187 | /* Called under inode_lock, with no more references on the | 1194 | /* Called under inode_lock, with no more references on the |
1188 | * struct inode, so it's safe here to check the flags field | 1195 | * struct inode, so it's safe here to check the flags field |
1189 | * and to manipulate i_nlink without any other locks. */ | 1196 | * and to manipulate i_nlink without any other locks. */ |
diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h index 9f5f5fcadc45..975eedd7b243 100644 --- a/fs/ocfs2/inode.h +++ b/fs/ocfs2/inode.h | |||
@@ -123,8 +123,7 @@ static inline struct ocfs2_caching_info *INODE_CACHE(struct inode *inode) | |||
123 | return &OCFS2_I(inode)->ip_metadata_cache; | 123 | return &OCFS2_I(inode)->ip_metadata_cache; |
124 | } | 124 | } |
125 | 125 | ||
126 | void ocfs2_clear_inode(struct inode *inode); | 126 | void ocfs2_evict_inode(struct inode *inode); |
127 | void ocfs2_delete_inode(struct inode *inode); | ||
128 | void ocfs2_drop_inode(struct inode *inode); | 127 | void ocfs2_drop_inode(struct inode *inode); |
129 | 128 | ||
130 | /* Flags for ocfs2_iget() */ | 129 | /* Flags for ocfs2_iget() */ |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 0eaa929a4dbf..ae1a4437a980 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -145,8 +145,7 @@ static const struct super_operations ocfs2_sops = { | |||
145 | .alloc_inode = ocfs2_alloc_inode, | 145 | .alloc_inode = ocfs2_alloc_inode, |
146 | .destroy_inode = ocfs2_destroy_inode, | 146 | .destroy_inode = ocfs2_destroy_inode, |
147 | .drop_inode = ocfs2_drop_inode, | 147 | .drop_inode = ocfs2_drop_inode, |
148 | .clear_inode = ocfs2_clear_inode, | 148 | .evict_inode = ocfs2_evict_inode, |
149 | .delete_inode = ocfs2_delete_inode, | ||
150 | .sync_fs = ocfs2_sync_fs, | 149 | .sync_fs = ocfs2_sync_fs, |
151 | .put_super = ocfs2_put_super, | 150 | .put_super = ocfs2_put_super, |
152 | .remount_fs = ocfs2_remount, | 151 | .remount_fs = ocfs2_remount, |