diff --git a/[refs] b/[refs] index 05f8925ba62e..9312f045a151 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2c6e5a839f92591a4bc6cac4a575d42151645af3 +refs/heads/master: 18b504e25fd617bee8830d2cdcaff7fb7b5931bb diff --git a/trunk/fs/Kconfig b/trunk/fs/Kconfig index 178e27494b74..6a4ad4bb7a54 100644 --- a/trunk/fs/Kconfig +++ b/trunk/fs/Kconfig @@ -741,6 +741,56 @@ config SYSFS Designers of embedded systems may wish to say N here to conserve space. +config DEVFS_FS + bool "/dev file system support (OBSOLETE)" + depends on EXPERIMENTAL + help + This is support for devfs, a virtual file system (like /proc) which + provides the file system interface to device drivers, normally found + in /dev. Devfs does not depend on major and minor number + allocations. Device drivers register entries in /dev which then + appear automatically, which means that the system administrator does + not have to create character and block special device files in the + /dev directory using the mknod command (or MAKEDEV script) anymore. + + This is work in progress. If you want to use this, you *must* read + the material in , especially + the file README there. + + Note that devfs no longer manages /dev/pts! If you are using UNIX98 + ptys, you will also need to mount the /dev/pts filesystem (devpts). + + Note that devfs has been obsoleted by udev, + . + It has been stripped down to a bare minimum and is only provided for + legacy installations that use its naming scheme which is + unfortunately different from the names normal Linux installations + use. + + If unsure, say N. + +config DEVFS_MOUNT + bool "Automatically mount at boot" + depends on DEVFS_FS + help + This option appears if you have CONFIG_DEVFS_FS enabled. Setting + this to 'Y' will make the kernel automatically mount devfs onto /dev + when the system is booted, before the init thread is started. + You can override this with the "devfs=nomount" boot option. + + If unsure, say N. + +config DEVFS_DEBUG + bool "Debug devfs" + depends on DEVFS_FS + help + If you say Y here, then the /dev file system code will generate + debugging messages. See the file + for more + details. + + If unsure, say N. + config DEVPTS_FS_XATTR bool "/dev/pts Extended Attributes" depends on UNIX98_PTYS diff --git a/trunk/fs/jfs/acl.c b/trunk/fs/jfs/acl.c index 30a2bf9eeda5..8d2a9ab981d4 100644 --- a/trunk/fs/jfs/acl.c +++ b/trunk/fs/jfs/acl.c @@ -70,7 +70,8 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type) if (!IS_ERR(acl)) *p_acl = posix_acl_dup(acl); } - kfree(value); + if (value) + kfree(value); return acl; } @@ -111,7 +112,8 @@ static int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) } rc = __jfs_setxattr(inode, ea_name, value, size, 0); out: - kfree(value); + if (value) + kfree(value); if (!rc) { if (*p_acl && (*p_acl != JFS_ACL_NOT_CACHED)) diff --git a/trunk/fs/jfs/file.c b/trunk/fs/jfs/file.c index c2c19c9ed9a4..a87b06fa8ff8 100644 --- a/trunk/fs/jfs/file.c +++ b/trunk/fs/jfs/file.c @@ -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 @@ -19,13 +19,16 @@ #include #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; diff --git a/trunk/fs/jfs/inode.c b/trunk/fs/jfs/inode.c index 2137138c59b0..24a689179af2 100644 --- a/trunk/fs/jfs/inode.c +++ b/trunk/fs/jfs/inode.c @@ -23,7 +23,6 @@ #include #include #include "jfs_incore.h" -#include "jfs_inode.h" #include "jfs_filsys.h" #include "jfs_imap.h" #include "jfs_extent.h" @@ -31,6 +30,14 @@ #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)) { @@ -129,7 +136,7 @@ void jfs_delete_inode(struct inode *inode) jfs_info("In jfs_delete_inode, inode = 0x%p", inode); if (test_cflag(COMMIT_Freewmap, inode)) - jfs_free_zero_link(inode); + freeZeroLink(inode); diFree(inode); diff --git a/trunk/fs/jfs/jfs_debug.c b/trunk/fs/jfs/jfs_debug.c index 4caea6b43b92..91a0a889ebc5 100644 --- a/trunk/fs/jfs/jfs_debug.c +++ b/trunk/fs/jfs/jfs_debug.c @@ -58,6 +58,8 @@ 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) { @@ -95,6 +97,14 @@ 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; diff --git a/trunk/fs/jfs/jfs_debug.h b/trunk/fs/jfs/jfs_debug.h index ddffbbd4d955..a38079ae1e00 100644 --- a/trunk/fs/jfs/jfs_debug.h +++ b/trunk/fs/jfs/jfs_debug.h @@ -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 @@ -31,9 +31,7 @@ * 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 -extern void jfs_proc_init(void); -extern void jfs_proc_clean(void); + #define PROC_FS_JFS #endif /* @@ -67,8 +65,8 @@ extern void jfs_proc_clean(void); 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 { \ @@ -112,11 +110,6 @@ extern int jfs_txanchor_read(char *, char **, off_t, int, int *, void *); * ---------- */ #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))) diff --git a/trunk/fs/jfs/jfs_dmap.c b/trunk/fs/jfs/jfs_dmap.c index cced2fed9d0f..69007fd546ef 100644 --- a/trunk/fs/jfs/jfs_dmap.c +++ b/trunk/fs/jfs/jfs_dmap.c @@ -272,6 +272,7 @@ int dbMount(struct inode *ipbmap) int dbUnmount(struct inode *ipbmap, int mounterror) { struct bmap *bmp = JFS_SBI(ipbmap->i_sb)->bmap; + int i; if (!(mounterror || isReadOnly(ipbmap))) dbSync(ipbmap); @@ -281,6 +282,14 @@ int dbUnmount(struct inode *ipbmap, int mounterror) */ truncate_inode_pages(ipbmap->i_mapping, 0); + /* + * Sanity Check + */ + for (i = 0; i < bmp->db_numag; i++) + if (atomic_read(&bmp->db_active[i])) + printk(KERN_ERR "dbUnmount: db_active[%d] = %d\n", + i, atomic_read(&bmp->db_active[i])); + /* free the memory for the in-memory bmap. */ kfree(bmp); diff --git a/trunk/fs/jfs/jfs_dtree.c b/trunk/fs/jfs/jfs_dtree.c index 8676aee3ae48..ac41f72d6d50 100644 --- a/trunk/fs/jfs/jfs_dtree.c +++ b/trunk/fs/jfs/jfs_dtree.c @@ -2931,9 +2931,6 @@ static void add_missing_indices(struct inode *inode, s64 bn) ASSERT(p->header.flag & BT_LEAF); tlck = txLock(tid, inode, mp, tlckDTREE | tlckENTRY); - if (BT_IS_ROOT(mp)) - tlck->type |= tlckBTROOT; - dtlck = (struct dt_lock *) &tlck->lock; stbl = DT_GETSTBL(p); diff --git a/trunk/fs/jfs/jfs_extent.c b/trunk/fs/jfs/jfs_extent.c index 4879603daa1c..1953acb79266 100644 --- a/trunk/fs/jfs/jfs_extent.c +++ b/trunk/fs/jfs/jfs_extent.c @@ -19,7 +19,6 @@ #include #include #include "jfs_incore.h" -#include "jfs_inode.h" #include "jfs_superblock.h" #include "jfs_dmap.h" #include "jfs_extent.h" @@ -34,6 +33,12 @@ 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) \ diff --git a/trunk/fs/jfs/jfs_imap.c b/trunk/fs/jfs/jfs_imap.c index 971af2977eff..7acff2ce3c80 100644 --- a/trunk/fs/jfs/jfs_imap.c +++ b/trunk/fs/jfs/jfs_imap.c @@ -47,7 +47,6 @@ #include #include "jfs_incore.h" -#include "jfs_inode.h" #include "jfs_filsys.h" #include "jfs_dinode.h" #include "jfs_dmap.h" @@ -69,6 +68,11 @@ #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 */ diff --git a/trunk/fs/jfs/jfs_inode.c b/trunk/fs/jfs/jfs_inode.c index 2af5efbfd06f..84f2459b2191 100644 --- a/trunk/fs/jfs/jfs_inode.c +++ b/trunk/fs/jfs/jfs_inode.c @@ -19,7 +19,6 @@ #include #include #include "jfs_incore.h" -#include "jfs_inode.h" #include "jfs_filsys.h" #include "jfs_imap.h" #include "jfs_dinode.h" diff --git a/trunk/fs/jfs/jfs_inode.h b/trunk/fs/jfs/jfs_inode.h index b54bac576cb3..3df91fbfe781 100644 --- a/trunk/fs/jfs/jfs_inode.h +++ b/trunk/fs/jfs/jfs_inode.h @@ -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 @@ -19,22 +19,5 @@ #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 */ diff --git a/trunk/fs/jfs/jfs_logmgr.c b/trunk/fs/jfs/jfs_logmgr.c index 7c8387ed4192..dfa1200daa61 100644 --- a/trunk/fs/jfs/jfs_logmgr.c +++ b/trunk/fs/jfs/jfs_logmgr.c @@ -71,7 +71,6 @@ #include "jfs_incore.h" #include "jfs_filsys.h" #include "jfs_metapage.h" -#include "jfs_superblock.h" #include "jfs_txnmgr.h" #include "jfs_debug.h" @@ -167,6 +166,14 @@ 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 */ @@ -1617,8 +1624,6 @@ void jfs_flush_journal(struct jfs_log *log, int wait) } } assert(list_empty(&log->cqueue)); - -#ifdef CONFIG_JFS_DEBUG if (!list_empty(&log->synclist)) { struct logsyncblk *lp; @@ -1633,8 +1638,9 @@ void jfs_flush_journal(struct jfs_log *log, int wait) dump_mem("orphan tblock", lp, sizeof(struct tblock)); } +// current->state = TASK_INTERRUPTIBLE; +// schedule(); } -#endif //assert(list_empty(&log->synclist)); clear_bit(log_FLUSH, &log->flag); } diff --git a/trunk/fs/jfs/jfs_logmgr.h b/trunk/fs/jfs/jfs_logmgr.h index 747114cd38b8..51291fbc420c 100644 --- a/trunk/fs/jfs/jfs_logmgr.h +++ b/trunk/fs/jfs/jfs_logmgr.h @@ -507,8 +507,6 @@ 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); diff --git a/trunk/fs/jfs/jfs_metapage.c b/trunk/fs/jfs/jfs_metapage.c index 6c5485d16c39..41bf078dce05 100644 --- a/trunk/fs/jfs/jfs_metapage.c +++ b/trunk/fs/jfs/jfs_metapage.c @@ -198,7 +198,7 @@ static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags) } } -static inline struct metapage *alloc_metapage(unsigned int gfp_mask) +static inline struct metapage *alloc_metapage(int gfp_mask) { return mempool_alloc(metapage_mempool, gfp_mask); } @@ -726,12 +726,12 @@ void force_metapage(struct metapage *mp) page_cache_release(page); } -void hold_metapage(struct metapage *mp) +extern void hold_metapage(struct metapage *mp) { lock_page(mp->page); } -void put_metapage(struct metapage *mp) +extern void put_metapage(struct metapage *mp) { if (mp->count || mp->nohomeok) { /* Someone else will release this */ diff --git a/trunk/fs/jfs/jfs_metapage.h b/trunk/fs/jfs/jfs_metapage.h index f0b7d3282b07..991e9fb84c75 100644 --- a/trunk/fs/jfs/jfs_metapage.h +++ b/trunk/fs/jfs/jfs_metapage.h @@ -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 @@ -58,8 +58,6 @@ 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); diff --git a/trunk/fs/jfs/jfs_superblock.h b/trunk/fs/jfs/jfs_superblock.h index fcf781bf31cb..ab0566f70cfa 100644 --- a/trunk/fs/jfs/jfs_superblock.h +++ b/trunk/fs/jfs/jfs_superblock.h @@ -109,16 +109,5 @@ 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 */ diff --git a/trunk/fs/jfs/jfs_txnmgr.c b/trunk/fs/jfs/jfs_txnmgr.c index 8cbaaff1d5fa..e93d01aa12c4 100644 --- a/trunk/fs/jfs/jfs_txnmgr.c +++ b/trunk/fs/jfs/jfs_txnmgr.c @@ -42,6 +42,7 @@ * hold on to mp+lock thru update of maps */ + #include #include #include @@ -50,7 +51,6 @@ #include #include #include "jfs_incore.h" -#include "jfs_inode.h" #include "jfs_filsys.h" #include "jfs_metapage.h" #include "jfs_dinode.h" @@ -109,6 +109,7 @@ static int TxLockHWM; /* High water mark for number of txLocks used */ static int TxLockVHWM; /* Very High water mark */ struct tlock *TxLock; /* transaction lock table */ + /* * transaction management lock */ @@ -148,6 +149,7 @@ static inline void TXN_SLEEP_DROP_LOCK(wait_queue_head_t * event) #define TXN_WAKEUP(event) wake_up_all(event) + /* * statistics */ @@ -159,6 +161,16 @@ static struct { int waitlock; /* 4: # of tlock wait */ } stattx; + +/* + * external references + */ +extern int lmGroupCommit(struct jfs_log *, struct tblock *); +extern int jfs_commit_inode(struct inode *, int); +extern int jfs_stop_threads; + +extern struct completion jfsIOwait; + /* * forward references */ @@ -346,6 +358,7 @@ void txExit(void) TxBlock = NULL; } + /* * NAME: txBegin() * @@ -447,6 +460,7 @@ tid_t txBegin(struct super_block *sb, int flag) return t; } + /* * NAME: txBeginAnon() * @@ -489,6 +503,7 @@ void txBeginAnon(struct super_block *sb) TXN_UNLOCK(); } + /* * txEnd() * @@ -577,6 +592,7 @@ void txEnd(tid_t tid) TXN_WAKEUP(&TxAnchor.freewait); } + /* * txLock() * @@ -852,6 +868,7 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp, return NULL; } + /* * NAME: txRelease() * @@ -891,6 +908,7 @@ static void txRelease(struct tblock * tblk) TXN_UNLOCK(); } + /* * NAME: txUnlock() * @@ -978,6 +996,7 @@ static void txUnlock(struct tblock * tblk) } } + /* * txMaplock() * @@ -1050,6 +1069,7 @@ struct tlock *txMaplock(tid_t tid, struct inode *ip, int type) return tlck; } + /* * txLinelock() * @@ -1083,6 +1103,8 @@ struct linelock *txLinelock(struct linelock * tlock) return linelock; } + + /* * transaction commit management * ----------------------------- @@ -1351,6 +1373,7 @@ int txCommit(tid_t tid, /* transaction identifier */ return rc; } + /* * NAME: txLog() * @@ -1414,6 +1437,7 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd) return rc; } + /* * diLog() * @@ -1441,6 +1465,7 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, if (tlck->type & tlckENTRY) { /* log after-image for logredo(): */ lrd->type = cpu_to_le16(LOG_REDOPAGE); +// *pxd = mp->cm_pxd; PXDaddress(pxd, mp->index); PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits); @@ -1527,6 +1552,7 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, return rc; } + /* * dataLog() * @@ -1573,6 +1599,7 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, return 0; } + /* * dtLog() * @@ -1612,6 +1639,7 @@ static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, lrd->log.redopage.type |= cpu_to_le16(LOG_EXTEND); else lrd->log.redopage.type |= cpu_to_le16(LOG_NEW); +// *pxd = mp->cm_pxd; PXDaddress(pxd, mp->index); PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits); @@ -1676,6 +1704,7 @@ static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, return; } + /* * xtLog() * @@ -1731,6 +1760,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, * applying the after-image to the meta-data page. */ lrd->type = cpu_to_le16(LOG_REDOPAGE); +// *page_pxd = mp->cm_pxd; PXDaddress(page_pxd, mp->index); PXDlength(page_pxd, mp->logical_size >> tblk->sb->s_blocksize_bits); @@ -2063,6 +2093,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, return; } + /* * mapLog() * @@ -2149,6 +2180,7 @@ void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, } } + /* * txEA() * @@ -2201,6 +2233,7 @@ void txEA(tid_t tid, struct inode *ip, dxd_t * oldea, dxd_t * newea) } } + /* * txForce() * @@ -2267,6 +2300,7 @@ void txForce(struct tblock * tblk) } } + /* * txUpdateMap() * @@ -2403,6 +2437,7 @@ static void txUpdateMap(struct tblock * tblk) } } + /* * txAllocPMap() * @@ -2474,6 +2509,7 @@ static void txAllocPMap(struct inode *ip, struct maplock * maplock, } } + /* * txFreeMap() * @@ -2575,6 +2611,7 @@ void txFreeMap(struct inode *ip, } } + /* * txFreelock() * @@ -2615,6 +2652,7 @@ void txFreelock(struct inode *ip) TXN_UNLOCK(); } + /* * txAbort() * diff --git a/trunk/fs/jfs/jfs_txnmgr.h b/trunk/fs/jfs/jfs_txnmgr.h index 59ad0f6b7231..b71b82c2df04 100644 --- a/trunk/fs/jfs/jfs_txnmgr.h +++ b/trunk/fs/jfs/jfs_txnmgr.h @@ -285,26 +285,34 @@ struct commit { /* * external declarations */ -extern int jfs_tlocks_low; - -extern int txInit(void); -extern void txExit(void); -extern struct tlock *txLock(tid_t, struct inode *, struct metapage *, int); -extern struct tlock *txMaplock(tid_t, struct inode *, int); -extern int txCommit(tid_t, int, struct inode **, int); -extern tid_t txBegin(struct super_block *, int); -extern void txBeginAnon(struct super_block *); -extern void txEnd(tid_t); -extern void txAbort(tid_t, int); -extern struct linelock *txLinelock(struct linelock *); -extern void txFreeMap(struct inode *, struct maplock *, struct tblock *, int); -extern void txEA(tid_t, struct inode *, dxd_t *, dxd_t *); -extern void txFreelock(struct inode *); -extern int lmLog(struct jfs_log *, struct tblock *, struct lrd *, - struct tlock *); -extern void txQuiesce(struct super_block *); -extern void txResume(struct super_block *); -extern void txLazyUnlock(struct tblock *); -extern int jfs_lazycommit(void *); -extern int jfs_sync(void *); +extern struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage *mp, + int flag); + +extern struct tlock *txMaplock(tid_t tid, struct inode *ip, int flag); + +extern int txCommit(tid_t tid, int nip, struct inode **iplist, int flag); + +extern tid_t txBegin(struct super_block *sb, int flag); + +extern void txBeginAnon(struct super_block *sb); + +extern void txEnd(tid_t tid); + +extern void txAbort(tid_t tid, int dirty); + +extern struct linelock *txLinelock(struct linelock * tlock); + +extern void txFreeMap(struct inode *ip, struct maplock * maplock, + struct tblock * tblk, int maptype); + +extern void txEA(tid_t tid, struct inode *ip, dxd_t * oldea, dxd_t * newea); + +extern void txFreelock(struct inode *ip); + +extern int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, + struct tlock * tlck); + +extern void txQuiesce(struct super_block *sb); + +extern void txResume(struct super_block *sb); #endif /* _H_JFS_TXNMGR */ diff --git a/trunk/fs/jfs/namei.c b/trunk/fs/jfs/namei.c index 1cae14e741eb..8413a368f449 100644 --- a/trunk/fs/jfs/namei.c +++ b/trunk/fs/jfs/namei.c @@ -31,9 +31,20 @@ #include "jfs_acl.h" #include "jfs_debug.h" +extern struct inode_operations jfs_file_inode_operations; +extern struct inode_operations jfs_symlink_inode_operations; +extern struct file_operations jfs_file_operations; +extern struct address_space_operations jfs_aops; + +extern int jfs_fsync(struct file *, struct dentry *, int); +extern void jfs_truncate_nolock(struct inode *, loff_t); +extern int jfs_init_acl(struct inode *, struct inode *); + /* * forward references */ +struct inode_operations jfs_dir_inode_operations; +struct file_operations jfs_dir_operations; struct dentry_operations jfs_ci_dentry_operations; static s64 commitZeroLink(tid_t, struct inode *); @@ -644,7 +655,7 @@ static s64 commitZeroLink(tid_t tid, struct inode *ip) /* - * NAME: jfs_free_zero_link() + * NAME: freeZeroLink() * * FUNCTION: for non-directory, called by iClose(), * free resources of a file from cache and WORKING map @@ -652,12 +663,15 @@ static s64 commitZeroLink(tid_t tid, struct inode *ip) * while associated with a pager object, * * PARAMETER: ip - pointer to inode of file. + * + * RETURN: 0 -ok */ -void jfs_free_zero_link(struct inode *ip) +int freeZeroLink(struct inode *ip) { + int rc = 0; int type; - jfs_info("jfs_free_zero_link: ip = 0x%p", ip); + jfs_info("freeZeroLink: ip = 0x%p", ip); /* return if not reg or symbolic link or if size is * already ok. @@ -670,10 +684,10 @@ void jfs_free_zero_link(struct inode *ip) case S_IFLNK: /* if its contained in inode nothing to do */ if (ip->i_size < IDATASIZE) - return; + return 0; break; default: - return; + return 0; } /* @@ -723,7 +737,9 @@ void jfs_free_zero_link(struct inode *ip) * free xtree/data blocks from working block map; */ if (ip->i_size) - xtTruncate(0, ip, 0, COMMIT_WMAP); + rc = xtTruncate(0, ip, 0, COMMIT_WMAP); + + return rc; } /* diff --git a/trunk/fs/jfs/super.c b/trunk/fs/jfs/super.c index 810a3653d8b3..5e774ed7fb64 100644 --- a/trunk/fs/jfs/super.c +++ b/trunk/fs/jfs/super.c @@ -28,7 +28,6 @@ #include "jfs_incore.h" #include "jfs_filsys.h" -#include "jfs_inode.h" #include "jfs_metapage.h" #include "jfs_superblock.h" #include "jfs_dmap.h" @@ -63,6 +62,37 @@ module_param(jfsloglevel, int, 0644); MODULE_PARM_DESC(jfsloglevel, "Specify JFS loglevel (0, 1 or 2)"); #endif +/* + * External declarations + */ +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 jfsIOWait(void *); +extern int jfs_lazycommit(void *); +extern int jfs_sync(void *); + +extern void jfs_read_inode(struct inode *inode); +extern void jfs_dirty_inode(struct inode *inode); +extern void jfs_delete_inode(struct inode *inode); +extern int jfs_write_inode(struct inode *inode, int wait); + +extern struct dentry *jfs_get_parent(struct dentry *dentry); +extern int jfs_extendfs(struct super_block *, s64, int); + +extern struct dentry_operations jfs_ci_dentry_operations; + +#ifdef PROC_FS_JFS /* see jfs_debug.h */ +extern void jfs_proc_init(void); +extern void jfs_proc_clean(void); +#endif + +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; + static void jfs_handle_error(struct super_block *sb) { struct jfs_sb_info *sbi = JFS_SBI(sb); @@ -563,6 +593,11 @@ static struct file_system_type jfs_fs_type = { .fs_flags = FS_REQUIRES_DEV, }; +extern int metapage_init(void); +extern int txInit(void); +extern void txExit(void); +extern void metapage_exit(void); + static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags) { struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo; diff --git a/trunk/fs/jfs/symlink.c b/trunk/fs/jfs/symlink.c index 287d8d6c3cfd..ef4c07ee92b2 100644 --- a/trunk/fs/jfs/symlink.c +++ b/trunk/fs/jfs/symlink.c @@ -1,5 +1,5 @@ /* - * Copyright (C) Christoph Hellwig, 2001-2002 + * 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 @@ -19,7 +19,6 @@ #include #include #include "jfs_incore.h" -#include "jfs_inode.h" #include "jfs_xattr.h" static int jfs_follow_link(struct dentry *dentry, struct nameidata *nd) diff --git a/trunk/fs/jfs/xattr.c b/trunk/fs/jfs/xattr.c index 6016373701a3..7a9ffd5d03dc 100644 --- a/trunk/fs/jfs/xattr.c +++ b/trunk/fs/jfs/xattr.c @@ -946,7 +946,8 @@ int __jfs_setxattr(struct inode *inode, const char *name, const void *value, out: up_write(&JFS_IP(inode)->xattr_sem); - kfree(os2name); + if (os2name) + kfree(os2name); return rc; } @@ -1041,7 +1042,8 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data, out: up_read(&JFS_IP(inode)->xattr_sem); - kfree(os2name); + if (os2name) + kfree(os2name); return size; } diff --git a/trunk/include/linux/netlink.h b/trunk/include/linux/netlink.h index 561d4dc75836..3029cad63a01 100644 --- a/trunk/include/linux/netlink.h +++ b/trunk/include/linux/netlink.h @@ -147,7 +147,7 @@ struct netlink_callback int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); int (*done)(struct netlink_callback *cb); int family; - long args[4]; + long args[5]; }; struct netlink_notify