qnx4: get rid of qnx4_bread/qnx4_getblk
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 14 Feb 2012 01:57:12 +0000 (20:57 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 21 Mar 2012 01:29:51 +0000 (21:29 -0400)
pointless, since the only caller will want the physical block
number anyway; might as well call qnx4_block_map() and use
sb_bread()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/qnx4/inode.c
fs/qnx4/namei.c
fs/qnx4/qnx4.h

index 14a0ba0f0c1c52f9b8b6df273dcb5dfb764c70b4..7900a813d90f24defdf99e3f60f20eef13e416ba 100644 (file)
@@ -52,38 +52,6 @@ static int qnx4_remount(struct super_block *sb, int *flags, char *data)
        return 0;
 }
 
-static struct buffer_head *qnx4_getblk(struct inode *inode, int nr,
-                                      int create)
-{
-       struct buffer_head *result = NULL;
-
-       if ( nr >= 0 )
-               nr = qnx4_block_map( inode, nr );
-       if (nr) {
-               result = sb_getblk(inode->i_sb, nr);
-               return result;
-       }
-       return NULL;
-}
-
-struct buffer_head *qnx4_bread(struct inode *inode, int block, int create)
-{
-       struct buffer_head *bh;
-
-       bh = qnx4_getblk(inode, block, create);
-       if (!bh || buffer_uptodate(bh)) {
-               return bh;
-       }
-       ll_rw_block(READ, 1, &bh);
-       wait_on_buffer(bh);
-       if (buffer_uptodate(bh)) {
-               return bh;
-       }
-       brelse(bh);
-
-       return NULL;
-}
-
 static int qnx4_get_block( struct inode *inode, sector_t iblock, struct buffer_head *bh, int create )
 {
        unsigned long phys;
index e8eb8784ed30b503a10667249a7267a8aaf2ed79..a512c0b30e8e72a853a5c7711217b2c56778a62f 100644 (file)
@@ -68,7 +68,9 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
        block = offset = blkofs = 0;
        while (blkofs * QNX4_BLOCK_SIZE + offset < dir->i_size) {
                if (!bh) {
-                       bh = qnx4_bread(dir, blkofs, 0);
+                       block = qnx4_block_map(dir, blkofs);
+                       if (block)
+                               bh = sb_bread(dir->i_sb, block);
                        if (!bh) {
                                blkofs++;
                                continue;
@@ -76,7 +78,6 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
                }
                *res_dir = (struct qnx4_inode_entry *) (bh->b_data + offset);
                if (qnx4_match(len, name, bh, &offset)) {
-                       block = qnx4_block_map( dir, blkofs );
                        *ino = block * QNX4_INODES_PER_BLOCK +
                            (offset / QNX4_DIR_ENTRY_SIZE) - 1;
                        return bh;
index 33a60858203b8141f2d96a280b7b2a96b2490d4e..244d4620189b3daf49708ad9d08b861e7106dd6d 100644 (file)
@@ -27,8 +27,6 @@ extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, stru
 extern unsigned long qnx4_count_free_blocks(struct super_block *sb);
 extern unsigned long qnx4_block_map(struct inode *inode, long iblock);
 
-extern struct buffer_head *qnx4_bread(struct inode *, int, int);
-
 extern const struct inode_operations qnx4_dir_inode_operations;
 extern const struct file_operations qnx4_dir_operations;
 extern int qnx4_is_free(struct super_block *sb, long block);