struct super_block cleanup - romfs
PATCH 1/1 struct super_block cleanup - romfs
Kills romfs_sb_info by moving its single value to super_block->u.generic_ul.
Signature · 1 line
Brian Gerst
fs/romfs/inode.c +8 -7
@@ -76,6 +76,8 @@#include <asm/uaccess.h> +#define ROMFS_MAXSIZE (sb) (sb)->u.generic_ul +struct romfs_inode_info {unsigned long i_metasize;/* size of non-data area */ unsigned long i_dataoffset;/* from the start of fs */
@@ -112,7 +114,6 @@/* I would parse the options here, but there are none.. :) */ sb_set_blocksize (s,ROMBSIZE ); - s->u.generic_sbp = (void *)0 ; s->s_maxbytes =0xFFFFFFFF ; bh =sb_bread (s,0 );
@@ -138,7 +139,7 @@ } s->s_magic =ROMFS_MAGIC ; - s->u.romfs_sb.s_maxsize = sz; +ROMFS_MAXSIZE (s) = sz; s->s_flags |=MS_RDONLY ;
@@ -174,7 +175,7 @@ buf->f_type =ROMFS_MAGIC ; buf->f_bsize =ROMBSIZE ; buf->f_bfree = buf->f_bavail = buf->f_ffree; - buf->f_blocks = (sb->u.romfs_sb.s_maxsize+ROMBSIZE -1 )>>ROMBSBITS ; + buf->f_blocks = (ROMFS_MAXSIZE (sb)+ROMBSIZE -1 )>>ROMBSBITS ; buf->f_namelen =ROMFS_MAXFN ;return 0 ; }
@@ -187,7 +188,7 @@struct buffer_head *bh;unsigned long avail, maxsize, res; - maxsize = i->i_sb->u.romfs_sb.s_maxsize; + maxsize =ROMFS_MAXSIZE (i->i_sb);if (offset >= maxsize)return -1 ;
@@ -229,7 +230,7 @@struct buffer_head *bh;unsigned long avail, maxsize, res; - maxsize = i->i_sb->u.romfs_sb.s_maxsize; + maxsize =ROMFS_MAXSIZE (i->i_sb);if (offset >= maxsize || count > maxsize || offset+count>maxsize)return -1 ;
@@ -273,7 +274,7 @@int stored =0 ;char fsname[ROMFS_MAXFN ];/* XXX dynamic? */ - maxoff = i->i_sb->u.romfs_sb.s_maxsize; + maxoff =ROMFS_MAXSIZE (i->i_sb); offset = filp->f_pos;if (!offset) {
@@ -333,7 +334,7 @@if (romfs_copyfrom (dir, &ri, offset,ROMFH_SIZE ) <=0 ) goto out; - maxoff = dir->i_sb->u.romfs_sb.s_maxsize; + maxoff =ROMFS_MAXSIZE (dir->i_sb); offset =ntohl (ri.spec) &ROMFH_MASK ;/* OK, now find the file whose name is in "dentry" in the
include/linux/fs.h +1 -2
@@ -648,7 +648,6 @@#include <linux/hpfs_fs_sb.h> #include <linux/ntfs_fs_sb.h> #include <linux/sysv_fs_sb.h> -#include <linux/romfs_fs_sb.h> #include <linux/adfs_fs_sb.h> #include <linux/bfs_fs_sb.h>
@@ -690,10 +689,10 @@struct hpfs_sb_info hpfs_sb;struct ntfs_sb_info ntfs_sb;struct sysv_sb_info sysv_sb; -struct romfs_sb_info romfs_sb;struct adfs_sb_info adfs_sb;struct bfs_sb_info bfs_sb;void *generic_sbp; +unsigned long generic_ul; } u;/* * The next field is for VFS *only*. No filesystems have any business
include/linux/romfs_fs_sb.h +0 -10
@@ -1,10 +0,0 @@ -#ifndef __ROMFS_FS_SB -#define __ROMFS_FS_SB - -/* romfs superblock in-core data */ - -struct romfs_sb_info { -unsigned long s_maxsize; -}; - -#endif