Commit 87ad0ded authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: misc stuff for 2.5

 o make JFS_SBI an inline instead of a macros, as the other filesystems do
 o ditto for isReadOnly
 o move initialization of sb into the common part of lmLogOpen

Submitted by Christoph Hellwig
parent 81ded98a
......@@ -143,8 +143,17 @@ static inline struct jfs_inode_info *JFS_IP(struct inode *inode)
{
return list_entry(inode, struct jfs_inode_info, vfs_inode);
}
#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_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;
}
#endif /* _H_JFS_INCORE */
......@@ -1068,6 +1068,8 @@ int lmLogOpen(struct super_block *sb, log_t ** logptr)
return ENOMEM;
memset(log, 0, sizeof(log_t));
log->sb = sb; /* This should be a list */
if (!(JFS_SBI(sb)->mntflag & JFS_INLINELOG))
goto externalLog;
......@@ -1077,7 +1079,6 @@ int lmLogOpen(struct super_block *sb, log_t ** logptr)
* file system to log have 1-to-1 relationship;
*/
log->sb = sb; /* This should be a list */
log->bdev = sb->s_bdev;
log->flag = JFS_INLINELOG;
log->base = addressPXD(&JFS_SBI(sb)->logpxd);
......@@ -1114,7 +1115,6 @@ int lmLogOpen(struct super_block *sb, log_t ** logptr)
goto errout10;
}
log->sb = sb; /* This should be a list */
log->bdev = bdev;
memcpy(log->uuid, JFS_SBI(sb)->loguuid, sizeof(log->uuid));
......
......@@ -158,7 +158,6 @@ static void jfs_put_super(struct super_block *sb)
sbi->direct_inode = NULL;
sbi->direct_mapping = NULL;
JFS_SBI(sb) = 0;
kfree(sbi);
}
......@@ -255,10 +254,10 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
jFYI(1, ("In jfs_read_super: s_flags=0x%lx\n", sb->s_flags));
sbi = kmalloc(sizeof(struct jfs_sb_info), GFP_KERNEL);
JFS_SBI(sb) = sbi;
if (!sbi)
return -ENOSPC;
memset(sbi, 0, sizeof(struct jfs_sb_info));
sb->u.generic_sbp = sbi;
if (!parse_options((char *)data, sbi)) {
kfree(sbi);
......
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