ext4: remove ext4_handle_release_buffer()
authorEric Sandeen <sandeen@redhat.com>
Thu, 8 Nov 2012 16:22:46 +0000 (11:22 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 8 Nov 2012 16:22:46 +0000 (11:22 -0500)
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>
fs/ext4/ext4_jbd2.h
fs/ext4/resize.c
fs/ext4/xattr.c
fs/jbd2/journal.c
fs/jbd2/transaction.c
include/linux/jbd2.h

index 56d258c1830363d99ccf2edf7743633acf510942..7177f9b21cb2b58cbfece8c8b636281dc5acff6d 100644 (file)
@@ -254,13 +254,6 @@ static inline void ext4_handle_sync(handle_t *handle)
                handle->h_sync = 1;
 }
 
-static inline void ext4_handle_release_buffer(handle_t *handle,
-                                               struct buffer_head *bh)
-{
-       if (ext4_handle_valid(handle))
-               jbd2_journal_release_buffer(handle, bh);
-}
-
 static inline int ext4_handle_is_aborted(handle_t *handle)
 {
        if (ext4_handle_valid(handle))
index 47bf06a2765ddcbbd37eb84e693680278ea96fb9..d99387b89eddae77a2aa3a7b147f6fc7c9aa858e 100644 (file)
@@ -783,7 +783,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
 
        err = ext4_journal_get_write_access(handle, gdb_bh);
        if (unlikely(err))
-               goto exit_sbh;
+               goto exit_dind;
 
        err = ext4_journal_get_write_access(handle, dind);
        if (unlikely(err))
@@ -792,7 +792,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
        /* ext4_reserve_inode_write() gets a reference on the iloc */
        err = ext4_reserve_inode_write(handle, inode, &iloc);
        if (unlikely(err))
-               goto exit_dindj;
+               goto exit_dind;
 
        n_group_desc = ext4_kvmalloc((gdb_num + 1) *
                                     sizeof(struct buffer_head *),
@@ -846,12 +846,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
 
 exit_inode:
        ext4_kvfree(n_group_desc);
-       /* ext4_handle_release_buffer(handle, iloc.bh); */
        brelse(iloc.bh);
-exit_dindj:
-       /* ext4_handle_release_buffer(handle, dind); */
-exit_sbh:
-       /* ext4_handle_release_buffer(handle, EXT4_SB(sb)->s_sbh); */
 exit_dind:
        brelse(dind);
 exit_bh:
@@ -969,14 +964,8 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
        }
 
        for (i = 0; i < reserved_gdb; i++) {
-               if ((err = ext4_journal_get_write_access(handle, primary[i]))) {
-                       /*
-                       int j;
-                       for (j = 0; j < i; j++)
-                               ext4_handle_release_buffer(handle, primary[j]);
-                        */
+               if ((err = ext4_journal_get_write_access(handle, primary[i])))
                        goto exit_bh;
-               }
        }
 
        if ((err = ext4_reserve_inode_write(handle, inode, &iloc)))
index 2cdb98d62980187bd3e5a189271147461d5627bd..b1adda1b750db220d8a8800d8134a50b87ae1971 100644 (file)
@@ -794,7 +794,6 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
                        int offset = (char *)s->here - bs->bh->b_data;
 
                        unlock_buffer(bs->bh);
-                       ext4_handle_release_buffer(handle, bs->bh);
                        if (ce) {
                                mb_cache_entry_release(ce);
                                ce = NULL;
index 484b8d1c6cb6cd645a009f2cdb1c50884f3a9563..dbf41f9452db602efdebb778f86cf544b28d0399 100644 (file)
@@ -60,7 +60,6 @@ EXPORT_SYMBOL(jbd2_journal_get_create_access);
 EXPORT_SYMBOL(jbd2_journal_get_undo_access);
 EXPORT_SYMBOL(jbd2_journal_set_triggers);
 EXPORT_SYMBOL(jbd2_journal_dirty_metadata);
-EXPORT_SYMBOL(jbd2_journal_release_buffer);
 EXPORT_SYMBOL(jbd2_journal_forget);
 #if 0
 EXPORT_SYMBOL(journal_sync_buffer);
index a74ba46595499690186dc2a46eff5160550032ae..deffd945c8e2bff3be638e3fe1504756d467da45 100644 (file)
@@ -1207,17 +1207,6 @@ out:
        return ret;
 }
 
-/*
- * jbd2_journal_release_buffer: undo a get_write_access without any buffer
- * updates, if the update decided in the end that it didn't need access.
- *
- */
-void
-jbd2_journal_release_buffer(handle_t *handle, struct buffer_head *bh)
-{
-       BUFFER_TRACE(bh, "entry");
-}
-
 /**
  * void jbd2_journal_forget() - bforget() for potentially-journaled buffers.
  * @handle: transaction handle
index 3efc43f3f162c3427099cb31fdafd5c1e5d226de..de7f55682088ebdbfd2b5c8681f85d4cde3c899d 100644 (file)
@@ -1096,7 +1096,6 @@ extern int         jbd2_journal_get_undo_access(handle_t *, struct buffer_head *);
 void            jbd2_journal_set_triggers(struct buffer_head *,
                                           struct jbd2_buffer_trigger_type *type);
 extern int      jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *);
-extern void     jbd2_journal_release_buffer (handle_t *, struct buffer_head *);
 extern int      jbd2_journal_forget (handle_t *, struct buffer_head *);
 extern void     journal_sync_buffer (struct buffer_head *);
 extern void     jbd2_journal_invalidatepage(journal_t *,