Skip to content

Commit

Permalink
JFS: fix sparse warnings by moving extern declarations to headers
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Kleikamp <[email protected]>
  • Loading branch information
Dave Kleikamp committed May 4, 2005
1 parent 6b6bf51 commit 1868f4a
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 181 deletions.
9 changes: 3 additions & 6 deletions fs/jfs/file.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) International Business Machines Corp., 2000-2002
* Portions Copyright (c) Christoph Hellwig, 2001-2002
* Copyright (C) International Business Machines Corp., 2000-2002
* Portions Copyright (C) Christoph Hellwig, 2001-2002
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -19,16 +19,13 @@

#include <linux/fs.h>
#include "jfs_incore.h"
#include "jfs_inode.h"
#include "jfs_dmap.h"
#include "jfs_txnmgr.h"
#include "jfs_xattr.h"
#include "jfs_acl.h"
#include "jfs_debug.h"


extern int jfs_commit_inode(struct inode *, int);
extern void jfs_truncate(struct inode *);

int jfs_fsync(struct file *file, struct dentry *dentry, int datasync)
{
struct inode *inode = dentry->d_inode;
Expand Down
11 changes: 2 additions & 9 deletions fs/jfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,14 @@
#include <linux/pagemap.h>
#include <linux/quotaops.h>
#include "jfs_incore.h"
#include "jfs_inode.h"
#include "jfs_filsys.h"
#include "jfs_imap.h"
#include "jfs_extent.h"
#include "jfs_unicode.h"
#include "jfs_debug.h"


extern struct inode_operations jfs_dir_inode_operations;
extern struct inode_operations jfs_file_inode_operations;
extern struct inode_operations jfs_symlink_inode_operations;
extern struct file_operations jfs_dir_operations;
extern struct file_operations jfs_file_operations;
struct address_space_operations jfs_aops;
extern int freeZeroLink(struct inode *);

void jfs_read_inode(struct inode *inode)
{
if (diRead(inode)) {
Expand Down Expand Up @@ -136,7 +129,7 @@ void jfs_delete_inode(struct inode *inode)
jfs_info("In jfs_delete_inode, inode = 0x%p", inode);

if (test_cflag(COMMIT_Freewmap, inode))
freeZeroLink(inode);
jfs_free_zero_link(inode);

diFree(inode);

Expand Down
10 changes: 0 additions & 10 deletions fs/jfs/jfs_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ void dump_mem(char *label, void *data, int length)

static struct proc_dir_entry *base;
#ifdef CONFIG_JFS_DEBUG
extern read_proc_t jfs_txanchor_read;

static int loglevel_read(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
Expand Down Expand Up @@ -97,14 +95,6 @@ static int loglevel_write(struct file *file, const char __user *buffer,
}
#endif


#ifdef CONFIG_JFS_STATISTICS
extern read_proc_t jfs_lmstats_read;
extern read_proc_t jfs_txstats_read;
extern read_proc_t jfs_xtstat_read;
extern read_proc_t jfs_mpstat_read;
#endif

static struct {
const char *name;
read_proc_t *read_fn;
Expand Down
15 changes: 11 additions & 4 deletions fs/jfs/jfs_debug.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) International Business Machines Corp., 2000-2002
* Portions Copyright (c) Christoph Hellwig, 2001-2002
* Copyright (C) International Business Machines Corp., 2000-2002
* Portions Copyright (C) Christoph Hellwig, 2001-2002
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,7 +31,9 @@
* CONFIG_JFS_DEBUG or CONFIG_JFS_STATISTICS is defined
*/
#if defined(CONFIG_PROC_FS) && (defined(CONFIG_JFS_DEBUG) || defined(CONFIG_JFS_STATISTICS))
#define PROC_FS_JFS
#define PROC_FS_JFS
extern void jfs_proc_init(void);
extern void jfs_proc_clean(void);
#endif

/*
Expand Down Expand Up @@ -65,8 +67,8 @@

extern int jfsloglevel;

/* dump memory contents */
extern void dump_mem(char *label, void *data, int length);
extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *);

/* information message: e.g., configuration, major event */
#define jfs_info(fmt, arg...) do { \
Expand Down Expand Up @@ -110,6 +112,11 @@ extern void dump_mem(char *label, void *data, int length);
* ----------
*/
#ifdef CONFIG_JFS_STATISTICS
extern int jfs_lmstats_read(char *, char **, off_t, int, int *, void *);
extern int jfs_txstats_read(char *, char **, off_t, int, int *, void *);
extern int jfs_mpstat_read(char *, char **, off_t, int, int *, void *);
extern int jfs_xtstat_read(char *, char **, off_t, int, int *, void *);

#define INCREMENT(x) ((x)++)
#define DECREMENT(x) ((x)--)
#define HIGHWATERMARK(x,y) ((x) = max((x), (y)))
Expand Down
7 changes: 1 addition & 6 deletions fs/jfs/jfs_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/fs.h>
#include <linux/quotaops.h>
#include "jfs_incore.h"
#include "jfs_inode.h"
#include "jfs_superblock.h"
#include "jfs_dmap.h"
#include "jfs_extent.h"
Expand All @@ -33,12 +34,6 @@ static int extBrealloc(struct inode *, s64, s64, s64 *, s64 *);
#endif
static s64 extRoundDown(s64 nb);

/*
* external references
*/
extern int jfs_commit_inode(struct inode *, int);


#define DPD(a) (printk("(a): %d\n",(a)))
#define DPC(a) (printk("(a): %c\n",(a)))
#define DPL1(a) \
Expand Down
6 changes: 1 addition & 5 deletions fs/jfs/jfs_imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/quotaops.h>

#include "jfs_incore.h"
#include "jfs_inode.h"
#include "jfs_filsys.h"
#include "jfs_dinode.h"
#include "jfs_dmap.h"
Expand All @@ -68,11 +69,6 @@
#define AG_LOCK(imap,agno) down(&imap->im_aglock[agno])
#define AG_UNLOCK(imap,agno) up(&imap->im_aglock[agno])

/*
* external references
*/
extern struct address_space_operations jfs_aops;

/*
* forward references
*/
Expand Down
1 change: 1 addition & 0 deletions fs/jfs/jfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/fs.h>
#include <linux/quotaops.h>
#include "jfs_incore.h"
#include "jfs_inode.h"
#include "jfs_filsys.h"
#include "jfs_imap.h"
#include "jfs_dinode.h"
Expand Down
19 changes: 18 additions & 1 deletion fs/jfs/jfs_inode.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) International Business Machines Corp., 2000-2001
* Copyright (C) International Business Machines Corp., 2000-2001
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -19,5 +19,22 @@
#define _H_JFS_INODE

extern struct inode *ialloc(struct inode *, umode_t);
extern int jfs_fsync(struct file *, struct dentry *, int);
extern void jfs_read_inode(struct inode *);
extern int jfs_commit_inode(struct inode *, int);
extern int jfs_write_inode(struct inode*, int);
extern void jfs_delete_inode(struct inode *);
extern void jfs_dirty_inode(struct inode *);
extern void jfs_truncate(struct inode *);
extern void jfs_truncate_nolock(struct inode *, loff_t);
extern void jfs_free_zero_link(struct inode *);
extern struct dentry *jfs_get_parent(struct dentry *dentry);

extern struct address_space_operations jfs_aops;
extern struct inode_operations jfs_dir_inode_operations;
extern struct file_operations jfs_dir_operations;
extern struct inode_operations jfs_file_inode_operations;
extern struct file_operations jfs_file_operations;
extern struct inode_operations jfs_symlink_inode_operations;
extern struct dentry_operations jfs_ci_dentry_operations;
#endif /* _H_JFS_INODE */
9 changes: 1 addition & 8 deletions fs/jfs/jfs_logmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
#include "jfs_incore.h"
#include "jfs_filsys.h"
#include "jfs_metapage.h"
#include "jfs_superblock.h"
#include "jfs_txnmgr.h"
#include "jfs_debug.h"

Expand Down Expand Up @@ -166,14 +167,6 @@ static LIST_HEAD(jfs_external_logs);
static struct jfs_log *dummy_log = NULL;
static DECLARE_MUTEX(jfs_log_sem);

/*
* external references
*/
extern void txLazyUnlock(struct tblock * tblk);
extern int jfs_stop_threads;
extern struct completion jfsIOwait;
extern int jfs_tlocks_low;

/*
* forward references
*/
Expand Down
2 changes: 2 additions & 0 deletions fs/jfs/jfs_logmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ extern int lmLogClose(struct super_block *sb);
extern int lmLogShutdown(struct jfs_log * log);
extern int lmLogInit(struct jfs_log * log);
extern int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize);
extern int lmGroupCommit(struct jfs_log *, struct tblock *);
extern int jfsIOWait(void *);
extern void jfs_flush_journal(struct jfs_log * log, int wait);
extern void jfs_syncpt(struct jfs_log *log);

Expand Down
4 changes: 2 additions & 2 deletions fs/jfs/jfs_metapage.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,12 +726,12 @@ void force_metapage(struct metapage *mp)
page_cache_release(page);
}

