From: Adrian Bunk This patch contains the following cleanups: - make needlessly global code static - bnode.c: remove the unused global functions hfsplus_lock_bnode and hfsplus_unlock_bnode Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton --- 25-akpm/fs/hfsplus/bnode.c | 11 ----------- 25-akpm/fs/hfsplus/brec.c | 10 +++++++--- 25-akpm/fs/hfsplus/dir.c | 23 +++++++++++++---------- 25-akpm/fs/hfsplus/extents.c | 9 +++++---- 25-akpm/fs/hfsplus/hfsplus_fs.h | 7 ------- 25-akpm/fs/hfsplus/inode.c | 6 +++--- 25-akpm/fs/hfsplus/super.c | 4 ++-- 7 files changed, 30 insertions(+), 40 deletions(-) diff -puN fs/hfsplus/bnode.c~fs-hfsplus-misc-cleanups fs/hfsplus/bnode.c --- 25/fs/hfsplus/bnode.c~fs-hfsplus-misc-cleanups 2005-02-02 18:21:10.014664128 -0800 +++ 25-akpm/fs/hfsplus/bnode.c 2005-02-02 18:21:10.026662304 -0800 @@ -648,14 +648,3 @@ void hfs_bnode_put(struct hfs_bnode *nod } } -void hfsplus_lock_bnode(struct hfs_bnode *node) -{ - wait_event(node->lock_wq, !test_and_set_bit(HFS_BNODE_LOCK, &node->flags)); -} - -void hfsplus_unlock_bnode(struct hfs_bnode *node) -{ - clear_bit(HFS_BNODE_LOCK, &node->flags); - if (waitqueue_active(&node->lock_wq)) - wake_up(&node->lock_wq); -} diff -puN fs/hfsplus/brec.c~fs-hfsplus-misc-cleanups fs/hfsplus/brec.c --- 25/fs/hfsplus/brec.c~fs-hfsplus-misc-cleanups 2005-02-02 18:21:10.016663824 -0800 +++ 25-akpm/fs/hfsplus/brec.c 2005-02-02 18:21:10.027662152 -0800 @@ -11,6 +11,10 @@ #include "hfsplus_fs.h" #include "hfsplus_raw.h" +static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd); +static int hfs_brec_update_parent(struct hfs_find_data *fd); +static int hfs_btree_inc_height(struct hfs_btree *); + /* Get the length and offset of the given record in the given node */ u16 hfs_brec_lenoff(struct hfs_bnode *node, u16 rec, u16 *off) { @@ -209,7 +213,7 @@ skip: return 0; } -struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) +static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd) { struct hfs_btree *tree; struct hfs_bnode *node, *new_node; @@ -318,7 +322,7 @@ struct hfs_bnode *hfs_bnode_split(struct return new_node; } -int hfs_brec_update_parent(struct hfs_find_data *fd) +static int hfs_brec_update_parent(struct hfs_find_data *fd) { struct hfs_btree *tree; struct hfs_bnode *node, *new_node, *parent; @@ -414,7 +418,7 @@ out: return 0; } -int hfs_btree_inc_height(struct hfs_btree *tree) +static int hfs_btree_inc_height(struct hfs_btree *tree) { struct hfs_bnode *node, *new_node; struct hfs_bnode_desc node_desc; diff -puN fs/hfsplus/dir.c~fs-hfsplus-misc-cleanups fs/hfsplus/dir.c --- 25/fs/hfsplus/dir.c~fs-hfsplus-misc-cleanups 2005-02-02 18:21:10.017663672 -0800 +++ 25-akpm/fs/hfsplus/dir.c 2005-02-02 18:21:10.028662000 -0800 @@ -228,8 +228,8 @@ static int hfsplus_dir_release(struct in return 0; } -int hfsplus_create(struct inode *dir, struct dentry *dentry, int mode, - struct nameidata *nd) +static int hfsplus_create(struct inode *dir, struct dentry *dentry, int mode, + struct nameidata *nd) { struct inode *inode; int res; @@ -250,7 +250,8 @@ int hfsplus_create(struct inode *dir, st return 0; } -int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir, struct dentry *dst_dentry) +static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir, + struct dentry *dst_dentry) { struct super_block *sb = dst_dir->i_sb; struct inode *inode = src_dentry->d_inode; @@ -302,7 +303,7 @@ int hfsplus_link(struct dentry *src_dent return 0; } -int hfsplus_unlink(struct inode *dir, struct dentry *dentry) +static int hfsplus_unlink(struct inode *dir, struct dentry *dentry) { struct super_block *sb = dir->i_sb; struct inode *inode = dentry->d_inode; @@ -346,7 +347,7 @@ int hfsplus_unlink(struct inode *dir, st return res; } -int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, int mode) +static int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, int mode) { struct inode *inode; int res; @@ -367,7 +368,7 @@ int hfsplus_mkdir(struct inode *dir, str return 0; } -int hfsplus_rmdir(struct inode *dir, struct dentry *dentry) +static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry) { struct inode *inode; int res; @@ -385,7 +386,8 @@ int hfsplus_rmdir(struct inode *dir, str return 0; } -int hfsplus_symlink(struct inode *dir, struct dentry *dentry, const char *symname) +static int hfsplus_symlink(struct inode *dir, struct dentry *dentry, + const char *symname) { struct super_block *sb; struct inode *inode; @@ -415,7 +417,8 @@ int hfsplus_symlink(struct inode *dir, s return res; } -int hfsplus_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) +static int hfsplus_mknod(struct inode *dir, struct dentry *dentry, + int mode, dev_t rdev) { struct super_block *sb; struct inode *inode; @@ -440,8 +443,8 @@ int hfsplus_mknod(struct inode *dir, str return 0; } -int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry) +static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry) { int res; diff -puN fs/hfsplus/extents.c~fs-hfsplus-misc-cleanups fs/hfsplus/extents.c --- 25/fs/hfsplus/extents.c~fs-hfsplus-misc-cleanups 2005-02-02 18:21:10.019663368 -0800 +++ 25-akpm/fs/hfsplus/extents.c 2005-02-02 18:21:10.029661848 -0800 @@ -37,8 +37,8 @@ int hfsplus_ext_cmp_key(hfsplus_btree_ke return be32_to_cpu(k1s) < be32_to_cpu(k2s) ? -1 : 1; } -void hfsplus_ext_build_key(hfsplus_btree_key *key, u32 cnid, - u32 block, u8 type) +static void hfsplus_ext_build_key(hfsplus_btree_key *key, u32 cnid, + u32 block, u8 type) { key->key_len = cpu_to_be16(HFSPLUS_EXT_KEYLEN - 2); key->ext.cnid = cpu_to_be32(cnid); @@ -263,8 +263,9 @@ static int hfsplus_add_extent(struct hfs return -EIO; } -int hfsplus_free_extents(struct super_block *sb, struct hfsplus_extent *extent, - u32 offset, u32 block_nr) +static int hfsplus_free_extents(struct super_block *sb, + struct hfsplus_extent *extent, + u32 offset, u32 block_nr) { u32 count, start; int i; diff -puN fs/hfsplus/hfsplus_fs.h~fs-hfsplus-misc-cleanups fs/hfsplus/hfsplus_fs.h --- 25/fs/hfsplus/hfsplus_fs.h~fs-hfsplus-misc-cleanups 2005-02-02 18:21:10.020663216 -0800 +++ 25-akpm/fs/hfsplus/hfsplus_fs.h 2005-02-02 18:21:10.029661848 -0800 @@ -230,9 +230,6 @@ struct hfsplus_readdir_data { #define hfs_brec_keylen hfsplus_brec_keylen #define hfs_brec_insert hfsplus_brec_insert #define hfs_brec_remove hfsplus_brec_remove -#define hfs_bnode_split hfsplus_bnode_split -#define hfs_brec_update_parent hfsplus_brec_update_parent -#define hfs_btree_inc_height hfsplus_btree_inc_height #define hfs_find_init hfsplus_find_init #define hfs_find_exit hfsplus_find_exit #define __hfs_brec_find __hplusfs_brec_find @@ -297,9 +294,6 @@ u16 hfs_brec_lenoff(struct hfs_bnode *, u16 hfs_brec_keylen(struct hfs_bnode *, u16); int hfs_brec_insert(struct hfs_find_data *, void *, int); int hfs_brec_remove(struct hfs_find_data *); -struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *); -int hfs_brec_update_parent(struct hfs_find_data *); -int hfs_btree_inc_height(struct hfs_btree *); /* bfind.c */ int hfs_find_init(struct hfs_btree *, struct hfs_find_data *); @@ -320,7 +314,6 @@ int hfsplus_rename_cat(u32, struct inode /* extents.c */ int hfsplus_ext_cmp_key(hfsplus_btree_key *, hfsplus_btree_key *); -void hfsplus_ext_build_key(hfsplus_btree_key *, u32, u32, u8); void hfsplus_ext_write_extent(struct inode *); int hfsplus_get_block(struct inode *, sector_t, struct buffer_head *, int); int hfsplus_free_fork(struct super_block *, u32, struct hfsplus_fork_raw *, int); diff -puN fs/hfsplus/inode.c~fs-hfsplus-misc-cleanups fs/hfsplus/inode.c --- 25/fs/hfsplus/inode.c~fs-hfsplus-misc-cleanups 2005-02-02 18:21:10.022662912 -0800 +++ 25-akpm/fs/hfsplus/inode.c 2005-02-02 18:21:10.030661696 -0800 @@ -40,7 +40,7 @@ static sector_t hfsplus_bmap(struct addr return generic_block_bmap(mapping, block, hfsplus_get_block); } -int hfsplus_releasepage(struct page *page, int mask) +static int hfsplus_releasepage(struct page *page, int mask) { struct inode *inode = page->mapping->host; struct super_block *sb = inode->i_sb; @@ -297,7 +297,7 @@ static int hfsplus_file_release(struct i extern struct inode_operations hfsplus_dir_inode_operations; extern struct file_operations hfsplus_dir_operations; -struct inode_operations hfsplus_file_inode_operations = { +static struct inode_operations hfsplus_file_inode_operations = { .lookup = hfsplus_file_lookup, .truncate = hfsplus_file_truncate, .permission = hfsplus_permission, @@ -306,7 +306,7 @@ struct inode_operations hfsplus_file_ino .listxattr = hfsplus_listxattr, }; -struct file_operations hfsplus_file_operations = { +static struct file_operations hfsplus_file_operations = { .llseek = generic_file_llseek, .read = generic_file_read, .write = generic_file_write, diff -puN fs/hfsplus/super.c~fs-hfsplus-misc-cleanups fs/hfsplus/super.c --- 25/fs/hfsplus/super.c~fs-hfsplus-misc-cleanups 2005-02-02 18:21:10.023662760 -0800 +++ 25-akpm/fs/hfsplus/super.c 2005-02-02 18:21:10.031661544 -0800 @@ -94,7 +94,7 @@ static void hfsplus_read_inode(struct in make_bad_inode(inode); } -int hfsplus_write_inode(struct inode *inode, int unused) +static int hfsplus_write_inode(struct inode *inode, int unused) { struct hfsplus_vh *vhdr; int ret = 0; @@ -239,7 +239,7 @@ static int hfsplus_statfs(struct super_b return 0; } -int hfsplus_remount(struct super_block *sb, int *flags, char *data) +static int hfsplus_remount(struct super_block *sb, int *flags, char *data) { if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) return 0; _