diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 14:26:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 14:26:52 -0400 |
commit | 5f248c9c251c60af3403902b26e08de43964ea0b (patch) | |
tree | 6d3328e72a7e4015a64017eb30be18095c6a3c64 /fs/ocfs2/inode.c | |
parent | f6cec0ae58c17522a7bc4e2f39dae19f199ab534 (diff) | |
parent | dca332528bc69e05f67161e1ed59929633d5e63d (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
no need for list_for_each_entry_safe()/resetting with superblock list
Fix sget() race with failing mount
vfs: don't hold s_umount over close_bdev_exclusive() call
sysv: do not mark superblock dirty on remount
sysv: do not mark superblock dirty on mount
btrfs: remove junk sb_dirt change
BFS: clean up the superblock usage
AFFS: wait for sb synchronization when needed
AFFS: clean up dirty flag usage
cifs: truncate fallout
mbcache: fix shrinker function return value
mbcache: Remove unused features
add f_flags to struct statfs(64)
pass a struct path to vfs_statfs
update VFS documentation for method changes.
All filesystems that need invalidate_inode_buffers() are doing that explicitly
convert remaining ->clear_inode() to ->evict_inode()
Make ->drop_inode() just return whether inode needs to be dropped
fs/inode.c:clear_inode() is gone
fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
...
Fix up trivial conflicts in fs/nilfs2/super.c
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r-- | fs/ocfs2/inode.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index abb0a95cc717..0492464916b1 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,16 +1177,27 @@ 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. */ |
1190 | void ocfs2_drop_inode(struct inode *inode) | 1197 | int ocfs2_drop_inode(struct inode *inode) |
1191 | { | 1198 | { |
1192 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 1199 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
1200 | int res; | ||
1193 | 1201 | ||
1194 | mlog_entry_void(); | 1202 | mlog_entry_void(); |
1195 | 1203 | ||
@@ -1197,11 +1205,12 @@ void ocfs2_drop_inode(struct inode *inode) | |||
1197 | (unsigned long long)oi->ip_blkno, inode->i_nlink, oi->ip_flags); | 1205 | (unsigned long long)oi->ip_blkno, inode->i_nlink, oi->ip_flags); |
1198 | 1206 | ||
1199 | if (oi->ip_flags & OCFS2_INODE_MAYBE_ORPHANED) | 1207 | if (oi->ip_flags & OCFS2_INODE_MAYBE_ORPHANED) |
1200 | generic_delete_inode(inode); | 1208 | res = 1; |
1201 | else | 1209 | else |
1202 | generic_drop_inode(inode); | 1210 | res = generic_drop_inode(inode); |
1203 | 1211 | ||
1204 | mlog_exit_void(); | 1212 | mlog_exit_void(); |
1213 | return res; | ||
1205 | } | 1214 | } |
1206 | 1215 | ||
1207 | /* | 1216 | /* |