diff options
Diffstat (limited to 'fs/qnx4')
-rw-r--r-- | fs/qnx4/bitmap.c | 26 | ||||
-rw-r--r-- | fs/qnx4/dir.c | 6 | ||||
-rw-r--r-- | fs/qnx4/inode.c | 48 | ||||
-rw-r--r-- | fs/qnx4/namei.c | 6 |
4 files changed, 22 insertions, 64 deletions
diff --git a/fs/qnx4/bitmap.c b/fs/qnx4/bitmap.c index 0afba069d567..22e0d60e53ef 100644 --- a/fs/qnx4/bitmap.c +++ b/fs/qnx4/bitmap.c | |||
@@ -17,13 +17,6 @@ | |||
17 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
18 | #include "qnx4.h" | 18 | #include "qnx4.h" |
19 | 19 | ||
20 | #if 0 | ||
21 | int qnx4_new_block(struct super_block *sb) | ||
22 | { | ||
23 | return 0; | ||
24 | } | ||
25 | #endif /* 0 */ | ||
26 | |||
27 | static void count_bits(register const char *bmPart, register int size, | 20 | static void count_bits(register const char *bmPart, register int size, |
28 | int *const tf) | 21 | int *const tf) |
29 | { | 22 | { |
@@ -35,22 +28,7 @@ static void count_bits(register const char *bmPart, register int size, | |||
35 | } | 28 | } |
36 | do { | 29 | do { |
37 | b = *bmPart++; | 30 | b = *bmPart++; |
38 | if ((b & 1) == 0) | 31 | tot += 8 - hweight8(b); |
39 | tot++; | ||
40 | if ((b & 2) == 0) | ||
41 | tot++; | ||
42 | if ((b & 4) == 0) | ||
43 | tot++; | ||
44 | if ((b & 8) == 0) | ||
45 | tot++; | ||
46 | if ((b & 16) == 0) | ||
47 | tot++; | ||
48 | if ((b & 32) == 0) | ||
49 | tot++; | ||
50 | if ((b & 64) == 0) | ||
51 | tot++; | ||
52 | if ((b & 128) == 0) | ||
53 | tot++; | ||
54 | size--; | 32 | size--; |
55 | } while (size != 0); | 33 | } while (size != 0); |
56 | *tf = tot; | 34 | *tf = tot; |
@@ -67,7 +45,7 @@ unsigned long qnx4_count_free_blocks(struct super_block *sb) | |||
67 | 45 | ||
68 | while (total < size) { | 46 | while (total < size) { |
69 | if ((bh = sb_bread(sb, start + offset)) == NULL) { | 47 | if ((bh = sb_bread(sb, start + offset)) == NULL) { |
70 | printk("qnx4: I/O error in counting free blocks\n"); | 48 | printk(KERN_ERR "qnx4: I/O error in counting free blocks\n"); |
71 | break; | 49 | break; |
72 | } | 50 | } |
73 | count_bits(bh->b_data, size - total, &total_free); | 51 | count_bits(bh->b_data, size - total, &total_free); |
diff --git a/fs/qnx4/dir.c b/fs/qnx4/dir.c index 86cc39cb1398..6f30c3d5bcbf 100644 --- a/fs/qnx4/dir.c +++ b/fs/qnx4/dir.c | |||
@@ -26,8 +26,8 @@ static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
26 | int ix, ino; | 26 | int ix, ino; |
27 | int size; | 27 | int size; |
28 | 28 | ||
29 | QNX4DEBUG(("qnx4_readdir:i_size = %ld\n", (long) inode->i_size)); | 29 | QNX4DEBUG((KERN_INFO "qnx4_readdir:i_size = %ld\n", (long) inode->i_size)); |
30 | QNX4DEBUG(("filp->f_pos = %ld\n", (long) filp->f_pos)); | 30 | QNX4DEBUG((KERN_INFO "filp->f_pos = %ld\n", (long) filp->f_pos)); |
31 | 31 | ||
32 | lock_kernel(); | 32 | lock_kernel(); |
33 | 33 | ||
@@ -50,7 +50,7 @@ static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
50 | size = QNX4_NAME_MAX; | 50 | size = QNX4_NAME_MAX; |
51 | 51 | ||
52 | if ( ( de->di_status & (QNX4_FILE_USED|QNX4_FILE_LINK) ) != 0 ) { | 52 | if ( ( de->di_status & (QNX4_FILE_USED|QNX4_FILE_LINK) ) != 0 ) { |
53 | QNX4DEBUG(("qnx4_readdir:%.*s\n", size, de->di_fname)); | 53 | QNX4DEBUG((KERN_INFO "qnx4_readdir:%.*s\n", size, de->di_fname)); |
54 | if ( ( de->di_status & QNX4_FILE_LINK ) == 0 ) | 54 | if ( ( de->di_status & QNX4_FILE_LINK ) == 0 ) |
55 | ino = blknum * QNX4_INODES_PER_BLOCK + ix - 1; | 55 | ino = blknum * QNX4_INODES_PER_BLOCK + ix - 1; |
56 | else { | 56 | else { |
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index d2cd1798d8c4..ebf3440d28ca 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c | |||
@@ -64,25 +64,7 @@ static struct buffer_head *qnx4_getblk(struct inode *inode, int nr, | |||
64 | result = sb_getblk(inode->i_sb, nr); | 64 | result = sb_getblk(inode->i_sb, nr); |
65 | return result; | 65 | return result; |
66 | } | 66 | } |
67 | if (!create) { | 67 | return NULL; |
68 | return NULL; | ||
69 | } | ||
70 | #if 0 | ||
71 | tmp = qnx4_new_block(inode->i_sb); | ||
72 | if (!tmp) { | ||
73 | return NULL; | ||
74 | } | ||
75 | result = sb_getblk(inode->i_sb, tmp); | ||
76 | if (tst) { | ||
77 | qnx4_free_block(inode->i_sb, tmp); | ||
78 | brelse(result); | ||
79 | goto repeat; | ||
80 | } | ||
81 | tst = tmp; | ||
82 | #endif | ||
83 | inode->i_ctime = CURRENT_TIME_SEC; | ||
84 | mark_inode_dirty(inode); | ||
85 | return result; | ||
86 | } | 68 | } |
87 | 69 | ||
88 | struct buffer_head *qnx4_bread(struct inode *inode, int block, int create) | 70 | struct buffer_head *qnx4_bread(struct inode *inode, int block, int create) |
@@ -107,14 +89,12 @@ static int qnx4_get_block( struct inode *inode, sector_t iblock, struct buffer_h | |||
107 | { | 89 | { |
108 | unsigned long phys; | 90 | unsigned long phys; |
109 | 91 | ||
110 | QNX4DEBUG(("qnx4: qnx4_get_block inode=[%ld] iblock=[%ld]\n",inode->i_ino,iblock)); | 92 | QNX4DEBUG((KERN_INFO "qnx4: qnx4_get_block inode=[%ld] iblock=[%ld]\n",inode->i_ino,iblock)); |
111 | 93 | ||
112 | phys = qnx4_block_map( inode, iblock ); | 94 | phys = qnx4_block_map( inode, iblock ); |
113 | if ( phys ) { | 95 | if ( phys ) { |
114 | // logical block is before EOF | 96 | // logical block is before EOF |
115 | map_bh(bh, inode->i_sb, phys); | 97 | map_bh(bh, inode->i_sb, phys); |
116 | } else if ( create ) { | ||
117 | // to be done. | ||
118 | } | 98 | } |
119 | return 0; | 99 | return 0; |
120 | } | 100 | } |
@@ -142,12 +122,12 @@ unsigned long qnx4_block_map( struct inode *inode, long iblock ) | |||
142 | // read next xtnt block. | 122 | // read next xtnt block. |
143 | bh = sb_bread(inode->i_sb, i_xblk - 1); | 123 | bh = sb_bread(inode->i_sb, i_xblk - 1); |
144 | if ( !bh ) { | 124 | if ( !bh ) { |
145 | QNX4DEBUG(("qnx4: I/O error reading xtnt block [%ld])\n", i_xblk - 1)); | 125 | QNX4DEBUG((KERN_ERR "qnx4: I/O error reading xtnt block [%ld])\n", i_xblk - 1)); |
146 | return -EIO; | 126 | return -EIO; |
147 | } | 127 | } |
148 | xblk = (struct qnx4_xblk*)bh->b_data; | 128 | xblk = (struct qnx4_xblk*)bh->b_data; |
149 | if ( memcmp( xblk->xblk_signature, "IamXblk", 7 ) ) { | 129 | if ( memcmp( xblk->xblk_signature, "IamXblk", 7 ) ) { |
150 | QNX4DEBUG(("qnx4: block at %ld is not a valid xtnt\n", qnx4_inode->i_xblk)); | 130 | QNX4DEBUG((KERN_ERR "qnx4: block at %ld is not a valid xtnt\n", qnx4_inode->i_xblk)); |
151 | return -EIO; | 131 | return -EIO; |
152 | } | 132 | } |
153 | } | 133 | } |
@@ -168,7 +148,7 @@ unsigned long qnx4_block_map( struct inode *inode, long iblock ) | |||
168 | brelse( bh ); | 148 | brelse( bh ); |
169 | } | 149 | } |
170 | 150 | ||
171 | QNX4DEBUG(("qnx4: mapping block %ld of inode %ld = %ld\n",iblock,inode->i_ino,block)); | 151 | QNX4DEBUG((KERN_INFO "qnx4: mapping block %ld of inode %ld = %ld\n",iblock,inode->i_ino,block)); |
172 | return block; | 152 | return block; |
173 | } | 153 | } |
174 | 154 | ||
@@ -209,7 +189,7 @@ static const char *qnx4_checkroot(struct super_block *sb) | |||
209 | if (*(qnx4_sb(sb)->sb->RootDir.di_fname) != '/') { | 189 | if (*(qnx4_sb(sb)->sb->RootDir.di_fname) != '/') { |
210 | return "no qnx4 filesystem (no root dir)."; | 190 | return "no qnx4 filesystem (no root dir)."; |
211 | } else { | 191 | } else { |
212 | QNX4DEBUG(("QNX4 filesystem found on dev %s.\n", sb->s_id)); | 192 | QNX4DEBUG((KERN_NOTICE "QNX4 filesystem found on dev %s.\n", sb->s_id)); |
213 | rd = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_blk) - 1; | 193 | rd = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_blk) - 1; |
214 | rl = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_size); | 194 | rl = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_size); |
215 | for (j = 0; j < rl; j++) { | 195 | for (j = 0; j < rl; j++) { |
@@ -220,7 +200,7 @@ static const char *qnx4_checkroot(struct super_block *sb) | |||
220 | for (i = 0; i < QNX4_INODES_PER_BLOCK; i++) { | 200 | for (i = 0; i < QNX4_INODES_PER_BLOCK; i++) { |
221 | rootdir = (struct qnx4_inode_entry *) (bh->b_data + i * QNX4_DIR_ENTRY_SIZE); | 201 | rootdir = (struct qnx4_inode_entry *) (bh->b_data + i * QNX4_DIR_ENTRY_SIZE); |
222 | if (rootdir->di_fname != NULL) { | 202 | if (rootdir->di_fname != NULL) { |
223 | QNX4DEBUG(("Rootdir entry found : [%s]\n", rootdir->di_fname)); | 203 | QNX4DEBUG((KERN_INFO "rootdir entry found : [%s]\n", rootdir->di_fname)); |
224 | if (!strncmp(rootdir->di_fname, QNX4_BMNAME, sizeof QNX4_BMNAME)) { | 204 | if (!strncmp(rootdir->di_fname, QNX4_BMNAME, sizeof QNX4_BMNAME)) { |
225 | found = 1; | 205 | found = 1; |
226 | qnx4_sb(sb)->BitMap = kmalloc( sizeof( struct qnx4_inode_entry ), GFP_KERNEL ); | 206 | qnx4_sb(sb)->BitMap = kmalloc( sizeof( struct qnx4_inode_entry ), GFP_KERNEL ); |
@@ -265,12 +245,12 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent) | |||
265 | if we don't belong here... */ | 245 | if we don't belong here... */ |
266 | bh = sb_bread(s, 1); | 246 | bh = sb_bread(s, 1); |
267 | if (!bh) { | 247 | if (!bh) { |
268 | printk("qnx4: unable to read the superblock\n"); | 248 | printk(KERN_ERR "qnx4: unable to read the superblock\n"); |
269 | goto outnobh; | 249 | goto outnobh; |
270 | } | 250 | } |
271 | if ( le32_to_cpup((__le32*) bh->b_data) != QNX4_SUPER_MAGIC ) { | 251 | if ( le32_to_cpup((__le32*) bh->b_data) != QNX4_SUPER_MAGIC ) { |
272 | if (!silent) | 252 | if (!silent) |
273 | printk("qnx4: wrong fsid in superblock.\n"); | 253 | printk(KERN_ERR "qnx4: wrong fsid in superblock.\n"); |
274 | goto out; | 254 | goto out; |
275 | } | 255 | } |
276 | s->s_op = &qnx4_sops; | 256 | s->s_op = &qnx4_sops; |
@@ -284,14 +264,14 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent) | |||
284 | errmsg = qnx4_checkroot(s); | 264 | errmsg = qnx4_checkroot(s); |
285 | if (errmsg != NULL) { | 265 | if (errmsg != NULL) { |
286 | if (!silent) | 266 | if (!silent) |
287 | printk("qnx4: %s\n", errmsg); | 267 | printk(KERN_ERR "qnx4: %s\n", errmsg); |
288 | goto out; | 268 | goto out; |
289 | } | 269 | } |
290 | 270 | ||
291 | /* does root not have inode number QNX4_ROOT_INO ?? */ | 271 | /* does root not have inode number QNX4_ROOT_INO ?? */ |
292 | root = qnx4_iget(s, QNX4_ROOT_INO * QNX4_INODES_PER_BLOCK); | 272 | root = qnx4_iget(s, QNX4_ROOT_INO * QNX4_INODES_PER_BLOCK); |
293 | if (IS_ERR(root)) { | 273 | if (IS_ERR(root)) { |
294 | printk("qnx4: get inode failed\n"); | 274 | printk(KERN_ERR "qnx4: get inode failed\n"); |
295 | ret = PTR_ERR(root); | 275 | ret = PTR_ERR(root); |
296 | goto out; | 276 | goto out; |
297 | } | 277 | } |
@@ -374,7 +354,7 @@ struct inode *qnx4_iget(struct super_block *sb, unsigned long ino) | |||
374 | qnx4_inode = qnx4_raw_inode(inode); | 354 | qnx4_inode = qnx4_raw_inode(inode); |
375 | inode->i_mode = 0; | 355 | inode->i_mode = 0; |
376 | 356 | ||
377 | QNX4DEBUG(("Reading inode : [%d]\n", ino)); | 357 | QNX4DEBUG((KERN_INFO "reading inode : [%d]\n", ino)); |
378 | if (!ino) { | 358 | if (!ino) { |
379 | printk(KERN_ERR "qnx4: bad inode number on dev %s: %lu is " | 359 | printk(KERN_ERR "qnx4: bad inode number on dev %s: %lu is " |
380 | "out of range\n", | 360 | "out of range\n", |
@@ -385,7 +365,7 @@ struct inode *qnx4_iget(struct super_block *sb, unsigned long ino) | |||
385 | block = ino / QNX4_INODES_PER_BLOCK; | 365 | block = ino / QNX4_INODES_PER_BLOCK; |
386 | 366 | ||
387 | if (!(bh = sb_bread(sb, block))) { | 367 | if (!(bh = sb_bread(sb, block))) { |
388 | printk("qnx4: major problem: unable to read inode from dev " | 368 | printk(KERN_ERR "qnx4: major problem: unable to read inode from dev " |
389 | "%s\n", sb->s_id); | 369 | "%s\n", sb->s_id); |
390 | iget_failed(inode); | 370 | iget_failed(inode); |
391 | return ERR_PTR(-EIO); | 371 | return ERR_PTR(-EIO); |
@@ -499,7 +479,7 @@ static int __init init_qnx4_fs(void) | |||
499 | return err; | 479 | return err; |
500 | } | 480 | } |
501 | 481 | ||
502 | printk("QNX4 filesystem 0.2.3 registered.\n"); | 482 | printk(KERN_INFO "QNX4 filesystem 0.2.3 registered.\n"); |
503 | return 0; | 483 | return 0; |
504 | } | 484 | } |
505 | 485 | ||
diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c index ae1e7edbacd6..58703ebba879 100644 --- a/fs/qnx4/namei.c +++ b/fs/qnx4/namei.c | |||
@@ -30,7 +30,7 @@ static int qnx4_match(int len, const char *name, | |||
30 | int namelen, thislen; | 30 | int namelen, thislen; |
31 | 31 | ||
32 | if (bh == NULL) { | 32 | if (bh == NULL) { |
33 | printk("qnx4: matching unassigned buffer !\n"); | 33 | printk(KERN_WARNING "qnx4: matching unassigned buffer !\n"); |
34 | return 0; | 34 | return 0; |
35 | } | 35 | } |
36 | de = (struct qnx4_inode_entry *) (bh->b_data + *offset); | 36 | de = (struct qnx4_inode_entry *) (bh->b_data + *offset); |
@@ -66,7 +66,7 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir, | |||
66 | 66 | ||
67 | *res_dir = NULL; | 67 | *res_dir = NULL; |
68 | if (!dir->i_sb) { | 68 | if (!dir->i_sb) { |
69 | printk("qnx4: no superblock on dir.\n"); | 69 | printk(KERN_WARNING "qnx4: no superblock on dir.\n"); |
70 | return NULL; | 70 | return NULL; |
71 | } | 71 | } |
72 | bh = NULL; | 72 | bh = NULL; |
@@ -124,7 +124,7 @@ struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nam | |||
124 | foundinode = qnx4_iget(dir->i_sb, ino); | 124 | foundinode = qnx4_iget(dir->i_sb, ino); |
125 | if (IS_ERR(foundinode)) { | 125 | if (IS_ERR(foundinode)) { |
126 | unlock_kernel(); | 126 | unlock_kernel(); |
127 | QNX4DEBUG(("qnx4: lookup->iget -> error %ld\n", | 127 | QNX4DEBUG((KERN_ERR "qnx4: lookup->iget -> error %ld\n", |
128 | PTR_ERR(foundinode))); | 128 | PTR_ERR(foundinode))); |
129 | return ERR_CAST(foundinode); | 129 | return ERR_CAST(foundinode); |
130 | } | 130 | } |