extern void hold_metapage(struct metapage *mp)
void hold_metapage(struct metapage *mp)
{
lock_page(mp->page);
}

extern void put_metapage(struct metapage *mp)
void put_metapage(struct metapage *mp)
{
if (mp->count || mp->nohomeok) {
/* Someone else will release this */
Expand Down
6 changes: 4 additions & 2 deletions fs/jfs/jfs_metapage.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) International Business Machines Corp., 2000-2002
* Portions Copyright (c) Christoph Hellwig, 2001-2002
* Copyright (C) International Business Machines Corp., 2000-2002
* Portions Copyright (C) Christoph Hellwig, 2001-2002
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -58,6 +58,8 @@ struct metapage {
#define mark_metapage_dirty(mp) set_bit(META_dirty, &(mp)->flag)

/* function prototypes */
extern int metapage_init(void);
extern void metapage_exit(void);
extern struct metapage *__get_metapage(struct inode *inode,
unsigned long lblock, unsigned int size,
int absolute, unsigned long new);
Expand Down
11 changes: 11 additions & 0 deletions fs/jfs/jfs_superblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,16 @@ struct jfs_superblock {
extern int readSuper(struct super_block *, struct buffer_head **);
extern int updateSuper(struct super_block *, uint);
extern void jfs_error(struct super_block *, const char *, ...);
extern int jfs_mount(struct super_block *);
extern int jfs_mount_rw(struct super_block *, int);
extern int jfs_umount(struct super_block *);
extern int jfs_umount_rw(struct super_block *);

extern int jfs_stop_threads;
extern struct completion jfsIOwait;
extern wait_queue_head_t jfs_IO_thread_wait;
extern wait_queue_head_t jfs_commit_thread_wait;
extern wait_queue_head_t jfs_sync_thread_wait;
extern int jfs_extendfs(struct super_block *, s64, int);

#endif /*_H_JFS_SUPERBLOCK */
Loading

0 comments on commit 1868f4a

Please sign in to comment.