[Jfs-patches] [PATCH] 2.4 syncups
Brought to you by:
blaschke-oss,
shaggyk
From: Christoph H. <hc...@in...> - 2002-05-03 16:50:07
|
Bring 2.4 in line with 2.5 and previously posted cleanup patch. As an exception the metapage locking changes aren't backported without fixing. Index: fs/jfs/jfs_incore.h =================================================================== RCS file: /usr/cvs/jfs/linux24/fs/jfs/jfs_incore.h,v retrieving revision 1.5 diff -u -u -r1.5 jfs_incore.h --- fs/jfs/jfs_incore.h 3 Apr 2002 20:49:54 -0000 1.5 +++ fs/jfs/jfs_incore.h 3 May 2002 13:00:37 -0000 @@ -18,8 +18,8 @@ #ifndef _H_JFS_INCORE #define _H_JFS_INCORE -#include <asm/bitops.h> #include <linux/slab.h> +#include <asm/bitops.h> #include "jfs_types.h" #include "jfs_xtree.h" #include "jfs_dtree.h" @@ -136,10 +136,22 @@ uint state; /* 4: mount/recovery state */ }; -#define JFS_IP(ip) ((struct jfs_inode_info *)(ip)->u.generic_ip) -#define JFS_SBI(sb) ((struct jfs_sb_info *)(sb)->u.generic_sbp) - -#define isReadOnly(ip) ((JFS_SBI((ip)->i_sb)->log) ? 0 : 1) +static inline struct jfs_inode_info *JFS_IP(struct inode *inode) +{ + return inode->u.generic_ip; +} + +static inline struct jfs_sb_info *JFS_SBI(struct super_block *sb) +{ + return sb->u.generic_sbp; +} + +static inline int isReadOnly(struct inode *inode) +{ + if (JFS_SBI(inode->i_sb)->log) + return 0; + return 1; +} /* * Allocating and freeing the structure Index: fs/jfs/jfs_inode.c =================================================================== RCS file: /usr/cvs/jfs/linux24/fs/jfs/jfs_inode.c,v retrieving revision 1.16 diff -u -u -r1.16 jfs_inode.c --- fs/jfs/jfs_inode.c 3 Apr 2002 20:49:54 -0000 1.16 +++ fs/jfs/jfs_inode.c 3 May 2002 13:00:37 -0000 @@ -150,7 +150,7 @@ struct jfs_inode_info *jfs_inode; jfs_inode = kmem_cache_alloc(jfs_inode_cachep, GFP_NOFS); - JFS_IP(inode) = jfs_inode; + inode->u.generic_ip = jfs_inode; if (!jfs_inode) return -ENOSPC; jfs_inode->inode = inode; Index: fs/jfs/jfs_logmgr.c =================================================================== RCS file: /usr/cvs/jfs/linux24/fs/jfs/jfs_logmgr.c,v retrieving revision 1.34 diff -u -u -r1.34 jfs_logmgr.c --- fs/jfs/jfs_logmgr.c 17 Apr 2002 16:14:27 -0000 1.34 +++ fs/jfs/jfs_logmgr.c 3 May 2002 13:00:44 -0000 @@ -1061,6 +1061,9 @@ return ENOMEM; memset(log, 0, sizeof(log_t)); + log->sb = sb; /* This should be a list */ + log->bdev = sb->s_bdev; + if (!(JFS_SBI(sb)->mntflag & JFS_INLINELOG)) goto externalLog; @@ -1070,9 +1073,7 @@ * file system to log have 1-to-1 relationship; */ - log->sb = sb; /* This should be a list */ log->flag = JFS_INLINELOG; - log->dev = sb->s_dev; log->base = addressPXD(&JFS_SBI(sb)->logpxd); log->size = lengthPXD(&JFS_SBI(sb)->logpxd) >> (L2LOGPSIZE - sb->s_blocksize_bits); @@ -1102,10 +1103,6 @@ goto errout10; } - log->sb = sb; /* This should be a list */ - log->dev = JFS_SBI(sb)->logdev; - log->bdev = bdev; - /* * initialize log: */ @@ -1312,7 +1309,7 @@ logsuper->state = cpu_to_le32(LOGMOUNT); log->serial = le32_to_cpu(logsuper->serial) + 1; logsuper->serial = cpu_to_le32(log->serial); - logsuper->device = cpu_to_le32(kdev_t_to_nr(log->dev)); + logsuper->device = cpu_to_le32(log->bdev->bd_dev); lbmDirectWrite(log, bpsuper, lbmWRITE | lbmRELEASE | lbmSYNC); if ((rc = lbmIOWait(bpsuper, lbmFREE))) goto errout30; @@ -1648,7 +1645,7 @@ init_waitqueue_head(&lbuf->l_ioevent); lbuf->l_bh.b_size = LOGPSIZE; - lbuf->l_bh.b_dev = log->dev; + lbuf->l_bh.b_dev = to_kdev_t(log->bdev->bd_dev); lbuf->l_bh.b_end_io = lbmIODone; lbuf->l_bh.b_private = lbuf; lbuf->l_bh.b_page = virt_to_page(lbuf->l_ldata); Index: fs/jfs/jfs_logmgr.h =================================================================== RCS file: /usr/cvs/jfs/linux24/fs/jfs/jfs_logmgr.h,v retrieving revision 1.6 diff -u -u -r1.6 jfs_logmgr.h --- fs/jfs/jfs_logmgr.h 3 Apr 2002 20:49:54 -0000 1.6 +++ fs/jfs/jfs_logmgr.h 3 May 2002 13:00:46 -0000 @@ -366,7 +366,6 @@ * need to be a list if we share * the log between fs's */ - kdev_t dev; /* 4: log lv number */ struct block_device *bdev; /* 4: log lv pointer */ s32 serial; /* 4: log mount serial number */ Index: fs/jfs/jfs_metapage.c =================================================================== RCS file: /usr/cvs/jfs/linux24/fs/jfs/jfs_metapage.c,v retrieving revision 1.34 diff -u -u -r1.34 jfs_metapage.c --- fs/jfs/jfs_metapage.c 3 Apr 2002 20:49:54 -0000 1.34 +++ fs/jfs/jfs_metapage.c 3 May 2002 13:00:48 -0000 @@ -377,7 +377,7 @@ page_index = lblock >> l2BlocksPerPage; page_offset = (lblock - (page_index << l2BlocksPerPage)) << l2bsize; - if ((page_offset + size) > PAGE_SIZE) { + if ((page_offset + size) > PAGE_CACHE_SIZE) { spin_unlock(&meta_lock); jERROR(1, ("MetaData crosses page boundary!!\n")); return NULL; Index: fs/jfs/jfs_mount.c =================================================================== RCS file: /usr/cvs/jfs/linux24/fs/jfs/jfs_mount.c,v retrieving revision 1.14 diff -u -u -r1.14 jfs_mount.c --- fs/jfs/jfs_mount.c 3 Apr 2002 20:49:54 -0000 1.14 +++ fs/jfs/jfs_mount.c 3 May 2002 13:00:50 -0000 @@ -423,9 +423,10 @@ */ int updateSuper(struct super_block *sb, uint state) { - int rc; - metapage_t *mp; struct jfs_superblock *j_sb; + struct jfs_sb_info *sbi = JFS_SBI(sb); + metapage_t *mp; + int rc; /* * Only fsck can fix dirty state @@ -439,13 +440,12 @@ j_sb = (struct jfs_superblock *) (mp->data); j_sb->s_state = cpu_to_le32(state); - JFS_SBI(sb)->state = state; + sbi->state = state; if (state == FM_MOUNT) { /* record log's dev_t and mount serial number */ - j_sb->s_logdev = - cpu_to_le32(kdev_t_to_nr(JFS_SBI(sb)->log->dev)); - j_sb->s_logserial = cpu_to_le32(JFS_SBI(sb)->log->serial); + j_sb->s_logdev = cpu_to_le32(sbi->log->bdev->bd_dev); + j_sb->s_logserial = cpu_to_le32(sbi->log->serial); /* record our own device number in case the location * changes after a reboot */ Index: fs/jfs/super.c =================================================================== RCS file: /usr/cvs/jfs/linux24/fs/jfs/super.c,v retrieving revision 1.33 diff -u -u -r1.33 super.c --- fs/jfs/super.c 3 Apr 2002 20:49:54 -0000 1.33 +++ fs/jfs/super.c 3 May 2002 13:00:52 -0000 @@ -139,7 +139,6 @@ sbi->direct_inode = NULL; sbi->direct_mapping = NULL; - JFS_SBI(sb) = 0; kfree(sbi); } @@ -238,10 +237,10 @@ sb->s_flags)); sbi = kmalloc(sizeof(struct jfs_sb_info), GFP_KERNEL); - JFS_SBI(sb) = sbi; if (!sbi) return NULL; memset(sbi, 0, sizeof(struct jfs_sb_info)); + sb->u.generic_sbp = sbi; if (!parse_options((char *)data, sbi)) { kfree(sbi); |