Commit ec26a4b2 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[PATCH] fs/hfs/: misc cleanups

This patch contains the following cleanups:
- make needlessly global code static
- super.c: remove the unused global variable hfs_version
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 83ccdad5
......@@ -10,6 +10,10 @@
#include "btree.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 *tree);
/* 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)
{
......@@ -211,7 +215,7 @@ int hfs_brec_remove(struct hfs_find_data *fd)
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;
......@@ -320,7 +324,7 @@ struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
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;
......@@ -418,7 +422,7 @@ int hfs_brec_update_parent(struct hfs_find_data *fd)
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;
......
......@@ -111,9 +111,6 @@ extern u16 hfs_brec_lenoff(struct hfs_bnode *, u16, u16 *);
extern u16 hfs_brec_keylen(struct hfs_bnode *, u16);
extern int hfs_brec_insert(struct hfs_find_data *, void *, int);
extern int hfs_brec_remove(struct hfs_find_data *);
extern struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *);
extern int hfs_brec_update_parent(struct hfs_find_data *);
extern int hfs_btree_inc_height(struct hfs_btree *);
/* bfind.c */
extern int hfs_find_init(struct hfs_btree *, struct hfs_find_data *);
......
......@@ -33,7 +33,7 @@ void hfs_cat_build_key(btree_key *key, u32 parent, struct qstr *name)
}
}
int hfs_cat_build_record(hfs_cat_rec *rec, u32 cnid, struct inode *inode)
static int hfs_cat_build_record(hfs_cat_rec *rec, u32 cnid, struct inode *inode)
{
__be32 mtime = hfs_mtime();
......
......@@ -17,8 +17,8 @@
/*
* hfs_lookup()
*/
struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
{
hfs_cat_rec rec;
struct hfs_find_data fd;
......@@ -51,7 +51,7 @@ struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry,
/*
* hfs_readdir
*/
int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
struct inode *inode = filp->f_dentry->d_inode;
struct super_block *sb = inode->i_sb;
......@@ -177,8 +177,8 @@ static int hfs_dir_release(struct inode *inode, struct file *file)
* a directory and return a corresponding inode, given the inode for
* the directory and the name (and its length) of the new file.
*/
int hfs_create(struct inode *dir, struct dentry *dentry, int mode,
struct nameidata *nd)
static int hfs_create(struct inode *dir, struct dentry *dentry, int mode,
struct nameidata *nd)
{
struct inode *inode;
int res;
......@@ -207,7 +207,7 @@ int hfs_create(struct inode *dir, struct dentry *dentry, int mode,
* in a directory, given the inode for the parent directory and the
* name (and its length) of the new directory.
*/
int hfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
static int hfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
{
struct inode *inode;
int res;
......@@ -236,7 +236,7 @@ int hfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
* file, given the inode for the parent directory and the name
* (and its length) of the existing file.
*/
int hfs_unlink(struct inode *dir, struct dentry *dentry)
static int hfs_unlink(struct inode *dir, struct dentry *dentry)
{
struct inode *inode;
int res;
......@@ -262,7 +262,7 @@ int hfs_unlink(struct inode *dir, struct dentry *dentry)
* directory, given the inode for the parent directory and the name
* (and its length) of the existing directory.
*/
int hfs_rmdir(struct inode *dir, struct dentry *dentry)
static int hfs_rmdir(struct inode *dir, struct dentry *dentry)
{
struct inode *inode;
int res;
......@@ -291,8 +291,8 @@ int hfs_rmdir(struct inode *dir, struct dentry *dentry)
* new file/directory.
* XXX: how do you handle must_be dir?
*/
int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{
int res;
......
......@@ -231,8 +231,8 @@ static int hfs_add_extent(struct hfs_extent *extent, u16 offset,
return -EIO;
}
int hfs_free_extents(struct super_block *sb, struct hfs_extent *extent,
u16 offset, u16 block_nr)
static int hfs_free_extents(struct super_block *sb, struct hfs_extent *extent,
u16 offset, u16 block_nr)
{
u16 count, start;
int i;
......
......@@ -174,12 +174,6 @@ extern void hfs_cat_build_key(btree_key *, u32, struct qstr *);
extern struct file_operations hfs_dir_operations;
extern struct inode_operations hfs_dir_inode_operations;
extern int hfs_mkdir(struct inode *, struct dentry *, int);
extern int hfs_unlink(struct inode *, struct dentry *);
extern int hfs_rmdir(struct inode *, struct dentry *);
extern int hfs_rename(struct inode *, struct dentry *,
struct inode *, struct dentry *);
/* extent.c */
extern int hfs_ext_keycmp(const btree_key *, const btree_key *);
extern int hfs_free_fork(struct super_block *, struct hfs_cat_file *, int);
......@@ -187,10 +181,6 @@ extern void hfs_ext_write_extent(struct inode *);
extern int hfs_extend_file(struct inode *);
extern void hfs_file_truncate(struct inode *);
/* file.c */
extern struct inode_operations hfs_file_inode_operations;
extern struct file_operations hfs_file_operations;
extern int hfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
/* inode.c */
......
......@@ -18,6 +18,9 @@
#include "hfs_fs.h"
#include "btree.h"
static struct file_operations hfs_file_operations;
static struct inode_operations hfs_file_inode_operations;
/*================ Variable-like macros ================*/
#define HFS_VALID_MODE_BITS (S_IFREG | S_IFDIR | S_IRWXUGO)
......@@ -43,7 +46,7 @@ static sector_t hfs_bmap(struct address_space *mapping, sector_t block)
return generic_block_bmap(mapping, block, hfs_get_block);
}
int hfs_releasepage(struct page *page, int mask)
static int hfs_releasepage(struct page *page, int mask)
{
struct inode *inode = page->mapping->host;
struct super_block *sb = inode->i_sb;
......@@ -259,7 +262,7 @@ struct hfs_iget_data {
hfs_cat_rec *rec;
};
int hfs_test_inode(struct inode *inode, void *data)
static int hfs_test_inode(struct inode *inode, void *data)
{
struct hfs_iget_data *idata = data;
hfs_cat_rec *rec;
......@@ -279,7 +282,7 @@ int hfs_test_inode(struct inode *inode, void *data)
/*
* hfs_read_inode
*/
int hfs_read_inode(struct inode *inode, void *data)
static int hfs_read_inode(struct inode *inode, void *data)
{
struct hfs_iget_data *idata = data;
struct hfs_sb_info *hsb = HFS_SB(inode->i_sb);
......@@ -611,7 +614,7 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr)
}
struct file_operations hfs_file_operations = {
static struct file_operations hfs_file_operations = {
.llseek = generic_file_llseek,
.read = generic_file_read,
.write = generic_file_write,
......@@ -622,7 +625,7 @@ struct file_operations hfs_file_operations = {
.release = hfs_file_release,
};
struct inode_operations hfs_file_inode_operations = {
static struct inode_operations hfs_file_inode_operations = {
.lookup = hfs_file_lookup,
.truncate = hfs_file_truncate,
.setattr = hfs_inode_setattr,
......
......@@ -21,8 +21,6 @@
#include "hfs_fs.h"
#include "btree.h"
const char hfs_version[]="0.96";
static kmem_cache_t *hfs_inode_cachep;
MODULE_LICENSE("GPL");
......@@ -92,7 +90,7 @@ static int hfs_statfs(struct super_block *sb, struct kstatfs *buf)
return 0;
}
int hfs_remount(struct super_block *sb, int *flags, char *data)
static int hfs_remount(struct super_block *sb, int *flags, char *data)
{
*flags |= MS_NODIRATIME;
if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment