+ __u32 bb_bitmap;
+ __u32 bb_buddy;
+ spinlock_t bb_lock;
-+ unsigned long bb_tid;
++ unsigned long bb_tid;
+ struct ext3_free_metadata *bb_md_cur;
+ unsigned short bb_first_free;
+ unsigned short bb_free;
-+ unsigned bb_counters[];
++ unsigned bb_counters[];
+};
+
/*
new_inode->i_ctime = CURRENT_TIME;
}
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2299,11 +2304,11 @@ static int ext3_rename (struct inode * o
+@@ -2299,11 +2304,13 @@ static int ext3_rename (struct inode * o
PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
ext3_journal_dirty_metadata(handle, dir_bh);
+ ext3_dec_count(handle, old_dir);
if (new_inode) {
- new_inode->i_nlink--;
-+ ext3_dec_count(handle, new_inode);
++ /* checked empty_dir above, can't have another parent,
++ * ext3_dec_count() won't work for many-linked dirs */
++ new_inode->i_nlink = 0;
} else {
- new_dir->i_nlink++;
+ ext3_inc_count(handle, new_dir);
+ unsigned long bb_bitmap;
+ unsigned long bb_buddy;
+ spinlock_t bb_lock;
-+ unsigned bb_counters[EXT3_BB_MAX_ORDER];
++ unsigned bb_counters[EXT3_BB_MAX_ORDER];
+ struct ext3_free_metadata *bb_md_cur;
+ unsigned long bb_tid;
+};
+ __u32 bb_bitmap;
+ __u32 bb_buddy;
+ spinlock_t bb_lock;
-+ unsigned long bb_tid;
++ unsigned long bb_tid;
+ struct ext3_free_metadata *bb_md_cur;
+ unsigned short bb_first_free;
+ unsigned short bb_free;
-+ unsigned bb_counters[];
++ unsigned bb_counters[];
+};
+
/*
new_inode->i_ctime = CURRENT_TIME;
}
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2264,11 +2269,11 @@
+@@ -2264,11 +2269,13 @@
PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
ext3_journal_dirty_metadata(handle, dir_bh);
+ ext3_dec_count(handle, old_dir);
if (new_inode) {
- new_inode->i_nlink--;
-+ ext3_dec_count(handle, new_inode);
++ /* checked empty_dir above, can't have another parent,
++ * ext3_dec_count() won't work for many-linked dirs */
++ new_inode->i_nlink = 0;
} else {
- new_dir->i_nlink++;
+ ext3_inc_count(handle, new_dir);
new_inode->i_ctime = CURRENT_TIME;
}
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2267,11 +2272,11 @@
+@@ -2267,11 +2272,13 @@
PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
ext3_journal_dirty_metadata(handle, dir_bh);
+ ext3_dec_count(handle, old_dir);
if (new_inode) {
- new_inode->i_nlink--;
-+ ext3_dec_count(handle, new_inode);
++ /* checked empty_dir above, can't have another parent,
++ * ext3_dec_count() won't work for many-linked dirs */
++ new_inode->i_nlink = 0;
} else {
- new_dir->i_nlink++;
+ ext3_inc_count(handle, new_dir);
new_inode->i_ctime = CURRENT_TIME;
}
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2296,11 +2301,11 @@
+@@ -2296,11 +2301,13 @@
PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
ext3_journal_dirty_metadata(handle, dir_bh);
+ ext3_dec_count(handle, old_dir);
if (new_inode) {
- new_inode->i_nlink--;
-+ ext3_dec_count(handle, new_inode);
++ /* checked empty_dir above, can't have another parent,
++ * ext3_dec_count() won't work for many-linked dirs */
++ new_inode->i_nlink = 0;
} else {
- new_dir->i_nlink++;
+ ext3_inc_count(handle, new_dir);
new_inode->i_ctime = CURRENT_TIME;
}
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2299,11 +2304,11 @@ static int ext3_rename (struct inode * o
+@@ -2299,11 +2304,13 @@ static int ext3_rename (struct inode * o
PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
ext3_journal_dirty_metadata(handle, dir_bh);
+ ext3_dec_count(handle, old_dir);
if (new_inode) {
- new_inode->i_nlink--;
-+ ext3_dec_count(handle, new_inode);
++ /* checked empty_dir above, can't have another parent,
++ * ext3_dec_count() won't work for many-linked dirs */
++ new_inode->i_nlink = 0;
} else {
- new_dir->i_nlink++;
+ ext3_inc_count(handle, new_dir);