aboutsummaryrefslogtreecommitdiffstats
path: root/fs/qnx4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/qnx4')
-rw-r--r--fs/qnx4/inode.c32
-rw-r--r--fs/qnx4/namei.c5
-rw-r--r--fs/qnx4/qnx4.h2
3 files changed, 3 insertions, 36 deletions
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index 14a0ba0f0c1c..7900a813d90f 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -52,38 +52,6 @@ static int qnx4_remount(struct super_block *sb, int *flags, char *data)
52 return 0; 52 return 0;
53} 53}
54 54
55static struct buffer_head *qnx4_getblk(struct inode *inode, int nr,
56 int create)
57{
58 struct buffer_head *result = NULL;
59
60 if ( nr >= 0 )
61 nr = qnx4_block_map( inode, nr );
62 if (nr) {
63 result = sb_getblk(inode->i_sb, nr);
64 return result;
65 }
66 return NULL;
67}
68
69struct buffer_head *qnx4_bread(struct inode *inode, int block, int create)
70{
71 struct buffer_head *bh;
72
73 bh = qnx4_getblk(inode, block, create);
74 if (!bh || buffer_uptodate(bh)) {
75 return bh;
76 }
77 ll_rw_block(READ, 1, &bh);
78 wait_on_buffer(bh);
79 if (buffer_uptodate(bh)) {
80 return bh;
81 }
82 brelse(bh);
83
84 return NULL;
85}
86
87static int qnx4_get_block( struct inode *inode, sector_t iblock, struct buffer_head *bh, int create ) 55static int qnx4_get_block( struct inode *inode, sector_t iblock, struct buffer_head *bh, int create )
88{ 56{
89 unsigned long phys; 57 unsigned long phys;
diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c
index e8eb8784ed30..a512c0b30e8e 100644
--- a/fs/qnx4/namei.c
+++ b/fs/qnx4/namei.c
@@ -68,7 +68,9 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
68 block = offset = blkofs = 0; 68 block = offset = blkofs = 0;
69 while (blkofs * QNX4_BLOCK_SIZE + offset < dir->i_size) { 69 while (blkofs * QNX4_BLOCK_SIZE + offset < dir->i_size) {
70 if (!bh) { 70 if (!bh) {
71 bh = qnx4_bread(dir, blkofs, 0); 71 block = qnx4_block_map(dir, blkofs);
72 if (block)
73 bh = sb_bread(dir->i_sb, block);
72 if (!bh) { 74 if (!bh) {
73 blkofs++; 75 blkofs++;
74 continue; 76 continue;
@@ -76,7 +78,6 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
76 } 78 }
77 *res_dir = (struct qnx4_inode_entry *) (bh->b_data + offset); 79 *res_dir = (struct qnx4_inode_entry *) (bh->b_data + offset);
78 if (qnx4_match(len, name, bh, &offset)) { 80 if (qnx4_match(len, name, bh, &offset)) {
79 block = qnx4_block_map( dir, blkofs );
80 *ino = block * QNX4_INODES_PER_BLOCK + 81 *ino = block * QNX4_INODES_PER_BLOCK +
81 (offset / QNX4_DIR_ENTRY_SIZE) - 1; 82 (offset / QNX4_DIR_ENTRY_SIZE) - 1;
82 return bh; 83 return bh;
diff --git a/fs/qnx4/qnx4.h b/fs/qnx4/qnx4.h
index 33a60858203b..244d4620189b 100644
--- a/fs/qnx4/qnx4.h
+++ b/fs/qnx4/qnx4.h
@@ -27,8 +27,6 @@ extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, stru
27extern unsigned long qnx4_count_free_blocks(struct super_block *sb); 27extern unsigned long qnx4_count_free_blocks(struct super_block *sb);
28extern unsigned long qnx4_block_map(struct inode *inode, long iblock); 28extern unsigned long qnx4_block_map(struct inode *inode, long iblock);
29 29
30extern struct buffer_head *qnx4_bread(struct inode *, int, int);
31
32extern const struct inode_operations qnx4_dir_inode_operations; 30extern const struct inode_operations qnx4_dir_inode_operations;
33extern const struct file_operations qnx4_dir_operations; 31extern const struct file_operations qnx4_dir_operations;
34extern int qnx4_is_free(struct super_block *sb, long block); 32extern int qnx4_is_free(struct super_block *sb, long block);