From: Brian Gerst <bgerst@didntduck.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>, Dave Jones <davej@suse.de>
Subject: [PATCH] struct super_block cleanup - romfs
Date: Thu, 28 Mar 2002 17:55:12 -0500 [thread overview]
Message-ID: <3CA39F50.7050108@didntduck.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 101 bytes --]
Kills romfs_sb_info by moving its single value to super_block->u.generic_ul.
--
Brian Gerst
[-- Attachment #2: sb-romfs-1 --]
[-- Type: text/plain, Size: 3200 bytes --]
diff -urN linux-2.5.7-bg2/fs/romfs/inode.c linux-2.5.7-bg3/fs/romfs/inode.c
--- linux-2.5.7-bg2/fs/romfs/inode.c Mon Mar 18 16:14:16 2002
+++ linux-2.5.7-bg3/fs/romfs/inode.c Thu Mar 28 15:19:26 2002
@@ -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
diff -urN linux-2.5.7-bg2/include/linux/fs.h linux-2.5.7-bg3/include/linux/fs.h
--- linux-2.5.7-bg2/include/linux/fs.h Wed Mar 27 20:27:58 2002
+++ linux-2.5.7-bg3/include/linux/fs.h Thu Mar 28 15:48:54 2002
@@ -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
diff -urN linux-2.5.7-bg2/include/linux/romfs_fs_sb.h linux-2.5.7-bg3/include/linux/romfs_fs_sb.h
--- linux-2.5.7-bg2/include/linux/romfs_fs_sb.h Thu Mar 7 21:18:27 2002
+++ linux-2.5.7-bg3/include/linux/romfs_fs_sb.h Wed Dec 31 19:00:00 1969
@@ -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
reply other threads:[~2002-03-28 22:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3CA39F50.7050108@didntduck.org \
--to=bgerst@didntduck.org \
--cc=davej@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox