[PATCH] lots of missing statics (and dead code) in JFS
Christoph Hellwig <[email protected]> Sat, 28 Feb 2004 12:29:30 +0100
| Newsgroups | gmane.comp.file-systems.jfs.patches |
|---|---|
| Message-ID | <[email protected]> |
--- 1.4/fs/jfs/acl.c Thu Feb 19 07:54:07 2004
+++ edited/fs/jfs/acl.c Sat Feb 28 12:52:20 2004
@@ -24,7 +24,7 @@
#include "jfs_xattr.h"
#include "jfs_acl.h"
-struct posix_acl *jfs_get_acl(struct inode *inode, int type)
+static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
{
struct posix_acl *acl;
char *ea_name;
@@ -74,7 +74,7 @@
return acl;
}
-int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
+static int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
{
char *ea_name;
struct jfs_inode_info *ji = JFS_IP(inode);
@@ -247,7 +247,7 @@
return rc;
}
-int jfs_acl_chmod(struct inode *inode)
+static int jfs_acl_chmod(struct inode *inode)
{
struct posix_acl *acl, *clone;
int rc;
===== fs/jfs/jfs_acl.h 1.4 vs edited =====
--- 1.4/fs/jfs/jfs_acl.h Fri Jul 18 22:08:16 2003
+++ edited/fs/jfs/jfs_acl.h Sat Feb 28 12:52:07 2004
@@ -22,8 +22,6 @@
#include <linux/xattr_acl.h>
-struct posix_acl *jfs_get_acl(struct inode *, int);
-int jfs_set_acl(struct inode *, int, struct posix_acl *);
int jfs_permission(struct inode *, int, struct nameidata *);
int jfs_init_acl(struct inode *, struct inode *);
int jfs_setattr(struct dentry *, struct iattr *);
===== fs/jfs/jfs_dmap.c 1.17 vs edited =====
--- 1.17/fs/jfs/jfs_dmap.c Wed Oct 8 18:07:12 2003
+++ edited/fs/jfs/jfs_dmap.c Sat Feb 28 13:02:52 2004
@@ -124,7 +124,7 @@
s64 * results);
static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno,
s64 * results);
-int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
+static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
static int dbFindBits(u32 word, int l2nb);
static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx);
@@ -134,10 +134,10 @@
int nblocks);
static int dbMaxBud(u8 * cp);
s64 dbMapFileSizeToMapSize(struct inode *ipbmap);
-int blkstol2(s64 nb);
+static int blkstol2(s64 nb);
-int cntlz(u32 value);
-int cnttz(u32 word);
+static int cntlz(u32 value);
+static int cnttz(u32 word);
static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
int nblocks);
@@ -155,7 +155,7 @@
* into the table, with the table elements yielding the maximum
* binary buddy of free bits within the character.
*/
-signed char budtab[256] = {
+static s8 budtab[256] = {
3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -942,7 +942,7 @@
return (rc);
}
-
+#ifdef _NOTYET
/*
* NAME: dbAllocExact()
*
@@ -1009,7 +1009,7 @@
return (rc);
}
-
+#endif /* _NOTYET */
/*
* NAME: dbReAlloc()
@@ -1092,7 +1092,7 @@
* -ENOSPC - insufficient disk resources
* -EIO - i/o error
*/
-int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
+static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
{
struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);
s64 lblkno, lastblkno, extblkno;
@@ -3022,7 +3022,7 @@
* RETURN VALUES:
* count of trailing zeros
*/
-int cnttz(u32 word)
+static int cnttz(u32 word)
{
int n;
@@ -3047,7 +3047,7 @@
* RETURN VALUES:
* count of leading zeros
*/
-int cntlz(u32 value)
+static int cntlz(u32 value)
{
int n;
===== fs/jfs/jfs_dmap.h 1.4 vs edited =====
--- 1.4/fs/jfs/jfs_dmap.h Wed Sep 18 17:36:53 2002
+++ edited/fs/jfs/jfs_dmap.h Sat Feb 28 12:56:56 2004
@@ -286,8 +286,6 @@
extern int dbAlloc(struct inode *ipbmap, s64 hint, s64 nblocks, s64 * results);
-extern int dbAllocExact(struct inode *ip, s64 blkno, int nblocks);
-
extern int dbReAlloc(struct inode *ipbmap,
s64 blkno, s64 nblocks, s64 addnblocks, s64 * results);
===== fs/jfs/jfs_dtree.c 1.25 vs edited =====
--- 1.25/fs/jfs/jfs_dtree.c Wed Oct 8 18:07:12 2003
+++ edited/fs/jfs/jfs_dtree.c Sat Feb 28 12:49:48 2004
@@ -162,9 +162,6 @@
static int dtDeleteUp(tid_t tid, struct inode *ip, struct metapage * fmp,
dtpage_t * fp, struct btstack * btstack);
-static int dtSearchNode(struct inode *ip,
- s64 lmxaddr, pxd_t * kpxd, struct btstack * btstack);
-
static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p);
static int dtReadFirst(struct inode *ip, struct btstack * btstack);
@@ -2380,14 +2377,14 @@
return 0;
}
-
+#ifdef _NOTYET
/*
* NAME: dtRelocate()
*
* FUNCTION: relocate dtpage (internal or leaf) of directory;
* This function is mainly used by defragfs utility.
*/
-int dtRelocate(tid_t tid, struct inode *ip, s64 lmxaddr, pxd_t * opxd,
+static int dtRelocate(tid_t tid, struct inode *ip, s64 lmxaddr, pxd_t * opxd,
s64 nxaddr)
{
int rc = 0;
@@ -2575,7 +2572,6 @@
return rc;
}
-
/*
* NAME: dtSearchNode()
*
@@ -2677,7 +2673,7 @@
goto loop;
}
-
+#endif /* _NOTYET */
/*
* dtRelink()
@@ -2933,7 +2929,7 @@
/*
* function to determine next variable-sized jfs_dirent in buffer
*/
-inline struct jfs_dirent *next_jfs_dirent(struct jfs_dirent *dirent)
+static inline struct jfs_dirent *next_jfs_dirent(struct jfs_dirent *dirent)
{
return (struct jfs_dirent *)
((char *)dirent +
===== fs/jfs/jfs_dtree.h 1.4 vs edited =====
--- 1.4/fs/jfs/jfs_dtree.h Thu Sep 12 22:28:55 2002
+++ edited/fs/jfs/jfs_dtree.h Sat Feb 28 12:43:05 2004
@@ -265,9 +265,6 @@
extern int dtDelete(tid_t tid, struct inode *ip, struct component_name * key,
ino_t * data, int flag);
-extern int dtRelocate(tid_t tid,
- struct inode *ip, s64 lmxaddr, pxd_t * opxd, s64 nxaddr);
-
extern int dtModify(tid_t tid, struct inode *ip, struct component_name * key,
ino_t * orig_ino, ino_t new_ino, int flag);
===== fs/jfs/jfs_extent.c 1.10 vs edited =====
--- 1.10/fs/jfs/jfs_extent.c Wed Oct 8 18:07:12 2003
+++ edited/fs/jfs/jfs_extent.c Sat Feb 28 12:58:29 2004
@@ -35,7 +35,6 @@
/*
* external references
*/
-extern int dbExtend(struct inode *, s64, s64, s64);
extern int jfs_commit_inode(struct inode *, int);
===== fs/jfs/jfs_logmgr.c 1.54 vs edited =====
--- 1.54/fs/jfs/jfs_logmgr.c Thu Feb 19 04:42:22 2004
+++ edited/fs/jfs/jfs_logmgr.c Sat Feb 28 13:06:05 2004
@@ -186,6 +186,7 @@
static bio_end_io_t lbmIODone;
static void lbmStartIO(struct lbuf * bp);
static void lmGCwrite(struct jfs_log * log, int cant_block);
+static int lmLogSync(struct jfs_log * log, int nosyncwait);
@@ -800,7 +801,7 @@
* NOTE:
* This routine is called a interrupt time by lbmIODone
*/
-void lmPostGC(struct lbuf * bp)
+static void lmPostGC(struct lbuf * bp)
{
unsigned long flags;
struct jfs_log *log = bp->l_log;
@@ -923,7 +924,7 @@
*
* serialization: LOG_LOCK() held on entry/exit
*/
-int lmLogSync(struct jfs_log * log, int nosyncwait)
+static int lmLogSync(struct jfs_log * log, int nosyncwait)
{
int logsize;
int written; /* written since last syncpt */
===== fs/jfs/jfs_logmgr.h 1.12 vs edited =====
--- 1.12/fs/jfs/jfs_logmgr.h Wed Jul 9 17:29:24 2003
+++ edited/fs/jfs/jfs_logmgr.h Sat Feb 28 13:05:42 2004
@@ -508,7 +508,6 @@
extern int lmLogOpen(struct super_block *sb, struct jfs_log ** log);
extern int lmLogClose(struct super_block *sb, struct jfs_log * log);
-extern int lmLogSync(struct jfs_log * log, int nosyncwait);
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);
===== fs/jfs/jfs_txnmgr.c 1.50 vs edited =====
--- 1.50/fs/jfs/jfs_txnmgr.c Tue Feb 10 22:32:21 2004
+++ edited/fs/jfs/jfs_txnmgr.c Sat Feb 28 12:41:38 2004
@@ -168,25 +168,23 @@
/*
* forward references
*/
-int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
- struct tlock * tlck, struct commit * cd);
-int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
- struct tlock * tlck);
-void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
- struct tlock * tlck);
-void inlineLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
- struct tlock * tlck);
-void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
- struct tlock * tlck);
+static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+ struct tlock * tlck, struct commit * cd);
+static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+ struct tlock * tlck);
+static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+ struct tlock * tlck);
+static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+ struct tlock * tlck);
static void txAbortCommit(struct commit * cd);
static void txAllocPMap(struct inode *ip, struct maplock * maplock,
- struct tblock * tblk);
-void txForce(struct tblock * tblk);
-static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd);
-int txMoreLock(void);
+ struct tblock * tblk);
+static void txForce(struct tblock * tblk);
+static int txLog(struct jfs_log * log, struct tblock * tblk,
+ struct commit * cd);
static void txUpdateMap(struct tblock * tblk);
static void txRelease(struct tblock * tblk);
-void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck);
static void LogSyncRelease(struct metapage * mp);
@@ -1399,7 +1397,7 @@
*
* function: log inode tlock and format maplock to update bmap;
*/
-int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck, struct commit * cd)
{
int rc = 0;
@@ -1514,7 +1512,7 @@
*
* function: log data tlock
*/
-int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck)
{
struct metapage *mp;
@@ -1560,7 +1558,7 @@
*
* function: log dtree tlock and format maplock to update bmap;
*/
-void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck)
{
struct metapage *mp;
@@ -1665,7 +1663,7 @@
*
* function: log xtree tlock and format maplock to update bmap;
*/
-void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
+static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck)
{
struct inode *ip;
@@ -2725,7 +2723,7 @@
* allocation maps are updated in order. For synchronous transactions,
* let the user thread finish processing after txUpdateMap() is called.
*/
-void txLazyCommit(struct tblock * tblk)
+static void txLazyCommit(struct tblock * tblk)
{
struct jfs_log *log;
===== fs/jfs/jfs_unicode.c 1.8 vs edited =====
--- 1.8/fs/jfs/jfs_unicode.c Thu Feb 12 16:23:49 2004
+++ edited/fs/jfs/jfs_unicode.c Sat Feb 28 12:43:54 2004
@@ -62,8 +62,8 @@
* FUNCTION: Convert character string to unicode string
*
*/
-int jfs_strtoUCS(wchar_t * to,
- const char *from, int len, struct nls_table *codepage)
+static int jfs_strtoUCS(wchar_t * to, const char *from, int len,
+ struct nls_table *codepage)
{
int charlen;
int i;
===== fs/jfs/jfs_xtree.c 1.12 vs edited =====
--- 1.12/fs/jfs/jfs_xtree.c Wed Oct 8 18:07:12 2003
+++ edited/fs/jfs/jfs_xtree.c Sat Feb 28 13:04:18 2004
@@ -1736,7 +1736,7 @@
return rc;
}
-
+#ifdef _NOTYET
/*
* xtTailgate()
*
@@ -1918,7 +1918,7 @@
return rc;
}
-
+#endif /* _NOTYET */
/*
* xtUpdate()
===== fs/jfs/jfs_xtree.h 1.3 vs edited =====
--- 1.3/fs/jfs/jfs_xtree.h Thu Sep 12 22:28:57 2002
+++ edited/fs/jfs/jfs_xtree.h Sat Feb 28 13:03:45 2004
@@ -117,8 +117,10 @@
int xflag, s64 xoff, int xlen, s64 * xaddrp, int flag);
extern int xtExtend(tid_t tid, struct inode *ip, s64 xoff, int xlen,
int flag);
+#ifdef _NOTYET
extern int xtTailgate(tid_t tid, struct inode *ip,
s64 xoff, int xlen, s64 xaddr, int flag);
+#endif
extern int xtUpdate(tid_t tid, struct inode *ip, struct xad *nxad);
extern int xtDelete(tid_t tid, struct inode *ip, s64 xoff, int xlen,
int flag);
===== fs/jfs/namei.c 1.38 vs edited =====
--- 1.38/fs/jfs/namei.c Wed Feb 11 20:35:41 2004
+++ edited/fs/jfs/namei.c Sat Feb 28 12:53:56 2004
@@ -44,7 +44,7 @@
struct inode_operations jfs_dir_inode_operations;
struct file_operations jfs_dir_operations;
-s64 commitZeroLink(tid_t, struct inode *);
+static s64 commitZeroLink(tid_t, struct inode *);
/*
* NAME: jfs_create(dip, dentry, mode)
@@ -60,7 +60,7 @@
* RETURN: Errors from subroutines
*
*/
-int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
+static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
struct nameidata *nd)
{
int rc = 0;
@@ -181,7 +181,7 @@
* note:
* EACCESS: user needs search+write permission on the parent directory
*/
-int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
+static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
{
int rc = 0;
tid_t tid; /* transaction id */
@@ -314,7 +314,7 @@
* but the directory is not removed until the last reference to
* the directory is released (cf.unlink() of regular file).
*/
-int jfs_rmdir(struct inode *dip, struct dentry *dentry)
+static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
{
int rc;
tid_t tid; /* transaction id */
@@ -437,7 +437,7 @@
* JFS does NOT support unlink() on directories.
*
*/
-int jfs_unlink(struct inode *dip, struct dentry *dentry)
+static int jfs_unlink(struct inode *dip, struct dentry *dentry)
{
int rc;
tid_t tid; /* transaction id */
@@ -590,7 +590,7 @@
*
* RETURN: Errors from subroutines
*/
-s64 commitZeroLink(tid_t tid, struct inode *ip)
+static s64 commitZeroLink(tid_t tid, struct inode *ip)
{
int filetype;
struct tblock *tblk;
@@ -758,7 +758,7 @@
* EXDEV: target object and new link are on different file systems and
* implementation does not support links between file systems [XPG4.2].
*/
-int jfs_link(struct dentry *old_dentry,
+static int jfs_link(struct dentry *old_dentry,
struct inode *dir, struct dentry *dentry)
{
int rc;
@@ -838,7 +838,8 @@
* an intermediate result whose length exceeds PATH_MAX [XPG4.2]
*/
-int jfs_symlink(struct inode *dip, struct dentry *dentry, const char *name)
+static int jfs_symlink(struct inode *dip, struct dentry *dentry,
+ const char *name)
{
int rc;
tid_t tid;
@@ -1042,7 +1043,7 @@
*
* FUNCTION: rename a file or directory
*/
-int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
+static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{
struct btstack btstack;
@@ -1310,7 +1311,8 @@
*
* FUNCTION: Create a special file (device)
*/
-int jfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
+static int jfs_mknod(struct inode *dir, struct dentry *dentry,
+ int mode, dev_t rdev)
{
struct jfs_inode_info *jfs_ip;
struct btstack btstack;
@@ -1433,7 +1435,7 @@
return d_splice_alias(ip, dentry);
}
-struct dentry *jfs_get_parent(struct dentry *dentry)
+static struct dentry *jfs_get_parent(struct dentry *dentry)
{
struct super_block *sb = dentry->d_inode->i_sb;
struct dentry *parent = ERR_PTR(-ENOENT);
===== fs/jfs/super.c 1.47 vs edited =====
--- 1.47/fs/jfs/super.c Thu Feb 12 16:23:49 2004
+++ edited/fs/jfs/super.c Sat Feb 28 12:46:05 2004
@@ -321,7 +321,7 @@
return 0;
}
-int jfs_remount(struct super_block *sb, int *flags, char *data)
+static int jfs_remount(struct super_block *sb, int *flags, char *data)
{
s64 newLVSize = 0;
int rc = 0;