Skip to content

Commit 37be2f5

Browse files
Eric Sandeentytso
authored andcommitted
ext4: remove ext4_handle_release_buffer()
ext4_handle_release_buffer() was intended to remove journal write access from a buffer, but it doesn't actually do anything at all other than add a BUFFER_TRACE point, but it's not reliably used for that either. Remove all the associated dead code. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
1 parent 6d138ce commit 37be2f5

6 files changed

Lines changed: 3 additions & 35 deletions

File tree

‎fs/ext4/ext4_jbd2.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,6 @@ static inline void ext4_handle_sync(handle_t *handle)
254254
handle->h_sync = 1;
255255
}
256256

257-
static inline void ext4_handle_release_buffer(handle_t *handle,
258-
struct buffer_head *bh)
259-
{
260-
if (ext4_handle_valid(handle))
261-
jbd2_journal_release_buffer(handle, bh);
262-
}
263-
264257
static inline int ext4_handle_is_aborted(handle_t *handle)
265258
{
266259
if (ext4_handle_valid(handle))

‎fs/ext4/resize.c‎

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
783783

784784
err = ext4_journal_get_write_access(handle, gdb_bh);
785785
if (unlikely(err))
786-
goto exit_sbh;
786+
goto exit_dind;
787787

788788
err = ext4_journal_get_write_access(handle, dind);
789789
if (unlikely(err))
@@ -792,7 +792,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
792792
/* ext4_reserve_inode_write() gets a reference on the iloc */
793793
err = ext4_reserve_inode_write(handle, inode, &iloc);
794794
if (unlikely(err))
795-
goto exit_dindj;
795+
goto exit_dind;
796796

797797
n_group_desc = ext4_kvmalloc((gdb_num + 1) *
798798
sizeof(struct buffer_head *),
@@ -846,12 +846,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
846846

847847
exit_inode:
848848
ext4_kvfree(n_group_desc);
849-
/* ext4_handle_release_buffer(handle, iloc.bh); */
850849
brelse(iloc.bh);
851-
exit_dindj:
852-
/* ext4_handle_release_buffer(handle, dind); */
853-
exit_sbh:
854-
/* ext4_handle_release_buffer(handle, EXT4_SB(sb)->s_sbh); */
855850
exit_dind:
856851
brelse(dind);
857852
exit_bh:
@@ -969,14 +964,8 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
969964
}
970965

971966
for (i = 0; i < reserved_gdb; i++) {
972-
if ((err = ext4_journal_get_write_access(handle, primary[i]))) {
973-
/*
974-
int j;
975-
for (j = 0; j < i; j++)
976-
ext4_handle_release_buffer(handle, primary[j]);
977-
*/
967+
if ((err = ext4_journal_get_write_access(handle, primary[i])))
978968
goto exit_bh;
979-
}
980969
}
981970

982971
if ((err = ext4_reserve_inode_write(handle, inode, &iloc)))

‎fs/ext4/xattr.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,6 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
794794
int offset = (char *)s->here - bs->bh->b_data;
795795

796796
unlock_buffer(bs->bh);
797-
ext4_handle_release_buffer(handle, bs->bh);
798797
if (ce) {
799798
mb_cache_entry_release(ce);
800799
ce = NULL;

‎fs/jbd2/journal.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ EXPORT_SYMBOL(jbd2_journal_get_create_access);
6060
EXPORT_SYMBOL(jbd2_journal_get_undo_access);
6161
EXPORT_SYMBOL(jbd2_journal_set_triggers);
6262
EXPORT_SYMBOL(jbd2_journal_dirty_metadata);
63-
EXPORT_SYMBOL(jbd2_journal_release_buffer);
6463
EXPORT_SYMBOL(jbd2_journal_forget);
6564
#if 0
6665
EXPORT_SYMBOL(journal_sync_buffer);

‎fs/jbd2/transaction.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,17 +1207,6 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
12071207
return ret;
12081208
}
12091209

1210-
/*
1211-
* jbd2_journal_release_buffer: undo a get_write_access without any buffer
1212-
* updates, if the update decided in the end that it didn't need access.
1213-
*
1214-
*/
1215-
void
1216-
jbd2_journal_release_buffer(handle_t *handle, struct buffer_head *bh)
1217-
{
1218-
BUFFER_TRACE(bh, "entry");
1219-
}
1220-
12211210
/**
12221211
* void jbd2_journal_forget() - bforget() for potentially-journaled buffers.
12231212
* @handle: transaction handle

‎include/linux/jbd2.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,6 @@ extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *);
10961096
void jbd2_journal_set_triggers(struct buffer_head *,
10971097
struct jbd2_buffer_trigger_type *type);
10981098
extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *);
1099-
extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *);
11001099
extern int jbd2_journal_forget (handle_t *, struct buffer_head *);
11011100
extern void journal_sync_buffer (struct buffer_head *);
11021101
extern void jbd2_journal_invalidatepage(journal_t *,

0 commit comments

Comments
 (0)