aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Salikhmetov <alexo@tuxera.com>2010-12-16 11:08:38 -0500
committerChristoph Hellwig <hch@tuxera.com>2010-12-16 12:08:45 -0500
commit2753cc281c9a0e8a0a45ee2b8110866a9fe63bdd (patch)
treed28794ef990637cfcd734a8b467f119e6d69dac1
parent596276c3571e2108f4b336be545ece2eacf3da59 (diff)
hfsplus: over 80 character lines clean-up
Match coding style line length limitation where checkpatch.pl reported over-80-character-line warnings. Signed-off-by: Anton Salikhmetov <alexo@tuxera.com> Signed-off-by: Christoph Hellwig <hch@tuxera.com>
-rw-r--r--fs/hfsplus/bfind.c6
-rw-r--r--fs/hfsplus/bitmap.c3
-rw-r--r--fs/hfsplus/bnode.c41
-rw-r--r--fs/hfsplus/brec.c26
-rw-r--r--fs/hfsplus/btree.c31
-rw-r--r--fs/hfsplus/catalog.c75
-rw-r--r--fs/hfsplus/dir.c34
-rw-r--r--fs/hfsplus/extents.c28
-rw-r--r--fs/hfsplus/hfsplus_fs.h30
-rw-r--r--fs/hfsplus/hfsplus_raw.h3
-rw-r--r--fs/hfsplus/inode.c26
-rw-r--r--fs/hfsplus/options.c7
-rw-r--r--fs/hfsplus/part_tbl.c3
-rw-r--r--fs/hfsplus/super.c34
-rw-r--r--fs/hfsplus/unicode.c21
-rw-r--r--fs/hfsplus/wrapper.c15
16 files changed, 260 insertions, 123 deletions
diff --git a/fs/hfsplus/bfind.c b/fs/hfsplus/bfind.c
index d182438c7ae4..5d799c13205f 100644
--- a/fs/hfsplus/bfind.c
+++ b/fs/hfsplus/bfind.c
@@ -22,7 +22,8 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd)
22 return -ENOMEM; 22 return -ENOMEM;
23 fd->search_key = ptr; 23 fd->search_key = ptr;
24 fd->key = ptr + tree->max_key_len + 2; 24 fd->key = ptr + tree->max_key_len + 2;
25 dprint(DBG_BNODE_REFS, "find_init: %d (%p)\n", tree->cnid, __builtin_return_address(0)); 25 dprint(DBG_BNODE_REFS, "find_init: %d (%p)\n",
26 tree->cnid, __builtin_return_address(0));
26 mutex_lock(&tree->tree_lock); 27 mutex_lock(&tree->tree_lock);
27 return 0; 28 return 0;
28} 29}
@@ -31,7 +32,8 @@ void hfs_find_exit(struct hfs_find_data *fd)
31{ 32{
32 hfs_bnode_put(fd->bnode); 33 hfs_bnode_put(fd->bnode);
33 kfree(fd->search_key); 34 kfree(fd->search_key);
34 dprint(DBG_BNODE_REFS, "find_exit: %d (%p)\n", fd->tree->cnid, __builtin_return_address(0)); 35 dprint(DBG_BNODE_REFS, "find_exit: %d (%p)\n",
36 fd->tree->cnid, __builtin_return_address(0));
35 mutex_unlock(&fd->tree->tree_lock); 37 mutex_unlock(&fd->tree->tree_lock);
36 fd->tree = NULL; 38 fd->tree = NULL;
37} 39}
diff --git a/fs/hfsplus/bitmap.c b/fs/hfsplus/bitmap.c
index ad57f5991eb1..1cad80c789cb 100644
--- a/fs/hfsplus/bitmap.c
+++ b/fs/hfsplus/bitmap.c
@@ -15,7 +15,8 @@
15 15
16#define PAGE_CACHE_BITS (PAGE_CACHE_SIZE * 8) 16#define PAGE_CACHE_BITS (PAGE_CACHE_SIZE * 8)
17 17
18int hfsplus_block_allocate(struct super_block *sb, u32 size, u32 offset, u32 *max) 18int hfsplus_block_allocate(struct super_block *sb, u32 size,
19 u32 offset, u32 *max)
19{ 20{
20 struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb); 21 struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
21 struct page *page; 22 struct page *page;
diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c
index c8aa1659b838..cf7dc8dac766 100644
--- a/fs/hfsplus/bnode.c
+++ b/fs/hfsplus/bnode.c
@@ -212,7 +212,8 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len)
212 dst_page--; 212 dst_page--;
213 } 213 }
214 src -= len; 214 src -= len;
215 memmove(kmap(*dst_page) + src, kmap(*src_page) + src, len); 215 memmove(kmap(*dst_page) + src,
216 kmap(*src_page) + src, len);
216 kunmap(*src_page); 217 kunmap(*src_page);
217 set_page_dirty(*dst_page); 218 set_page_dirty(*dst_page);
218 kunmap(*dst_page); 219 kunmap(*dst_page);
@@ -250,14 +251,16 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len)
250 251
251 if (src == dst) { 252 if (src == dst) {
252 l = min(len, (int)PAGE_CACHE_SIZE - src); 253 l = min(len, (int)PAGE_CACHE_SIZE - src);
253 memmove(kmap(*dst_page) + src, kmap(*src_page) + src, l); 254 memmove(kmap(*dst_page) + src,
255 kmap(*src_page) + src, l);
254 kunmap(*src_page); 256 kunmap(*src_page);
255 set_page_dirty(*dst_page); 257 set_page_dirty(*dst_page);
256 kunmap(*dst_page); 258 kunmap(*dst_page);
257 259
258 while ((len -= l) != 0) { 260 while ((len -= l) != 0) {
259 l = min(len, (int)PAGE_CACHE_SIZE); 261 l = min(len, (int)PAGE_CACHE_SIZE);
260 memmove(kmap(*++dst_page), kmap(*++src_page), l); 262 memmove(kmap(*++dst_page),
263 kmap(*++src_page), l);
261 kunmap(*src_page); 264 kunmap(*src_page);
262 set_page_dirty(*dst_page); 265 set_page_dirty(*dst_page);
263 kunmap(*dst_page); 266 kunmap(*dst_page);
@@ -268,7 +271,8 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len)
268 do { 271 do {
269 src_ptr = kmap(*src_page) + src; 272 src_ptr = kmap(*src_page) + src;
270 dst_ptr = kmap(*dst_page) + dst; 273 dst_ptr = kmap(*dst_page) + dst;
271 if (PAGE_CACHE_SIZE - src < PAGE_CACHE_SIZE - dst) { 274 if (PAGE_CACHE_SIZE - src <
275 PAGE_CACHE_SIZE - dst) {
272 l = PAGE_CACHE_SIZE - src; 276 l = PAGE_CACHE_SIZE - src;
273 src = 0; 277 src = 0;
274 dst += l; 278 dst += l;
@@ -340,7 +344,8 @@ void hfs_bnode_unlink(struct hfs_bnode *node)
340 return; 344 return;
341 tmp->next = node->next; 345 tmp->next = node->next;
342 cnid = cpu_to_be32(tmp->next); 346 cnid = cpu_to_be32(tmp->next);
343 hfs_bnode_write(tmp, &cnid, offsetof(struct hfs_bnode_desc, next), 4); 347 hfs_bnode_write(tmp, &cnid,
348 offsetof(struct hfs_bnode_desc, next), 4);
344 hfs_bnode_put(tmp); 349 hfs_bnode_put(tmp);
345 } else if (node->type == HFS_NODE_LEAF) 350 } else if (node->type == HFS_NODE_LEAF)
346 tree->leaf_head = node->next; 351 tree->leaf_head = node->next;
@@ -351,7 +356,8 @@ void hfs_bnode_unlink(struct hfs_bnode *node)
351 return; 356 return;
352 tmp->prev = node->prev; 357 tmp->prev = node->prev;
353 cnid = cpu_to_be32(tmp->prev); 358 cnid = cpu_to_be32(tmp->prev);
354 hfs_bnode_write(tmp, &cnid, offsetof(struct hfs_bnode_desc, prev), 4); 359 hfs_bnode_write(tmp, &cnid,
360 offsetof(struct hfs_bnode_desc, prev), 4);
355 hfs_bnode_put(tmp); 361 hfs_bnode_put(tmp);
356 } else if (node->type == HFS_NODE_LEAF) 362 } else if (node->type == HFS_NODE_LEAF)
357 tree->leaf_tail = node->prev; 363 tree->leaf_tail = node->prev;
@@ -379,7 +385,9 @@ struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid)
379 struct hfs_bnode *node; 385 struct hfs_bnode *node;
380 386
381 if (cnid >= tree->node_count) { 387 if (cnid >= tree->node_count) {
382 printk(KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid); 388 printk(KERN_ERR "hfs: request for non-existent node "
389 "%d in B*Tree\n",
390 cnid);
383 return NULL; 391 return NULL;
384 } 392 }
385 393
@@ -402,7 +410,9 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
402 loff_t off; 410 loff_t off;
403 411
404 if (cnid >= tree->node_count) { 412 if (cnid >= tree->node_count) {
405 printk(KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid); 413 printk(KERN_ERR "hfs: request for non-existent node "
414 "%d in B*Tree\n",
415 cnid);
406 return NULL; 416 return NULL;
407 } 417 }
408 418
@@ -429,7 +439,8 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
429 } else { 439 } else {
430 spin_unlock(&tree->hash_lock); 440 spin_unlock(&tree->hash_lock);
431 kfree(node); 441 kfree(node);
432 wait_event(node2->lock_wq, !test_bit(HFS_BNODE_NEW, &node2->flags)); 442 wait_event(node2->lock_wq,
443 !test_bit(HFS_BNODE_NEW, &node2->flags));
433 return node2; 444 return node2;
434 } 445 }
435 spin_unlock(&tree->hash_lock); 446 spin_unlock(&tree->hash_lock);
@@ -483,7 +494,8 @@ struct hfs_bnode *hfs_bnode_find(struct hfs_btree *tree, u32 num)
483 if (node) { 494 if (node) {
484 hfs_bnode_get(node); 495 hfs_bnode_get(node);
485 spin_unlock(&tree->hash_lock); 496 spin_unlock(&tree->hash_lock);
486 wait_event(node->lock_wq, !test_bit(HFS_BNODE_NEW, &node->flags)); 497 wait_event(node->lock_wq,
498 !test_bit(HFS_BNODE_NEW, &node->flags));
487 if (test_bit(HFS_BNODE_ERROR, &node->flags)) 499 if (test_bit(HFS_BNODE_ERROR, &node->flags))
488 goto node_error; 500 goto node_error;
489 return node; 501 return node;
@@ -497,7 +509,8 @@ struct hfs_bnode *hfs_bnode_find(struct hfs_btree *tree, u32 num)
497 if (!test_bit(HFS_BNODE_NEW, &node->flags)) 509 if (!test_bit(HFS_BNODE_NEW, &node->flags))
498 return node; 510 return node;
499 511
500 desc = (struct hfs_bnode_desc *)(kmap(node->page[0]) + node->page_offset); 512 desc = (struct hfs_bnode_desc *)(kmap(node->page[0]) +
513 node->page_offset);
501 node->prev = be32_to_cpu(desc->prev); 514 node->prev = be32_to_cpu(desc->prev);
502 node->next = be32_to_cpu(desc->next); 515 node->next = be32_to_cpu(desc->next);
503 node->num_recs = be16_to_cpu(desc->num_recs); 516 node->num_recs = be16_to_cpu(desc->num_recs);
@@ -607,7 +620,8 @@ void hfs_bnode_get(struct hfs_bnode *node)
607 if (node) { 620 if (node) {
608 atomic_inc(&node->refcnt); 621 atomic_inc(&node->refcnt);
609 dprint(DBG_BNODE_REFS, "get_node(%d:%d): %d\n", 622 dprint(DBG_BNODE_REFS, "get_node(%d:%d): %d\n",
610 node->tree->cnid, node->this, atomic_read(&node->refcnt)); 623 node->tree->cnid, node->this,
624 atomic_read(&node->refcnt));
611 } 625 }
612} 626}
613 627
@@ -619,7 +633,8 @@ void hfs_bnode_put(struct hfs_bnode *node)
619 int i; 633 int i;
620 634
621 dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n", 635 dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n",
622 node->tree->cnid, node->this, atomic_read(&node->refcnt)); 636 node->tree->cnid, node->this,
637 atomic_read(&node->refcnt));
623 BUG_ON(!atomic_read(&node->refcnt)); 638 BUG_ON(!atomic_read(&node->refcnt));
624 if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) 639 if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock))
625 return; 640 return;
diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c
index 81f7e6e51d5a..2312de34bd42 100644
--- a/fs/hfsplus/brec.c
+++ b/fs/hfsplus/brec.c
@@ -39,7 +39,8 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
39 !(node->tree->attributes & HFS_TREE_VARIDXKEYS)) { 39 !(node->tree->attributes & HFS_TREE_VARIDXKEYS)) {
40 retval = node->tree->max_key_len + 2; 40 retval = node->tree->max_key_len + 2;
41 } else { 41 } else {
42 recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2); 42 recoff = hfs_bnode_read_u16(node,
43 node->tree->node_size - (rec + 1) * 2);
43 if (!recoff) 44 if (!recoff)
44 return 0; 45 return 0;
45 46
@@ -84,7 +85,8 @@ again:
84 end_rec_off = tree->node_size - (node->num_recs + 1) * 2; 85 end_rec_off = tree->node_size - (node->num_recs + 1) * 2;
85 end_off = hfs_bnode_read_u16(node, end_rec_off); 86 end_off = hfs_bnode_read_u16(node, end_rec_off);
86 end_rec_off -= 2; 87 end_rec_off -= 2;
87 dprint(DBG_BNODE_MOD, "insert_rec: %d, %d, %d, %d\n", rec, size, end_off, end_rec_off); 88 dprint(DBG_BNODE_MOD, "insert_rec: %d, %d, %d, %d\n",
89 rec, size, end_off, end_rec_off);
88 if (size > end_rec_off - end_off) { 90 if (size > end_rec_off - end_off) {
89 if (new_node) 91 if (new_node)
90 panic("not enough room!\n"); 92 panic("not enough room!\n");
@@ -99,7 +101,9 @@ again:
99 } 101 }
100 node->num_recs++; 102 node->num_recs++;
101 /* write new last offset */ 103 /* write new last offset */
102 hfs_bnode_write_u16(node, offsetof(struct hfs_bnode_desc, num_recs), node->num_recs); 104 hfs_bnode_write_u16(node,
105 offsetof(struct hfs_bnode_desc, num_recs),
106 node->num_recs);
103 hfs_bnode_write_u16(node, end_rec_off, end_off + size); 107 hfs_bnode_write_u16(node, end_rec_off, end_off + size);
104 data_off = end_off; 108 data_off = end_off;
105 data_rec_off = end_rec_off + 2; 109 data_rec_off = end_rec_off + 2;
@@ -151,7 +155,8 @@ skip:
151 if (tree->attributes & HFS_TREE_VARIDXKEYS) 155 if (tree->attributes & HFS_TREE_VARIDXKEYS)
152 key_len = be16_to_cpu(fd->search_key->key_len) + 2; 156 key_len = be16_to_cpu(fd->search_key->key_len) + 2;
153 else { 157 else {
154 fd->search_key->key_len = cpu_to_be16(tree->max_key_len); 158 fd->search_key->key_len =
159 cpu_to_be16(tree->max_key_len);
155 key_len = tree->max_key_len + 2; 160 key_len = tree->max_key_len + 2;
156 } 161 }
157 goto again; 162 goto again;
@@ -180,7 +185,8 @@ again:
180 mark_inode_dirty(tree->inode); 185 mark_inode_dirty(tree->inode);
181 } 186 }
182 hfs_bnode_dump(node); 187 hfs_bnode_dump(node);
183 dprint(DBG_BNODE_MOD, "remove_rec: %d, %d\n", fd->record, fd->keylength + fd->entrylength); 188 dprint(DBG_BNODE_MOD, "remove_rec: %d, %d\n",
189 fd->record, fd->keylength + fd->entrylength);
184 if (!--node->num_recs) { 190 if (!--node->num_recs) {
185 hfs_bnode_unlink(node); 191 hfs_bnode_unlink(node);
186 if (!node->parent) 192 if (!node->parent)
@@ -194,7 +200,9 @@ again:
194 __hfs_brec_find(node, fd); 200 __hfs_brec_find(node, fd);
195 goto again; 201 goto again;
196 } 202 }
197 hfs_bnode_write_u16(node, offsetof(struct hfs_bnode_desc, num_recs), node->num_recs); 203 hfs_bnode_write_u16(node,
204 offsetof(struct hfs_bnode_desc, num_recs),
205 node->num_recs);
198 206
199 if (rec_off == end_off) 207 if (rec_off == end_off)
200 goto skip; 208 goto skip;
@@ -364,7 +372,8 @@ again:
364 newkeylen = hfs_bnode_read_u16(node, 14) + 2; 372 newkeylen = hfs_bnode_read_u16(node, 14) + 2;
365 else 373 else
366 fd->keylength = newkeylen = tree->max_key_len + 2; 374 fd->keylength = newkeylen = tree->max_key_len + 2;
367 dprint(DBG_BNODE_MOD, "update_rec: %d, %d, %d\n", rec, fd->keylength, newkeylen); 375 dprint(DBG_BNODE_MOD, "update_rec: %d, %d, %d\n",
376 rec, fd->keylength, newkeylen);
368 377
369 rec_off = tree->node_size - (rec + 2) * 2; 378 rec_off = tree->node_size - (rec + 2) * 2;
370 end_rec_off = tree->node_size - (parent->num_recs + 1) * 2; 379 end_rec_off = tree->node_size - (parent->num_recs + 1) * 2;
@@ -383,7 +392,8 @@ again:
383 parent = fd->bnode; 392 parent = fd->bnode;
384 rec = fd->record; 393 rec = fd->record;
385 rec_off = tree->node_size - (rec + 2) * 2; 394 rec_off = tree->node_size - (rec + 2) * 2;
386 end_rec_off = tree->node_size - (parent->num_recs + 1) * 2; 395 end_rec_off = tree->node_size -
396 (parent->num_recs + 1) * 2;
387 } 397 }
388 } 398 }
389 399
diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
index 97556f932d57..21023d9f8ff3 100644
--- a/fs/hfsplus/btree.c
+++ b/fs/hfsplus/btree.c
@@ -51,7 +51,8 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
51 goto free_inode; 51 goto free_inode;
52 52
53 /* Load the header */ 53 /* Load the header */
54 head = (struct hfs_btree_header_rec *)(kmap(page) + sizeof(struct hfs_bnode_desc)); 54 head = (struct hfs_btree_header_rec *)(kmap(page) +
55 sizeof(struct hfs_bnode_desc));
55 tree->root = be32_to_cpu(head->root); 56 tree->root = be32_to_cpu(head->root);
56 tree->leaf_count = be32_to_cpu(head->leaf_count); 57 tree->leaf_count = be32_to_cpu(head->leaf_count);
57 tree->leaf_head = be32_to_cpu(head->leaf_head); 58 tree->leaf_head = be32_to_cpu(head->leaf_head);
@@ -115,7 +116,9 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
115 116
116 tree->node_size_shift = ffs(size) - 1; 117 tree->node_size_shift = ffs(size) - 1;
117 118
118 tree->pages_per_bnode = (tree->node_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 119 tree->pages_per_bnode =
120 (tree->node_size + PAGE_CACHE_SIZE - 1) >>
121 PAGE_CACHE_SHIFT;
119 122
120 kunmap(page); 123 kunmap(page);
121 page_cache_release(page); 124 page_cache_release(page);
@@ -144,8 +147,10 @@ void hfs_btree_close(struct hfs_btree *tree)
144 while ((node = tree->node_hash[i])) { 147 while ((node = tree->node_hash[i])) {
145 tree->node_hash[i] = node->next_hash; 148 tree->node_hash[i] = node->next_hash;
146 if (atomic_read(&node->refcnt)) 149 if (atomic_read(&node->refcnt))
147 printk(KERN_CRIT "hfs: node %d:%d still has %d user(s)!\n", 150 printk(KERN_CRIT "hfs: node %d:%d "
148 node->tree->cnid, node->this, atomic_read(&node->refcnt)); 151 "still has %d user(s)!\n",
152 node->tree->cnid, node->this,
153 atomic_read(&node->refcnt));
149 hfs_bnode_free(node); 154 hfs_bnode_free(node);
150 tree->node_hash_cnt--; 155 tree->node_hash_cnt--;
151 } 156 }
@@ -166,7 +171,8 @@ void hfs_btree_write(struct hfs_btree *tree)
166 return; 171 return;
167 /* Load the header */ 172 /* Load the header */
168 page = node->page[0]; 173 page = node->page[0];
169 head = (struct hfs_btree_header_rec *)(kmap(page) + sizeof(struct hfs_bnode_desc)); 174 head = (struct hfs_btree_header_rec *)(kmap(page) +
175 sizeof(struct hfs_bnode_desc));
170 176
171 head->root = cpu_to_be32(tree->root); 177 head->root = cpu_to_be32(tree->root);
172 head->leaf_count = cpu_to_be32(tree->leaf_count); 178 head->leaf_count = cpu_to_be32(tree->leaf_count);
@@ -272,7 +278,8 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
272 tree->free_nodes--; 278 tree->free_nodes--;
273 mark_inode_dirty(tree->inode); 279 mark_inode_dirty(tree->inode);
274 hfs_bnode_put(node); 280 hfs_bnode_put(node);
275 return hfs_bnode_create(tree, idx); 281 return hfs_bnode_create(tree,
282 idx);
276 } 283 }
277 } 284 }
278 } 285 }
@@ -329,7 +336,9 @@ void hfs_bmap_free(struct hfs_bnode *node)
329 hfs_bnode_put(node); 336 hfs_bnode_put(node);
330 if (!i) { 337 if (!i) {
331 /* panic */; 338 /* panic */;
332 printk(KERN_CRIT "hfs: unable to free bnode %u. bmap not found!\n", node->this); 339 printk(KERN_CRIT "hfs: unable to free bnode %u. "
340 "bmap not found!\n",
341 node->this);
333 return; 342 return;
334 } 343 }
335 node = hfs_bnode_find(tree, i); 344 node = hfs_bnode_find(tree, i);
@@ -337,7 +346,9 @@ void hfs_bmap_free(struct hfs_bnode *node)
337 return; 346 return;
338 if (node->type != HFS_NODE_MAP) { 347 if (node->type != HFS_NODE_MAP) {
339 /* panic */; 348 /* panic */;
340 printk(KERN_CRIT "hfs: invalid bmap found! (%u,%d)\n", node->this, node->type); 349 printk(KERN_CRIT "hfs: invalid bmap found! "
350 "(%u,%d)\n",
351 node->this, node->type);
341 hfs_bnode_put(node); 352 hfs_bnode_put(node);
342 return; 353 return;
343 } 354 }
@@ -350,7 +361,9 @@ void hfs_bmap_free(struct hfs_bnode *node)
350 m = 1 << (~nidx & 7); 361 m = 1 << (~nidx & 7);
351 byte = data[off]; 362 byte = data[off];
352 if (!(byte & m)) { 363 if (!(byte & m)) {
353 printk(KERN_CRIT "hfs: trying to free free bnode %u(%d)\n", node->this, node->type); 364 printk(KERN_CRIT "hfs: trying to free free bnode "
365 "%u(%d)\n",
366 node->this, node->type);
354 kunmap(page); 367 kunmap(page);
355 hfs_bnode_put(node); 368 hfs_bnode_put(node);
356 return; 369 return;
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
index 0aa40b36a9e7..b4ba1b319333 100644
--- a/fs/hfsplus/catalog.c
+++ b/fs/hfsplus/catalog.c
@@ -91,7 +91,8 @@ void hfsplus_cat_set_perms(struct inode *inode, struct hfsplus_perm *perms)
91 perms->dev = 0; 91 perms->dev = 0;
92} 92}
93 93
94static int hfsplus_cat_build_record(hfsplus_cat_entry *entry, u32 cnid, struct inode *inode) 94static int hfsplus_cat_build_record(hfsplus_cat_entry *entry,
95 u32 cnid, struct inode *inode)
95{ 96{
96 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb); 97 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
97 98
@@ -128,20 +129,32 @@ static int hfsplus_cat_build_record(hfsplus_cat_entry *entry, u32 cnid, struct i
128 if (cnid == inode->i_ino) { 129 if (cnid == inode->i_ino) {
129 hfsplus_cat_set_perms(inode, &file->permissions); 130 hfsplus_cat_set_perms(inode, &file->permissions);
130 if (S_ISLNK(inode->i_mode)) { 131 if (S_ISLNK(inode->i_mode)) {
131 file->user_info.fdType = cpu_to_be32(HFSP_SYMLINK_TYPE); 132 file->user_info.fdType =
132 file->user_info.fdCreator = cpu_to_be32(HFSP_SYMLINK_CREATOR); 133 cpu_to_be32(HFSP_SYMLINK_TYPE);
134 file->user_info.fdCreator =
135 cpu_to_be32(HFSP_SYMLINK_CREATOR);
133 } else { 136 } else {
134 file->user_info.fdType = cpu_to_be32(sbi->type); 137 file->user_info.fdType =
135 file->user_info.fdCreator = cpu_to_be32(sbi->creator); 138 cpu_to_be32(sbi->type);
139 file->user_info.fdCreator =
140 cpu_to_be32(sbi->creator);
136 } 141 }
137 if ((file->permissions.rootflags | file->permissions.userflags) & HFSPLUS_FLG_IMMUTABLE) 142 if (HFSPLUS_FLG_IMMUTABLE &
138 file->flags |= cpu_to_be16(HFSPLUS_FILE_LOCKED); 143 (file->permissions.rootflags |
144 file->permissions.userflags))
145 file->flags |=
146 cpu_to_be16(HFSPLUS_FILE_LOCKED);
139 } else { 147 } else {
140 file->user_info.fdType = cpu_to_be32(HFSP_HARDLINK_TYPE); 148 file->user_info.fdType =
141 file->user_info.fdCreator = cpu_to_be32(HFSP_HFSPLUS_CREATOR); 149 cpu_to_be32(HFSP_HARDLINK_TYPE);
142 file->user_info.fdFlags = cpu_to_be16(0x100); 150 file->user_info.fdCreator =
143 file->create_date = HFSPLUS_I(sbi->hidden_dir)->create_date; 151 cpu_to_be32(HFSP_HFSPLUS_CREATOR);
144 file->permissions.dev = cpu_to_be32(HFSPLUS_I(inode)->linkid); 152 file->user_info.fdFlags =
153 cpu_to_be16(0x100);
154 file->create_date =
155 HFSPLUS_I(sbi->hidden_dir)->create_date;
156 file->permissions.dev =
157 cpu_to_be32(HFSPLUS_I(inode)->linkid);
145 } 158 }
146 return sizeof(*file); 159 return sizeof(*file);
147 } 160 }
@@ -182,12 +195,14 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid,
182 return -EIO; 195 return -EIO;
183 } 196 }
184 197
185 hfsplus_cat_build_key_uni(fd->search_key, be32_to_cpu(tmp.thread.parentID), 198 hfsplus_cat_build_key_uni(fd->search_key,
186 &tmp.thread.nodeName); 199 be32_to_cpu(tmp.thread.parentID),
200 &tmp.thread.nodeName);
187 return hfs_brec_find(fd); 201 return hfs_brec_find(fd);
188} 202}
189 203
190int hfsplus_create_cat(u32 cnid, struct inode *dir, struct qstr *str, struct inode *inode) 204int hfsplus_create_cat(u32 cnid, struct inode *dir,
205 struct qstr *str, struct inode *inode)
191{ 206{
192 struct super_block *sb = dir->i_sb; 207 struct super_block *sb = dir->i_sb;
193 struct hfs_find_data fd; 208 struct hfs_find_data fd;
@@ -195,13 +210,15 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir, struct qstr *str, struct ino
195 int entry_size; 210 int entry_size;
196 int err; 211 int err;
197 212
198 dprint(DBG_CAT_MOD, "create_cat: %s,%u(%d)\n", str->name, cnid, inode->i_nlink); 213 dprint(DBG_CAT_MOD, "create_cat: %s,%u(%d)\n",
214 str->name, cnid, inode->i_nlink);
199 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); 215 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
200 216
201 hfsplus_cat_build_key(sb, fd.search_key, cnid, NULL); 217 hfsplus_cat_build_key(sb, fd.search_key, cnid, NULL);
202 entry_size = hfsplus_fill_cat_thread(sb, &entry, S_ISDIR(inode->i_mode) ? 218 entry_size = hfsplus_fill_cat_thread(sb, &entry,
219 S_ISDIR(inode->i_mode) ?
203 HFSPLUS_FOLDER_THREAD : HFSPLUS_FILE_THREAD, 220 HFSPLUS_FOLDER_THREAD : HFSPLUS_FILE_THREAD,
204 dir->i_ino, str); 221 dir->i_ino, str);
205 err = hfs_brec_find(&fd); 222 err = hfs_brec_find(&fd);
206 if (err != -ENOENT) { 223 if (err != -ENOENT) {
207 if (!err) 224 if (!err)
@@ -250,7 +267,8 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str)
250 int err, off; 267 int err, off;
251 u16 type; 268 u16 type;
252 269
253 dprint(DBG_CAT_MOD, "delete_cat: %s,%u\n", str ? str->name : NULL, cnid); 270 dprint(DBG_CAT_MOD, "delete_cat: %s,%u\n",
271 str ? str->name : NULL, cnid);
254 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); 272 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
255 273
256 if (!str) { 274 if (!str) {
@@ -261,11 +279,15 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str)
261 if (err) 279 if (err)
262 goto out; 280 goto out;
263 281
264 off = fd.entryoffset + offsetof(struct hfsplus_cat_thread, nodeName); 282 off = fd.entryoffset +
283 offsetof(struct hfsplus_cat_thread, nodeName);
265 fd.search_key->cat.parent = cpu_to_be32(dir->i_ino); 284 fd.search_key->cat.parent = cpu_to_be32(dir->i_ino);
266 hfs_bnode_read(fd.bnode, &fd.search_key->cat.name.length, off, 2); 285 hfs_bnode_read(fd.bnode,
286 &fd.search_key->cat.name.length, off, 2);
267 len = be16_to_cpu(fd.search_key->cat.name.length) * 2; 287 len = be16_to_cpu(fd.search_key->cat.name.length) * 2;
268 hfs_bnode_read(fd.bnode, &fd.search_key->cat.name.unicode, off + 2, len); 288 hfs_bnode_read(fd.bnode,
289 &fd.search_key->cat.name.unicode,
290 off + 2, len);
269 fd.search_key->key_len = cpu_to_be16(6 + len); 291 fd.search_key->key_len = cpu_to_be16(6 + len);
270 } else 292 } else
271 hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, str); 293 hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, str);
@@ -282,7 +304,8 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str)
282 hfsplus_free_fork(sb, cnid, &fork, HFSPLUS_TYPE_DATA); 304 hfsplus_free_fork(sb, cnid, &fork, HFSPLUS_TYPE_DATA);
283#endif 305#endif
284 306
285 off = fd.entryoffset + offsetof(struct hfsplus_cat_file, rsrc_fork); 307 off = fd.entryoffset +
308 offsetof(struct hfsplus_cat_file, rsrc_fork);
286 hfs_bnode_read(fd.bnode, &fork, off, sizeof(fork)); 309 hfs_bnode_read(fd.bnode, &fork, off, sizeof(fork));
287 hfsplus_free_fork(sb, cnid, &fork, HFSPLUS_TYPE_RSRC); 310 hfsplus_free_fork(sb, cnid, &fork, HFSPLUS_TYPE_RSRC);
288 } 311 }
@@ -326,7 +349,8 @@ int hfsplus_rename_cat(u32 cnid,
326 int entry_size, type; 349 int entry_size, type;
327 int err = 0; 350 int err = 0;
328 351
329 dprint(DBG_CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n", cnid, src_dir->i_ino, src_name->name, 352 dprint(DBG_CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n",
353 cnid, src_dir->i_ino, src_name->name,
330 dst_dir->i_ino, dst_name->name); 354 dst_dir->i_ino, dst_name->name);
331 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &src_fd); 355 hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &src_fd);
332 dst_fd = src_fd; 356 dst_fd = src_fd;
@@ -378,7 +402,8 @@ int hfsplus_rename_cat(u32 cnid,
378 402
379 /* create new thread entry */ 403 /* create new thread entry */
380 hfsplus_cat_build_key(sb, dst_fd.search_key, cnid, NULL); 404 hfsplus_cat_build_key(sb, dst_fd.search_key, cnid, NULL);
381 entry_size = hfsplus_fill_cat_thread(sb, &entry, type, dst_dir->i_ino, dst_name); 405 entry_size = hfsplus_fill_cat_thread(sb, &entry, type,
406 dst_dir->i_ino, dst_name);
382 err = hfs_brec_find(&dst_fd); 407 err = hfs_brec_find(&dst_fd);
383 if (err != -ENOENT) { 408 if (err != -ENOENT) {
384 if (!err) 409 if (!err)
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index e44c78a837e8..c423942793ee 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -66,11 +66,17 @@ again:
66 goto fail; 66 goto fail;
67 } 67 }
68 cnid = be32_to_cpu(entry.file.id); 68 cnid = be32_to_cpu(entry.file.id);
69 if (entry.file.user_info.fdType == cpu_to_be32(HFSP_HARDLINK_TYPE) && 69 if (entry.file.user_info.fdType ==
70 entry.file.user_info.fdCreator == cpu_to_be32(HFSP_HFSPLUS_CREATOR) && 70 cpu_to_be32(HFSP_HARDLINK_TYPE) &&
71 (entry.file.create_date == HFSPLUS_I(HFSPLUS_SB(sb)->hidden_dir)->create_date || 71 entry.file.user_info.fdCreator ==
72 entry.file.create_date == HFSPLUS_I(sb->s_root->d_inode)->create_date) && 72 cpu_to_be32(HFSP_HFSPLUS_CREATOR) &&
73 HFSPLUS_SB(sb)->hidden_dir) { 73 (entry.file.create_date ==
74 HFSPLUS_I(HFSPLUS_SB(sb)->hidden_dir)->
75 create_date ||
76 entry.file.create_date ==
77 HFSPLUS_I(sb->s_root->d_inode)->
78 create_date) &&
79 HFSPLUS_SB(sb)->hidden_dir) {
74 struct qstr str; 80 struct qstr str;
75 char name[32]; 81 char name[32];
76 82
@@ -83,11 +89,13 @@ again:
83 linkid = 0; 89 linkid = 0;
84 } else { 90 } else {
85 dentry->d_fsdata = (void *)(unsigned long)cnid; 91 dentry->d_fsdata = (void *)(unsigned long)cnid;
86 linkid = be32_to_cpu(entry.file.permissions.dev); 92 linkid =
93 be32_to_cpu(entry.file.permissions.dev);
87 str.len = sprintf(name, "iNode%d", linkid); 94 str.len = sprintf(name, "iNode%d", linkid);
88 str.name = name; 95 str.name = name;
89 hfsplus_cat_build_key(sb, fd.search_key, 96 hfsplus_cat_build_key(sb, fd.search_key,
90 HFSPLUS_SB(sb)->hidden_dir->i_ino, &str); 97 HFSPLUS_SB(sb)->hidden_dir->i_ino,
98 &str);
91 goto again; 99 goto again;
92 } 100 }
93 } else if (!dentry->d_fsdata) 101 } else if (!dentry->d_fsdata)
@@ -139,7 +147,8 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
139 filp->f_pos++; 147 filp->f_pos++;
140 /* fall through */ 148 /* fall through */
141 case 1: 149 case 1:
142 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); 150 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset,
151 fd.entrylength);
143 if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) { 152 if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) {
144 printk(KERN_ERR "hfs: bad catalog folder thread\n"); 153 printk(KERN_ERR "hfs: bad catalog folder thread\n");
145 err = -EIO; 154 err = -EIO;
@@ -169,14 +178,16 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
169 err = -EIO; 178 err = -EIO;
170 goto out; 179 goto out;
171 } 180 }
172 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); 181 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset,
182 fd.entrylength);
173 type = be16_to_cpu(entry.type); 183 type = be16_to_cpu(entry.type);
174 len = HFSPLUS_MAX_STRLEN; 184 len = HFSPLUS_MAX_STRLEN;
175 err = hfsplus_uni2asc(sb, &fd.key->cat.name, strbuf, &len); 185 err = hfsplus_uni2asc(sb, &fd.key->cat.name, strbuf, &len);
176 if (err) 186 if (err)
177 goto out; 187 goto out;
178 if (type == HFSPLUS_FOLDER) { 188 if (type == HFSPLUS_FOLDER) {
179 if (fd.entrylength < sizeof(struct hfsplus_cat_folder)) { 189 if (fd.entrylength <
190 sizeof(struct hfsplus_cat_folder)) {
180 printk(KERN_ERR "hfs: small dir entry\n"); 191 printk(KERN_ERR "hfs: small dir entry\n");
181 err = -EIO; 192 err = -EIO;
182 goto out; 193 goto out;
@@ -273,7 +284,8 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir,
273 HFSPLUS_I(inode)->linkid = id; 284 HFSPLUS_I(inode)->linkid = id;
274 cnid = sbi->next_cnid++; 285 cnid = sbi->next_cnid++;
275 src_dentry->d_fsdata = (void *)(unsigned long)cnid; 286 src_dentry->d_fsdata = (void *)(unsigned long)cnid;
276 res = hfsplus_create_cat(cnid, src_dir, &src_dentry->d_name, inode); 287 res = hfsplus_create_cat(cnid, src_dir,
288 &src_dentry->d_name, inode);
277 if (res) 289 if (res)
278 /* panic? */ 290 /* panic? */
279 goto out; 291 goto out;
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
index b1127ef26750..1ae2fe5cfa74 100644
--- a/fs/hfsplus/extents.c
+++ b/fs/hfsplus/extents.c
@@ -83,7 +83,8 @@ static u32 hfsplus_ext_lastblock(struct hfsplus_extent *ext)
83 return be32_to_cpu(ext->start_block) + be32_to_cpu(ext->block_count); 83 return be32_to_cpu(ext->start_block) + be32_to_cpu(ext->block_count);
84} 84}
85 85
86static void __hfsplus_ext_write_extent(struct inode *inode, struct hfs_find_data *fd) 86static void __hfsplus_ext_write_extent(struct inode *inode,
87 struct hfs_find_data *fd)
87{ 88{
88 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); 89 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
89 int res; 90 int res;
@@ -152,11 +153,13 @@ static inline int __hfsplus_ext_read_extent(struct hfs_find_data *fd,
152 return -ENOENT; 153 return -ENOENT;
153 if (fd->entrylength != sizeof(hfsplus_extent_rec)) 154 if (fd->entrylength != sizeof(hfsplus_extent_rec))
154 return -EIO; 155 return -EIO;
155 hfs_bnode_read(fd->bnode, extent, fd->entryoffset, sizeof(hfsplus_extent_rec)); 156 hfs_bnode_read(fd->bnode, extent, fd->entryoffset,
157 sizeof(hfsplus_extent_rec));
156 return 0; 158 return 0;
157} 159}
158 160
159static inline int __hfsplus_ext_cache_extent(struct hfs_find_data *fd, struct inode *inode, u32 block) 161static inline int __hfsplus_ext_cache_extent(struct hfs_find_data *fd,
162 struct inode *inode, u32 block)
160{ 163{
161 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); 164 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
162 int res; 165 int res;
@@ -172,7 +175,8 @@ static inline int __hfsplus_ext_cache_extent(struct hfs_find_data *fd, struct in
172 HFSPLUS_TYPE_DATA); 175 HFSPLUS_TYPE_DATA);
173 if (!res) { 176 if (!res) {
174 hip->cached_start = be32_to_cpu(fd->key->ext.start_block); 177 hip->cached_start = be32_to_cpu(fd->key->ext.start_block);
175 hip->cached_blocks = hfsplus_ext_block_count(hip->cached_extents); 178 hip->cached_blocks =
179 hfsplus_ext_block_count(hip->cached_extents);
176 } else { 180 } else {
177 hip->cached_start = hip->cached_blocks = 0; 181 hip->cached_start = hip->cached_blocks = 0;
178 hip->extent_state &= ~(HFSPLUS_EXT_DIRTY | HFSPLUS_EXT_NEW); 182 hip->extent_state &= ~(HFSPLUS_EXT_DIRTY | HFSPLUS_EXT_NEW);
@@ -249,9 +253,12 @@ int hfsplus_get_block(struct inode *inode, sector_t iblock,
249 mutex_unlock(&hip->extents_lock); 253 mutex_unlock(&hip->extents_lock);
250 254
251done: 255done:
252 dprint(DBG_EXTENT, "get_block(%lu): %llu - %u\n", inode->i_ino, (long long)iblock, dblock); 256 dprint(DBG_EXTENT, "get_block(%lu): %llu - %u\n",
257 inode->i_ino, (long long)iblock, dblock);
253 mask = (1 << sbi->fs_shift) - 1; 258 mask = (1 << sbi->fs_shift) - 1;
254 map_bh(bh_result, sb, (dblock << sbi->fs_shift) + sbi->blockoffset + (iblock & mask)); 259 map_bh(bh_result, sb,
260 (dblock << sbi->fs_shift) + sbi->blockoffset +
261 (iblock & mask));
255 if (create) { 262 if (create) {
256 set_buffer_new(bh_result); 263 set_buffer_new(bh_result);
257 hip->phys_size += sb->s_blocksize; 264 hip->phys_size += sb->s_blocksize;
@@ -342,7 +349,8 @@ found:
342 } 349 }
343} 350}
344 351
345int hfsplus_free_fork(struct super_block *sb, u32 cnid, struct hfsplus_fork_raw *fork, int type) 352int hfsplus_free_fork(struct super_block *sb, u32 cnid,
353 struct hfsplus_fork_raw *fork, int type)
346{ 354{
347 struct hfs_find_data fd; 355 struct hfs_find_data fd;
348 hfsplus_extent_rec ext_entry; 356 hfsplus_extent_rec ext_entry;
@@ -497,7 +505,8 @@ void hfsplus_file_truncate(struct inode *inode)
497 &page, &fsdata); 505 &page, &fsdata);
498 if (res) 506 if (res)
499 return; 507 return;
500 res = pagecache_write_end(NULL, mapping, size, 0, 0, page, fsdata); 508 res = pagecache_write_end(NULL, mapping, size,
509 0, 0, page, fsdata);
501 if (res < 0) 510 if (res < 0)
502 return; 511 return;
503 mark_inode_dirty(inode); 512 mark_inode_dirty(inode);
@@ -543,7 +552,8 @@ void hfsplus_file_truncate(struct inode *inode)
543 hip->alloc_blocks = blk_cnt; 552 hip->alloc_blocks = blk_cnt;
544out: 553out:
545 hip->phys_size = inode->i_size; 554 hip->phys_size = inode->i_size;
546 hip->fs_blocks = (inode->i_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits; 555 hip->fs_blocks = (inode->i_size + sb->s_blocksize - 1) >>
556 sb->s_blocksize_bits;
547 inode_set_bytes(inode, hip->fs_blocks << sb->s_blocksize_bits); 557 inode_set_bytes(inode, hip->fs_blocks << sb->s_blocksize_bits);
548 hfsplus_mark_inode_dirty(inode, HFSPLUS_I_ALLOC_DIRTY); 558 hfsplus_mark_inode_dirty(inode, HFSPLUS_I_ALLOC_DIRTY);
549} 559}
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index 17ac254e72cb..c4abec167826 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -37,7 +37,8 @@
37#define HFSPLUS_TYPE_DATA 0x00 37#define HFSPLUS_TYPE_DATA 0x00
38#define HFSPLUS_TYPE_RSRC 0xFF 38#define HFSPLUS_TYPE_RSRC 0xFF
39 39
40typedef int (*btree_keycmp)(const hfsplus_btree_key *, const hfsplus_btree_key *); 40typedef int (*btree_keycmp)(const hfsplus_btree_key *,
41 const hfsplus_btree_key *);
41 42
42#define NODE_HASH_SIZE 256 43#define NODE_HASH_SIZE 256
43 44
@@ -352,9 +353,12 @@ int hfs_brec_read(struct hfs_find_data *, void *, int);
352int hfs_brec_goto(struct hfs_find_data *, int); 353int hfs_brec_goto(struct hfs_find_data *, int);
353 354
354/* catalog.c */ 355/* catalog.c */
355int hfsplus_cat_case_cmp_key(const hfsplus_btree_key *, const hfsplus_btree_key *); 356int hfsplus_cat_case_cmp_key(const hfsplus_btree_key *,
356int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *, const hfsplus_btree_key *); 357 const hfsplus_btree_key *);
357void hfsplus_cat_build_key(struct super_block *sb, hfsplus_btree_key *, u32, struct qstr *); 358int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *,
359 const hfsplus_btree_key *);
360void hfsplus_cat_build_key(struct super_block *sb,
361 hfsplus_btree_key *, u32, struct qstr *);
358int hfsplus_find_cat(struct super_block *, u32, struct hfs_find_data *); 362int hfsplus_find_cat(struct super_block *, u32, struct hfs_find_data *);
359int hfsplus_create_cat(u32, struct inode *, struct qstr *, struct inode *); 363int hfsplus_create_cat(u32, struct inode *, struct qstr *, struct inode *);
360int hfsplus_delete_cat(u32, struct inode *, struct qstr *); 364int hfsplus_delete_cat(u32, struct inode *, struct qstr *);
@@ -370,7 +374,8 @@ extern const struct file_operations hfsplus_dir_operations;
370int hfsplus_ext_cmp_key(const hfsplus_btree_key *, const hfsplus_btree_key *); 374int hfsplus_ext_cmp_key(const hfsplus_btree_key *, const hfsplus_btree_key *);
371void hfsplus_ext_write_extent(struct inode *); 375void hfsplus_ext_write_extent(struct inode *);
372int hfsplus_get_block(struct inode *, sector_t, struct buffer_head *, int); 376int hfsplus_get_block(struct inode *, sector_t, struct buffer_head *, int);
373int hfsplus_free_fork(struct super_block *, u32, struct hfsplus_fork_raw *, int); 377int hfsplus_free_fork(struct super_block *, u32,
378 struct hfsplus_fork_raw *, int);
374int hfsplus_file_extend(struct inode *); 379int hfsplus_file_extend(struct inode *);
375void hfsplus_file_truncate(struct inode *); 380void hfsplus_file_truncate(struct inode *);
376 381
@@ -411,12 +416,17 @@ extern u16 hfsplus_decompose_table[];
411extern u16 hfsplus_compose_table[]; 416extern u16 hfsplus_compose_table[];
412 417
413/* unicode.c */ 418/* unicode.c */
414int hfsplus_strcasecmp(const struct hfsplus_unistr *, const struct hfsplus_unistr *); 419int hfsplus_strcasecmp(const struct hfsplus_unistr *,
415int hfsplus_strcmp(const struct hfsplus_unistr *, const struct hfsplus_unistr *); 420 const struct hfsplus_unistr *);
416int hfsplus_uni2asc(struct super_block *, const struct hfsplus_unistr *, char *, int *); 421int hfsplus_strcmp(const struct hfsplus_unistr *,
417int hfsplus_asc2uni(struct super_block *, struct hfsplus_unistr *, const char *, int); 422 const struct hfsplus_unistr *);
423int hfsplus_uni2asc(struct super_block *,
424 const struct hfsplus_unistr *, char *, int *);
425int hfsplus_asc2uni(struct super_block *,
426 struct hfsplus_unistr *, const char *, int);
418int hfsplus_hash_dentry(struct dentry *dentry, struct qstr *str); 427int hfsplus_hash_dentry(struct dentry *dentry, struct qstr *str);
419int hfsplus_compare_dentry(struct dentry *dentry, struct qstr *s1, struct qstr *s2); 428int hfsplus_compare_dentry(struct dentry *dentry,
429 struct qstr *s1, struct qstr *s2);
420 430
421/* wrapper.c */ 431/* wrapper.c */
422int hfsplus_read_wrapper(struct super_block *); 432int hfsplus_read_wrapper(struct super_block *);
diff --git a/fs/hfsplus/hfsplus_raw.h b/fs/hfsplus/hfsplus_raw.h
index 6892899fd6fb..927cdd6d5bf5 100644
--- a/fs/hfsplus/hfsplus_raw.h
+++ b/fs/hfsplus/hfsplus_raw.h
@@ -36,7 +36,8 @@
36#define HFSP_WRAPOFF_EMBEDSIG 0x7C 36#define HFSP_WRAPOFF_EMBEDSIG 0x7C
37#define HFSP_WRAPOFF_EMBEDEXT 0x7E 37#define HFSP_WRAPOFF_EMBEDEXT 0x7E
38 38
39#define HFSP_HIDDENDIR_NAME "\xe2\x90\x80\xe2\x90\x80\xe2\x90\x80\xe2\x90\x80HFS+ Private Data" 39#define HFSP_HIDDENDIR_NAME \
40 "\xe2\x90\x80\xe2\x90\x80\xe2\x90\x80\xe2\x90\x80HFS+ Private Data"
40 41
41#define HFSP_HARDLINK_TYPE 0x686c6e6b /* 'hlnk' */ 42#define HFSP_HARDLINK_TYPE 0x686c6e6b /* 'hlnk' */
42#define HFSP_HFSPLUS_CREATOR 0x6866732b /* 'hfs+' */ 43#define HFSP_HFSPLUS_CREATOR 0x6866732b /* 'hfs+' */
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index bda7464c205d..8d7350e5ce0d 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -78,7 +78,8 @@ static int hfsplus_releasepage(struct page *page, gfp_t mask)
78 if (!tree) 78 if (!tree)
79 return 0; 79 return 0;
80 if (tree->node_size >= PAGE_CACHE_SIZE) { 80 if (tree->node_size >= PAGE_CACHE_SIZE) {
81 nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT); 81 nidx = page->index >>
82 (tree->node_size_shift - PAGE_CACHE_SHIFT);
82 spin_lock(&tree->hash_lock); 83 spin_lock(&tree->hash_lock);
83 node = hfs_bnode_findhash(tree, nidx); 84 node = hfs_bnode_findhash(tree, nidx);
84 if (!node) 85 if (!node)
@@ -91,7 +92,8 @@ static int hfsplus_releasepage(struct page *page, gfp_t mask)
91 } 92 }
92 spin_unlock(&tree->hash_lock); 93 spin_unlock(&tree->hash_lock);
93 } else { 94 } else {
94 nidx = page->index << (PAGE_CACHE_SHIFT - tree->node_size_shift); 95 nidx = page->index <<
96 (PAGE_CACHE_SHIFT - tree->node_size_shift);
95 i = 1 << (PAGE_CACHE_SHIFT - tree->node_size_shift); 97 i = 1 << (PAGE_CACHE_SHIFT - tree->node_size_shift);
96 spin_lock(&tree->hash_lock); 98 spin_lock(&tree->hash_lock);
97 do { 99 do {
@@ -167,8 +169,8 @@ const struct dentry_operations hfsplus_dentry_operations = {
167 .d_compare = hfsplus_compare_dentry, 169 .d_compare = hfsplus_compare_dentry,
168}; 170};
169 171
170static struct dentry *hfsplus_file_lookup(struct inode *dir, struct dentry *dentry, 172static struct dentry *hfsplus_file_lookup(struct inode *dir,
171 struct nameidata *nd) 173 struct dentry *dentry, struct nameidata *nd)
172{ 174{
173 struct hfs_find_data fd; 175 struct hfs_find_data fd;
174 struct super_block *sb = dir->i_sb; 176 struct super_block *sb = dir->i_sb;
@@ -222,7 +224,8 @@ out:
222 return NULL; 224 return NULL;
223} 225}
224 226
225static void hfsplus_get_perms(struct inode *inode, struct hfsplus_perm *perms, int dir) 227static void hfsplus_get_perms(struct inode *inode,
228 struct hfsplus_perm *perms, int dir)
226{ 229{
227 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb); 230 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
228 u16 mode; 231 u16 mode;
@@ -324,7 +327,8 @@ int hfsplus_file_fsync(struct file *file, int datasync)
324 error = filemap_write_and_wait(sbi->cat_tree->inode->i_mapping); 327 error = filemap_write_and_wait(sbi->cat_tree->inode->i_mapping);
325 328
326 if (test_and_clear_bit(HFSPLUS_I_EXT_DIRTY, &hip->flags)) { 329 if (test_and_clear_bit(HFSPLUS_I_EXT_DIRTY, &hip->flags)) {
327 error2 = filemap_write_and_wait(sbi->ext_tree->inode->i_mapping); 330 error2 =
331 filemap_write_and_wait(sbi->ext_tree->inode->i_mapping);
328 if (!error) 332 if (!error)
329 error = error2; 333 error = error2;
330 } 334 }
@@ -472,7 +476,8 @@ void hfsplus_inode_read_fork(struct inode *inode, struct hfsplus_fork_raw *fork)
472 } 476 }
473} 477}
474 478
475void hfsplus_inode_write_fork(struct inode *inode, struct hfsplus_fork_raw *fork) 479void hfsplus_inode_write_fork(struct inode *inode,
480 struct hfsplus_fork_raw *fork)
476{ 481{
477 memcpy(&fork->extents, &HFSPLUS_I(inode)->first_extents, 482 memcpy(&fork->extents, &HFSPLUS_I(inode)->first_extents,
478 sizeof(hfsplus_extent_rec)); 483 sizeof(hfsplus_extent_rec));
@@ -520,7 +525,8 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)
520 inode->i_nlink = 1; 525 inode->i_nlink = 1;
521 if (S_ISREG(inode->i_mode)) { 526 if (S_ISREG(inode->i_mode)) {
522 if (file->permissions.dev) 527 if (file->permissions.dev)
523 inode->i_nlink = be32_to_cpu(file->permissions.dev); 528 inode->i_nlink =
529 be32_to_cpu(file->permissions.dev);
524 inode->i_op = &hfsplus_file_inode_operations; 530 inode->i_op = &hfsplus_file_inode_operations;
525 inode->i_fop = &hfsplus_file_operations; 531 inode->i_fop = &hfsplus_file_operations;
526 inode->i_mapping->a_ops = &hfsplus_aops; 532 inode->i_mapping->a_ops = &hfsplus_aops;
@@ -593,7 +599,9 @@ int hfsplus_cat_write_inode(struct inode *inode)
593 sizeof(struct hfsplus_cat_file)); 599 sizeof(struct hfsplus_cat_file));
594 hfsplus_inode_write_fork(inode, &file->data_fork); 600 hfsplus_inode_write_fork(inode, &file->data_fork);
595 hfsplus_cat_set_perms(inode, &file->permissions); 601 hfsplus_cat_set_perms(inode, &file->permissions);
596 if ((file->permissions.rootflags | file->permissions.userflags) & HFSPLUS_FLG_IMMUTABLE) 602 if (HFSPLUS_FLG_IMMUTABLE &
603 (file->permissions.rootflags |
604 file->permissions.userflags))
597 file->flags |= cpu_to_be16(HFSPLUS_FILE_LOCKED); 605 file->flags |= cpu_to_be16(HFSPLUS_FILE_LOCKED);
598 else 606 else
599 file->flags &= cpu_to_be16(~HFSPLUS_FILE_LOCKED); 607 file->flags &= cpu_to_be16(~HFSPLUS_FILE_LOCKED);
diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c
index dbd9d0c426cb..bb62a5882147 100644
--- a/fs/hfsplus/options.c
+++ b/fs/hfsplus/options.c
@@ -165,7 +165,9 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)
165 if (p) 165 if (p)
166 sbi->nls = load_nls(p); 166 sbi->nls = load_nls(p);
167 if (!sbi->nls) { 167 if (!sbi->nls) {
168 printk(KERN_ERR "hfs: unable to load nls mapping \"%s\"\n", p); 168 printk(KERN_ERR "hfs: unable to load "
169 "nls mapping \"%s\"\n",
170 p);
169 kfree(p); 171 kfree(p);
170 return 0; 172 return 0;
171 } 173 }
@@ -212,7 +214,8 @@ int hfsplus_show_options(struct seq_file *seq, struct vfsmount *mnt)
212 seq_printf(seq, ",creator=%.4s", (char *)&sbi->creator); 214 seq_printf(seq, ",creator=%.4s", (char *)&sbi->creator);
213 if (sbi->type != HFSPLUS_DEF_CR_TYPE) 215 if (sbi->type != HFSPLUS_DEF_CR_TYPE)
214 seq_printf(seq, ",type=%.4s", (char *)&sbi->type); 216 seq_printf(seq, ",type=%.4s", (char *)&sbi->type);
215 seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask, sbi->uid, sbi->gid); 217 seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask,
218 sbi->uid, sbi->gid);
216 if (sbi->part >= 0) 219 if (sbi->part >= 0)
217 seq_printf(seq, ",part=%u", sbi->part); 220 seq_printf(seq, ",part=%u", sbi->part);
218 if (sbi->session >= 0) 221 if (sbi->session >= 0)
diff --git a/fs/hfsplus/part_tbl.c b/fs/hfsplus/part_tbl.c
index 58918222a604..79eea8efad8e 100644
--- a/fs/hfsplus/part_tbl.c
+++ b/fs/hfsplus/part_tbl.c
@@ -2,7 +2,8 @@
2 * linux/fs/hfsplus/part_tbl.c 2 * linux/fs/hfsplus/part_tbl.c
3 * 3 *
4 * Copyright (C) 1996-1997 Paul H. Hargrove 4 * Copyright (C) 1996-1997 Paul H. Hargrove
5 * This file may be distributed under the terms of the GNU General Public License. 5 * This file may be distributed under the terms of
6 * the GNU General Public License.
6 * 7 *
7 * Original code to handle the new style Mac partition table based on 8 * Original code to handle the new style Mac partition table based on
8 * a patch contributed by Holger Schemel (aeglos@valinor.owl.de). 9 * a patch contributed by Holger Schemel (aeglos@valinor.owl.de).
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 154478c71f25..3c9f30e9cd36 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -290,18 +290,25 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
290 return -EINVAL; 290 return -EINVAL;
291 291
292 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 292 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
293 printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, " 293 printk(KERN_WARNING "hfs: filesystem was "
294 "running fsck.hfsplus is recommended. leaving read-only.\n"); 294 "not cleanly unmounted, "
295 "running fsck.hfsplus is recommended. "
296 "leaving read-only.\n");
295 sb->s_flags |= MS_RDONLY; 297 sb->s_flags |= MS_RDONLY;
296 *flags |= MS_RDONLY; 298 *flags |= MS_RDONLY;
297 } else if (force) { 299 } else if (force) {
298 /* nothing */ 300 /* nothing */
299 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 301 } else if (vhdr->attributes &
300 printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n"); 302 cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
303 printk(KERN_WARNING "hfs: filesystem is marked locked, "
304 "leaving read-only.\n");
301 sb->s_flags |= MS_RDONLY; 305 sb->s_flags |= MS_RDONLY;
302 *flags |= MS_RDONLY; 306 *flags |= MS_RDONLY;
303 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { 307 } else if (vhdr->attributes &
304 printk(KERN_WARNING "hfs: filesystem is marked journaled, leaving read-only.\n"); 308 cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
309 printk(KERN_WARNING "hfs: filesystem is "
310 "marked journaled, "
311 "leaving read-only.\n");
305 sb->s_flags |= MS_RDONLY; 312 sb->s_flags |= MS_RDONLY;
306 *flags |= MS_RDONLY; 313 *flags |= MS_RDONLY;
307 } 314 }
@@ -391,17 +398,22 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
391 sb->s_maxbytes = MAX_LFS_FILESIZE; 398 sb->s_maxbytes = MAX_LFS_FILESIZE;
392 399
393 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 400 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
394 printk(KERN_WARNING "hfs: Filesystem was not cleanly unmounted, " 401 printk(KERN_WARNING "hfs: Filesystem was "
395 "running fsck.hfsplus is recommended. mounting read-only.\n"); 402 "not cleanly unmounted, "
403 "running fsck.hfsplus is recommended. "
404 "mounting read-only.\n");
396 sb->s_flags |= MS_RDONLY; 405 sb->s_flags |= MS_RDONLY;
397 } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) { 406 } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) {
398 /* nothing */ 407 /* nothing */
399 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 408 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
400 printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n"); 409 printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n");
401 sb->s_flags |= MS_RDONLY; 410 sb->s_flags |= MS_RDONLY;
402 } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) && !(sb->s_flags & MS_RDONLY)) { 411 } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) &&
403 printk(KERN_WARNING "hfs: write access to a journaled filesystem is not supported, " 412 !(sb->s_flags & MS_RDONLY)) {
404 "use the force option at your own risk, mounting read-only.\n"); 413 printk(KERN_WARNING "hfs: write access to "
414 "a journaled filesystem is not supported, "
415 "use the force option at your own risk, "
416 "mounting read-only.\n");
405 sb->s_flags |= MS_RDONLY; 417 sb->s_flags |= MS_RDONLY;
406 } 418 }
407 419
diff --git a/fs/hfsplus/unicode.c b/fs/hfsplus/unicode.c
index b66d67de882c..15703e81174e 100644
--- a/fs/hfsplus/unicode.c
+++ b/fs/hfsplus/unicode.c
@@ -118,7 +118,9 @@ static u16 *hfsplus_compose_lookup(u16 *p, u16 cc)
118 return NULL; 118 return NULL;
119} 119}
120 120
121int hfsplus_uni2asc(struct super_block *sb, const struct hfsplus_unistr *ustr, char *astr, int *len_p) 121int hfsplus_uni2asc(struct super_block *sb,
122 const struct hfsplus_unistr *ustr,
123 char *astr, int *len_p)
122{ 124{
123 const hfsplus_unichr *ip; 125 const hfsplus_unichr *ip;
124 struct nls_table *nls = HFSPLUS_SB(sb)->nls; 126 struct nls_table *nls = HFSPLUS_SB(sb)->nls;
@@ -171,7 +173,8 @@ int hfsplus_uni2asc(struct super_block *sb, const struct hfsplus_unistr *ustr, c
171 goto same; 173 goto same;
172 c1 = be16_to_cpu(*ip); 174 c1 = be16_to_cpu(*ip);
173 if (likely(compose)) 175 if (likely(compose))
174 ce1 = hfsplus_compose_lookup(hfsplus_compose_table, c1); 176 ce1 = hfsplus_compose_lookup(
177 hfsplus_compose_table, c1);
175 if (ce1) 178 if (ce1)
176 break; 179 break;
177 switch (c0) { 180 switch (c0) {
@@ -199,7 +202,8 @@ int hfsplus_uni2asc(struct super_block *sb, const struct hfsplus_unistr *ustr, c
199 if (ce2) { 202 if (ce2) {
200 i = 1; 203 i = 1;
201 while (i < ustrlen) { 204 while (i < ustrlen) {
202 ce1 = hfsplus_compose_lookup(ce2, be16_to_cpu(ip[i])); 205 ce1 = hfsplus_compose_lookup(ce2,
206 be16_to_cpu(ip[i]));
203 if (!ce1) 207 if (!ce1)
204 break; 208 break;
205 i++; 209 i++;
@@ -363,7 +367,8 @@ int hfsplus_hash_dentry(struct dentry *dentry, struct qstr *str)
363 * Composed unicode characters are decomposed and case-folding is performed 367 * Composed unicode characters are decomposed and case-folding is performed
364 * if the appropriate bits are (un)set on the superblock. 368 * if the appropriate bits are (un)set on the superblock.
365 */ 369 */
366int hfsplus_compare_dentry(struct dentry *dentry, struct qstr *s1, struct qstr *s2) 370int hfsplus_compare_dentry(struct dentry *dentry,
371 struct qstr *s1, struct qstr *s2)
367{ 372{
368 struct super_block *sb = dentry->d_sb; 373 struct super_block *sb = dentry->d_sb;
369 int casefold, decompose, size; 374 int casefold, decompose, size;
@@ -388,7 +393,9 @@ int hfsplus_compare_dentry(struct dentry *dentry, struct qstr *s1, struct qstr *
388 astr1 += size; 393 astr1 += size;
389 len1 -= size; 394 len1 -= size;
390 395
391 if (!decompose || !(dstr1 = decompose_unichar(c, &dsize1))) { 396 if (decompose)
397 dstr1 = decompose_unichar(c, &dsize1);
398 if (!decompose || !dstr1) {
392 c1 = c; 399 c1 = c;
393 dstr1 = &c1; 400 dstr1 = &c1;
394 dsize1 = 1; 401 dsize1 = 1;
@@ -400,7 +407,9 @@ int hfsplus_compare_dentry(struct dentry *dentry, struct qstr *s1, struct qstr *
400 astr2 += size; 407 astr2 += size;
401 len2 -= size; 408 len2 -= size;
402 409
403 if (!decompose || !(dstr2 = decompose_unichar(c, &dsize2))) { 410 if (decompose)
411 dstr2 = decompose_unichar(c, &dsize2);
412 if (!decompose || !dstr2) {
404 c2 = c; 413 c2 = c;
405 dstr2 = &c2; 414 dstr2 = &c2;
406 dsize2 = 1; 415 dsize2 = 1;
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
index 15e0eabb489e..196231794f64 100644
--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -74,12 +74,14 @@ static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd)
74 !(attrib & HFSP_WRAP_ATTRIB_SPARED)) 74 !(attrib & HFSP_WRAP_ATTRIB_SPARED))
75 return 0; 75 return 0;
76 76
77 wd->ablk_size = be32_to_cpu(*(__be32 *)(bufptr + HFSP_WRAPOFF_ABLKSIZE)); 77 wd->ablk_size =
78 be32_to_cpu(*(__be32 *)(bufptr + HFSP_WRAPOFF_ABLKSIZE));
78 if (wd->ablk_size < HFSPLUS_SECTOR_SIZE) 79 if (wd->ablk_size < HFSPLUS_SECTOR_SIZE)
79 return 0; 80 return 0;
80 if (wd->ablk_size % HFSPLUS_SECTOR_SIZE) 81 if (wd->ablk_size % HFSPLUS_SECTOR_SIZE)
81 return 0; 82 return 0;
82 wd->ablk_start = be16_to_cpu(*(__be16 *)(bufptr + HFSP_WRAPOFF_ABLKSTART)); 83 wd->ablk_start =
84 be16_to_cpu(*(__be16 *)(bufptr + HFSP_WRAPOFF_ABLKSTART));
83 85
84 extent = get_unaligned_be32(bufptr + HFSP_WRAPOFF_EMBEDEXT); 86 extent = get_unaligned_be32(bufptr + HFSP_WRAPOFF_EMBEDEXT);
85 wd->embed_start = (extent >> 16) & 0xFFFF; 87 wd->embed_start = (extent >> 16) & 0xFFFF;
@@ -102,7 +104,8 @@ static int hfsplus_get_last_session(struct super_block *sb,
102 if (HFSPLUS_SB(sb)->session >= 0) { 104 if (HFSPLUS_SB(sb)->session >= 0) {
103 te.cdte_track = HFSPLUS_SB(sb)->session; 105 te.cdte_track = HFSPLUS_SB(sb)->session;
104 te.cdte_format = CDROM_LBA; 106 te.cdte_format = CDROM_LBA;
105 res = ioctl_by_bdev(sb->s_bdev, CDROMREADTOCENTRY, (unsigned long)&te); 107 res = ioctl_by_bdev(sb->s_bdev,
108 CDROMREADTOCENTRY, (unsigned long)&te);
106 if (!res && (te.cdte_ctrl & CDROM_DATA_TRACK) == 4) { 109 if (!res && (te.cdte_ctrl & CDROM_DATA_TRACK) == 4) {
107 *start = (sector_t)te.cdte_addr.lba << 2; 110 *start = (sector_t)te.cdte_addr.lba << 2;
108 return 0; 111 return 0;
@@ -111,7 +114,8 @@ static int hfsplus_get_last_session(struct super_block *sb,
111 return -EINVAL; 114 return -EINVAL;
112 } 115 }
113 ms_info.addr_format = CDROM_LBA; 116 ms_info.addr_format = CDROM_LBA;
114 res = ioctl_by_bdev(sb->s_bdev, CDROMMULTISESSION, (unsigned long)&ms_info); 117 res = ioctl_by_bdev(sb->s_bdev, CDROMMULTISESSION,
118 (unsigned long)&ms_info);
115 if (!res && ms_info.xa_flag) 119 if (!res && ms_info.xa_flag)
116 *start = (sector_t)ms_info.addr.lba << 2; 120 *start = (sector_t)ms_info.addr.lba << 2;
117 return 0; 121 return 0;
@@ -212,7 +216,8 @@ reread:
212 blocksize >>= 1; 216 blocksize >>= 1;
213 217
214 if (sb_set_blocksize(sb, blocksize) != blocksize) { 218 if (sb_set_blocksize(sb, blocksize) != blocksize) {
215 printk(KERN_ERR "hfs: unable to set blocksize to %u!\n", blocksize); 219 printk(KERN_ERR "hfs: unable to set blocksize to %u!\n",
220 blocksize);
216 goto out_free_backup_vhdr; 221 goto out_free_backup_vhdr;
217 } 222 }
218 223