aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfsplus')
-rw-r--r--fs/hfsplus/bnode.c3
-rw-r--r--fs/hfsplus/btree.c3
-rw-r--r--fs/hfsplus/hfsplus_fs.h4
-rw-r--r--fs/hfsplus/inode.c6
-rw-r--r--fs/hfsplus/super.c4
5 files changed, 7 insertions, 13 deletions
diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c
index 77bf434da679..29da6574ba77 100644
--- a/fs/hfsplus/bnode.c
+++ b/fs/hfsplus/bnode.c
@@ -409,10 +409,9 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
409 sb = tree->inode->i_sb; 409 sb = tree->inode->i_sb;
410 size = sizeof(struct hfs_bnode) + tree->pages_per_bnode * 410 size = sizeof(struct hfs_bnode) + tree->pages_per_bnode *
411 sizeof(struct page *); 411 sizeof(struct page *);
412 node = kmalloc(size, GFP_KERNEL); 412 node = kzalloc(size, GFP_KERNEL);
413 if (!node) 413 if (!node)
414 return NULL; 414 return NULL;
415 memset(node, 0, size);
416 node->tree = tree; 415 node->tree = tree;
417 node->this = cnid; 416 node->this = cnid;
418 set_bit(HFS_BNODE_NEW, &node->flags); 417 set_bit(HFS_BNODE_NEW, &node->flags);
diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
index cfc852fdd1b5..a9b9e872e29a 100644
--- a/fs/hfsplus/btree.c
+++ b/fs/hfsplus/btree.c
@@ -24,10 +24,9 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
24 struct page *page; 24 struct page *page;
25 unsigned int size; 25 unsigned int size;
26 26
27 tree = kmalloc(sizeof(*tree), GFP_KERNEL); 27 tree = kzalloc(sizeof(*tree), GFP_KERNEL);
28 if (!tree) 28 if (!tree)
29 return NULL; 29 return NULL;
30 memset(tree, 0, sizeof(*tree));
31 30
32 init_MUTEX(&tree->tree_lock); 31 init_MUTEX(&tree->tree_lock);
33 spin_lock_init(&tree->hash_lock); 32 spin_lock_init(&tree->hash_lock);
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index 7ae393637a0c..8a1ca5ef7ada 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -323,8 +323,8 @@ int hfsplus_file_extend(struct inode *);
323void hfsplus_file_truncate(struct inode *); 323void hfsplus_file_truncate(struct inode *);
324 324
325/* inode.c */ 325/* inode.c */
326extern struct address_space_operations hfsplus_aops; 326extern const struct address_space_operations hfsplus_aops;
327extern struct address_space_operations hfsplus_btree_aops; 327extern const struct address_space_operations hfsplus_btree_aops;
328 328
329void hfsplus_inode_read_fork(struct inode *, struct hfsplus_fork_raw *); 329void hfsplus_inode_read_fork(struct inode *, struct hfsplus_fork_raw *);
330void hfsplus_inode_write_fork(struct inode *, struct hfsplus_fork_raw *); 330void hfsplus_inode_write_fork(struct inode *, struct hfsplus_fork_raw *);
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index acf66dba3e01..0eb1a6092668 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -109,7 +109,7 @@ static int hfsplus_writepages(struct address_space *mapping,
109 return mpage_writepages(mapping, wbc, hfsplus_get_block); 109 return mpage_writepages(mapping, wbc, hfsplus_get_block);
110} 110}
111 111
112struct address_space_operations hfsplus_btree_aops = { 112const struct address_space_operations hfsplus_btree_aops = {
113 .readpage = hfsplus_readpage, 113 .readpage = hfsplus_readpage,
114 .writepage = hfsplus_writepage, 114 .writepage = hfsplus_writepage,
115 .sync_page = block_sync_page, 115 .sync_page = block_sync_page,
@@ -119,7 +119,7 @@ struct address_space_operations hfsplus_btree_aops = {
119 .releasepage = hfsplus_releasepage, 119 .releasepage = hfsplus_releasepage,
120}; 120};
121 121
122struct address_space_operations hfsplus_aops = { 122const struct address_space_operations hfsplus_aops = {
123 .readpage = hfsplus_readpage, 123 .readpage = hfsplus_readpage,
124 .writepage = hfsplus_writepage, 124 .writepage = hfsplus_writepage,
125 .sync_page = block_sync_page, 125 .sync_page = block_sync_page,
@@ -304,7 +304,6 @@ struct inode *hfsplus_new_inode(struct super_block *sb, int mode)
304 inode->i_gid = current->fsgid; 304 inode->i_gid = current->fsgid;
305 inode->i_nlink = 1; 305 inode->i_nlink = 1;
306 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 306 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
307 inode->i_blksize = HFSPLUS_SB(sb).alloc_blksz;
308 INIT_LIST_HEAD(&HFSPLUS_I(inode).open_dir_list); 307 INIT_LIST_HEAD(&HFSPLUS_I(inode).open_dir_list);
309 init_MUTEX(&HFSPLUS_I(inode).extents_lock); 308 init_MUTEX(&HFSPLUS_I(inode).extents_lock);
310 atomic_set(&HFSPLUS_I(inode).opencnt, 0); 309 atomic_set(&HFSPLUS_I(inode).opencnt, 0);
@@ -407,7 +406,6 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)
407 type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset); 406 type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset);
408 407
409 HFSPLUS_I(inode).dev = 0; 408 HFSPLUS_I(inode).dev = 0;
410 inode->i_blksize = HFSPLUS_SB(inode->i_sb).alloc_blksz;
411 if (type == HFSPLUS_FOLDER) { 409 if (type == HFSPLUS_FOLDER) {
412 struct hfsplus_cat_folder *folder = &entry.folder; 410 struct hfsplus_cat_folder *folder = &entry.folder;
413 411
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 0a92fa2336a2..194eede52fa4 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -7,7 +7,6 @@
7 * 7 *
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/pagemap.h> 12#include <linux/pagemap.h>
@@ -494,8 +493,7 @@ static int __init init_hfsplus_fs(void)
494static void __exit exit_hfsplus_fs(void) 493static void __exit exit_hfsplus_fs(void)
495{ 494{
496 unregister_filesystem(&hfsplus_fs_type); 495 unregister_filesystem(&hfsplus_fs_type);
497 if (kmem_cache_destroy(hfsplus_inode_cachep)) 496 kmem_cache_destroy(hfsplus_inode_cachep);
498 printk(KERN_ERR "hfsplus_inode_cache: not all structures were freed\n");
499} 497}
500 498
501module_init(init_hfsplus_fs) 499module_init(init_hfsplus_fs)