]> git.hungrycats.org Git - linux/commitdiff
[PATCH] rename get_hash_table() to find_get_block()
authorAndrew Morton <akpm@zip.com.au>
Tue, 18 Jun 2002 03:21:09 +0000 (20:21 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 18 Jun 2002 03:21:09 +0000 (20:21 -0700)
Renames the buffer_head lookup function `get_hash_table' to
`find_get_block'.

get_hash_table() is too generic a name. Plus it doesn't even use a hash
any more.

12 files changed:
drivers/md/lvm-snap.c
fs/buffer.c
fs/ext3/balloc.c
fs/ext3/inode.c
fs/jbd/revoke.c
fs/qnx4/fsync.c
fs/reiserfs/fix_node.c
fs/reiserfs/journal.c
fs/ufs/truncate.c
include/linux/buffer_head.h
include/linux/reiserfs_fs.h
kernel/ksyms.c

index c90947fc5f89312f2cacea396eac625f4745701c..46df5c8ff0ef1c99e28060f0e9182cbf31f8770f 100644 (file)
@@ -224,7 +224,7 @@ static inline void invalidate_snap_cache(unsigned long start, unsigned long nr,
 
        for (i = 0; i < nr; i++)
        {
-               bh = get_hash_table(dev, start++, blksize);
+               bh = find_get_block(dev, start++, blksize);
                if (bh)
                        bforget(bh);
        }
index a47863b3bd8a80cbe7380ab210d7ceeb349be645..dde8e7d9bae6c1a2401184f3c4a771b49c7cf49f 100644 (file)
@@ -378,7 +378,7 @@ out:
 }
 
 /*
- * Various filesystems appear to want __get_hash_table to be non-blocking.
+ * Various filesystems appear to want __find_get_block to be non-blocking.
  * But it's the page lock which protects the buffers.  To get around this,
  * we get exclusion from try_to_free_buffers with the blockdev mapping's
  * private_lock.
@@ -389,7 +389,7 @@ out:
  * private_lock is contended then so is mapping->page_lock).
  */
 struct buffer_head *
-__get_hash_table(struct block_device *bdev, sector_t block, int unused)
+__find_get_block(struct block_device *bdev, sector_t block, int unused)
 {
        struct inode *bd_inode = bdev->bd_inode;
        struct address_space *bd_mapping = bd_inode->i_mapping;
@@ -1091,7 +1091,7 @@ grow_dev_page(struct block_device *bdev, unsigned long block,
 
        /*
         * Link the page to the buffers and initialise them.  Take the
-        * lock to be atomic wrt __get_hash_table(), which does not
+        * lock to be atomic wrt __find_get_block(), which does not
         * run under the page lock.
         */
        spin_lock(&inode->i_mapping->private_lock);
@@ -1164,7 +1164,7 @@ __getblk(struct block_device *bdev, sector_t block, int size)
        for (;;) {
                struct buffer_head * bh;
 
-               bh = __get_hash_table(bdev, block, size);
+               bh = __find_get_block(bdev, block, size);
                if (bh) {
                        touch_buffer(bh);
                        return bh;
@@ -1449,7 +1449,7 @@ void unmap_underlying_metadata(struct block_device *bdev, sector_t block)
 {
        struct buffer_head *old_bh;
 
-       old_bh = __get_hash_table(bdev, block, 0);
+       old_bh = __find_get_block(bdev, block, 0);
        if (old_bh) {
 #if 0  /* This happens.  Later. */
                if (buffer_dirty(old_bh))
index f8f6828d5f59f52f3d7236765a72f748c839feea..c5cc2178ad4a9cf47fe6e3b170e8227f34bfb83f 100644 (file)
@@ -352,7 +352,7 @@ do_more:
 #ifdef CONFIG_JBD_DEBUG
                {
                        struct buffer_head *debug_bh;
-                       debug_bh = sb_get_hash_table(sb, block + i);
+                       debug_bh = sb_find_get_block(sb, block + i);
                        if (debug_bh) {
                                BUFFER_TRACE(debug_bh, "Deleted!");
                                if (!bh2jh(bitmap_bh)->b_committed_data)
@@ -701,7 +701,7 @@ got_block:
                struct buffer_head *debug_bh;
 
                /* Record bitmap buffer state in the newly allocated block */
-               debug_bh = sb_get_hash_table(sb, tmp);
+               debug_bh = sb_find_get_block(sb, tmp);
                if (debug_bh) {
                        BUFFER_TRACE(debug_bh, "state when allocated");
                        BUFFER_TRACE2(debug_bh, bh, "bitmap state");
index b339c253628e193ff293d954f538dd53511c494b..a9b2c7beb70b4162d149bbaa0bb03128852ea1d1 100644 (file)
@@ -1650,7 +1650,7 @@ ext3_clear_blocks(handle_t *handle, struct inode *inode, struct buffer_head *bh,
                        struct buffer_head *bh;
 
                        *p = 0;
-                       bh = sb_get_hash_table(inode->i_sb, nr);
+                       bh = sb_find_get_block(inode->i_sb, nr);
                        ext3_forget(handle, 0, inode, bh, nr);
                }
        }
index 7cecb02379885cb66a5b895183b4dcbebc4024e5..6a6464533c352164e228c7d716d5bcd152cea858 100644 (file)
@@ -293,7 +293,7 @@ int journal_revoke(handle_t *handle, unsigned long blocknr,
        bh = bh_in;
 
        if (!bh) {
-               bh = __get_hash_table(bdev, blocknr, journal->j_blocksize);
+               bh = __find_get_block(bdev, blocknr, journal->j_blocksize);
                if (bh)
                        BUFFER_TRACE(bh, "found on hash");
        }
@@ -303,7 +303,7 @@ int journal_revoke(handle_t *handle, unsigned long blocknr,
 
                /* If there is a different buffer_head lying around in
                 * memory anywhere... */
-               bh2 = __get_hash_table(bdev, blocknr, journal->j_blocksize);
+               bh2 = __find_get_block(bdev, blocknr, journal->j_blocksize);
                if (bh2) {
                        /* ... and it has RevokeValid status... */
                        if ((bh2 != bh) &&
@@ -407,7 +407,7 @@ int journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
         * state machine will get very upset later on. */
        if (need_cancel) {
                struct buffer_head *bh2;
-               bh2 = __get_hash_table(bh->b_bdev, bh->b_blocknr, bh->b_size);
+               bh2 = __find_get_block(bh->b_bdev, bh->b_blocknr, bh->b_size);
                if (bh2) {
                        if (bh2 != bh)
                                clear_bit(BH_Revoked, &bh2->b_state);
index 2bb315473ee62f21eac29318454b625b60dd7e5e..df5bc75d5414374a02018cb62b737889bd137d08 100644 (file)
@@ -37,7 +37,7 @@ static int sync_block(struct inode *inode, unsigned short *block, int wait)
        if (!*block)
                return 0;
        tmp = *block;
-       bh = sb_get_hash_table(inode->i_sb, *block);
+       bh = sb_find_get_block(inode->i_sb, *block);
        if (!bh)
                return 0;
        if (*block != tmp) {
index 0bdb34c5acf4a2513a35f76beccbd4a96c803cc7..1cdcd39a06bd6cce8fadac146946ef907f918e1f 100644 (file)
@@ -920,7 +920,7 @@ static int  is_left_neighbor_in_cache(
   /* Get left neighbor block number. */
   n_left_neighbor_blocknr = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_left_neighbor_position);
   /* Look for the left neighbor in the cache. */
-  if ( (left = sb_get_hash_table(p_s_sb, n_left_neighbor_blocknr)) ) {
+  if ( (left = sb_find_get_block(p_s_sb, n_left_neighbor_blocknr)) ) {
 
     RFALSE( buffer_uptodate (left) && ! B_IS_IN_TREE(left),
            "vs-8170: left neighbor (%b %z) is not in the tree", left, left);
index c16dbdc12ca6d2919af3b958e09f79cb81e2bed0..2cf16631e2247507c9b0cb95de967799f27221f5 100644 (file)
@@ -689,7 +689,7 @@ retry:
   count = 0 ;
   for (i = 0 ; atomic_read(&(jl->j_commit_left)) > 1 && i < (jl->j_len + 1) ; i++) {  /* everything but commit_bh */
     bn = SB_ONDISK_JOURNAL_1st_BLOCK(s) + (jl->j_start+i) %  SB_ONDISK_JOURNAL_SIZE(s);
-    tbh = journal_get_hash_table(s, bn) ;
+    tbh = journal_find_get_block(s, bn) ;
 
 /* kill this sanity check */
 if (count > (orig_commit_left + 2)) {
@@ -718,7 +718,7 @@ reiserfs_panic(s, "journal-539: flush_commit_list: BAD count(%d) > orig_commit_l
     for (i = 0 ; atomic_read(&(jl->j_commit_left)) > 1 && 
                  i < (jl->j_len + 1) ; i++) {  /* everything but commit_bh */
       bn = SB_ONDISK_JOURNAL_1st_BLOCK(s) + (jl->j_start + i) % SB_ONDISK_JOURNAL_SIZE(s) ;
-      tbh = journal_get_hash_table(s, bn) ;
+      tbh = journal_find_get_block(s, bn) ;
 
       wait_on_buffer(tbh) ;
       if (!buffer_uptodate(tbh)) {
@@ -2764,7 +2764,7 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, struct super_bloc
   int cleaned = 0 ;
   
   if (reiserfs_dont_log(th->t_super)) {
-    bh = sb_get_hash_table(p_s_sb, blocknr) ;
+    bh = sb_find_get_block(p_s_sb, blocknr) ;
     if (bh && buffer_dirty (bh)) {
       printk ("journal_mark_freed(dont_log): dirty buffer on hash list: %lx %ld\n", bh->b_state, blocknr);
       BUG ();
@@ -2772,7 +2772,7 @@ int journal_mark_freed(struct reiserfs_transaction_handle *th, struct super_bloc
     brelse (bh);
     return 0 ;
   }
-  bh = sb_get_hash_table(p_s_sb, blocknr) ;
+  bh = sb_find_get_block(p_s_sb, blocknr) ;
   /* if it is journal new, we just remove it from this transaction */
   if (bh && buffer_journal_new(bh)) {
     mark_buffer_notjournal_new(bh) ;
index f8134d41d98ed3b70aa917c7e668e5b5e845000b..6b87c6f26702686fec9bd7b43b3228a5a0ca3880 100644 (file)
@@ -117,7 +117,7 @@ static int ufs_trunc_direct (struct inode * inode)
        frag1 = ufs_fragnum (frag1);
        frag2 = ufs_fragnum (frag2);
        for (j = frag1; j < frag2; j++) {
-               bh = sb_get_hash_table (sb, tmp + j);
+               bh = sb_find_get_block (sb, tmp + j);
                if ((bh && DATA_BUFFER_USED(bh)) || tmp != fs32_to_cpu(sb, *p)) {
                        retry = 1;
                        brelse (bh);
@@ -140,7 +140,7 @@ next1:
                if (!tmp)
                        continue;
                for (j = 0; j < uspi->s_fpb; j++) {
-                       bh = sb_get_hash_table(sb, tmp + j);
+                       bh = sb_find_get_block(sb, tmp + j);
                        if ((bh && DATA_BUFFER_USED(bh)) || tmp != fs32_to_cpu(sb, *p)) {
                                retry = 1;
                                brelse (bh);
@@ -179,7 +179,7 @@ next2:;
                ufs_panic(sb, "ufs_truncate_direct", "internal error");
        frag4 = ufs_fragnum (frag4);
        for (j = 0; j < frag4; j++) {
-               bh = sb_get_hash_table (sb, tmp + j);
+               bh = sb_find_get_block (sb, tmp + j);
                if ((bh && DATA_BUFFER_USED(bh)) || tmp != fs32_to_cpu(sb, *p)) {
                        retry = 1;
                        brelse (bh);
@@ -238,7 +238,7 @@ static int ufs_trunc_indirect (struct inode * inode, unsigned offset, u32 * p)
                if (!tmp)
                        continue;
                for (j = 0; j < uspi->s_fpb; j++) {
-                       bh = sb_get_hash_table(sb, tmp + j);
+                       bh = sb_find_get_block(sb, tmp + j);
                        if ((bh && DATA_BUFFER_USED(bh)) || tmp != fs32_to_cpu(sb, *ind)) {
                                retry = 1;
                                brelse (bh);
index 903850460ab5c28fa7371d3b25777e7da0863c3e..4fc6bab558257b310291ee625a55066f556de1e2 100644 (file)
@@ -160,7 +160,7 @@ int fsync_dev(kdev_t);
 int fsync_bdev(struct block_device *);
 int fsync_super(struct super_block *);
 int fsync_no_super(struct block_device *);
-struct buffer_head *__get_hash_table(struct block_device *, sector_t, int);
+struct buffer_head *__find_get_block(struct block_device *, sector_t, int);
 struct buffer_head * __getblk(struct block_device *, sector_t, int);
 void __brelse(struct buffer_head *);
 void __bforget(struct buffer_head *);
@@ -254,9 +254,9 @@ static inline struct buffer_head * sb_getblk(struct super_block *sb, int block)
 }
 
 static inline struct buffer_head *
-sb_get_hash_table(struct super_block *sb, int block)
+sb_find_get_block(struct super_block *sb, int block)
 {
-       return __get_hash_table(sb->s_bdev, block, sb->s_blocksize);
+       return __find_get_block(sb->s_bdev, block, sb->s_blocksize);
 }
 
 static inline void
index 4a3d16d7b8dc28056048c4b92b25a46e8ffe8b99..29f6063b35468ee9f6adbdb8bd12e884257e0083 100644 (file)
@@ -1651,7 +1651,7 @@ extern wait_queue_head_t reiserfs_commit_thread_wait ;
 #define JOURNAL_BUFFER(j,n) ((j)->j_ap_blocks[((j)->j_start + (n)) % JOURNAL_BLOCK_COUNT])
 
 // We need these to make journal.c code more readable
-#define journal_get_hash_table(s, block) __get_hash_table(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
+#define journal_find_get_block(s, block) __find_get_block(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
 #define journal_getblk(s, block) __getblk(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
 #define journal_bread(s, block) __bread(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
 
index 4e554c38c7f511352aabbe6f056254ebb9684868..8b2511787ccb8210992d0d9d4912725568d3a750 100644 (file)
@@ -551,7 +551,7 @@ EXPORT_SYMBOL(file_fsync);
 EXPORT_SYMBOL(fsync_buffers_list);
 EXPORT_SYMBOL(clear_inode);
 EXPORT_SYMBOL(init_special_inode);
-EXPORT_SYMBOL(__get_hash_table);
+EXPORT_SYMBOL(__find_get_block);
 EXPORT_SYMBOL(new_inode);
 EXPORT_SYMBOL(__insert_inode_hash);
 EXPORT_SYMBOL(remove_inode_hash);