Commit b7031fe5 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (10/14) resync

->s_dev is switched to dev_t.  Everything that uses it uses it as
a number - i.e. all instances are either minor() or kdev_t_to_nr().
parent aaa44e6b
...@@ -409,7 +409,7 @@ static int report_statvfs(struct vfsmount *mnt, struct inode *inode, u32 buf) ...@@ -409,7 +409,7 @@ static int report_statvfs(struct vfsmount *mnt, struct inode *inode, u32 buf)
__put_user (s.f_files, &ss->f_files) || __put_user (s.f_files, &ss->f_files) ||
__put_user (s.f_ffree, &ss->f_ffree) || __put_user (s.f_ffree, &ss->f_ffree) ||
__put_user (s.f_ffree, &ss->f_favail) || __put_user (s.f_ffree, &ss->f_favail) ||
__put_user (R4_DEV(kdev_t_to_nr(inode->i_sb->s_dev)), &ss->f_fsid) || __put_user (R4_DEV(inode->i_sb->s_dev), &ss->f_fsid) ||
__copy_to_user (ss->f_basetype,p,j) || __copy_to_user (ss->f_basetype,p,j) ||
__put_user (0, (char *)&ss->f_basetype[j]) || __put_user (0, (char *)&ss->f_basetype[j]) ||
__put_user (s.f_namelen, &ss->f_namemax) || __put_user (s.f_namelen, &ss->f_namemax) ||
...@@ -443,7 +443,7 @@ static int report_statvfs64(struct vfsmount *mnt, struct inode *inode, u32 buf) ...@@ -443,7 +443,7 @@ static int report_statvfs64(struct vfsmount *mnt, struct inode *inode, u32 buf)
__put_user (s.f_files, &ss->f_files) || __put_user (s.f_files, &ss->f_files) ||
__put_user (s.f_ffree, &ss->f_ffree) || __put_user (s.f_ffree, &ss->f_ffree) ||
__put_user (s.f_ffree, &ss->f_favail) || __put_user (s.f_ffree, &ss->f_favail) ||
__put_user (R4_DEV(kdev_t_to_nr(inode->i_sb->s_dev)), &ss->f_fsid) || __put_user (R4_DEV(inode->i_sb->s_dev), &ss->f_fsid) ||
__copy_to_user (ss->f_basetype,p,j) || __copy_to_user (ss->f_basetype,p,j) ||
__put_user (0, (char *)&ss->f_basetype[j]) || __put_user (0, (char *)&ss->f_basetype[j]) ||
__put_user (s.f_namelen, &ss->f_namemax) || __put_user (s.f_namelen, &ss->f_namemax) ||
......
...@@ -196,7 +196,7 @@ static int bfs_statfs(struct super_block *s, struct statfs *buf) ...@@ -196,7 +196,7 @@ static int bfs_statfs(struct super_block *s, struct statfs *buf)
buf->f_bfree = buf->f_bavail = info->si_freeb; buf->f_bfree = buf->f_bavail = info->si_freeb;
buf->f_files = info->si_lasti + 1 - BFS_ROOT_INO; buf->f_files = info->si_lasti + 1 - BFS_ROOT_INO;
buf->f_ffree = info->si_freei; buf->f_ffree = info->si_freei;
buf->f_fsid.val[0] = kdev_t_to_nr(s->s_dev); buf->f_fsid.val[0] = s->s_dev;
buf->f_namelen = BFS_NAMELEN; buf->f_namelen = BFS_NAMELEN;
return 0; return 0;
} }
......
...@@ -101,7 +101,7 @@ static struct inode *alloc_inode(struct super_block *sb) ...@@ -101,7 +101,7 @@ static struct inode *alloc_inode(struct super_block *sb)
struct address_space * const mapping = &inode->i_data; struct address_space * const mapping = &inode->i_data;
inode->i_sb = sb; inode->i_sb = sb;
inode->i_dev = sb->s_dev; inode->i_dev = to_kdev_t(sb->s_dev);
inode->i_blkbits = sb->s_blocksize_bits; inode->i_blkbits = sb->s_blocksize_bits;
inode->i_flags = 0; inode->i_flags = 0;
atomic_set(&inode->i_count, 1); atomic_set(&inode->i_count, 1);
......
...@@ -73,7 +73,7 @@ kmem_cache_t *fm_cache = NULL; ...@@ -73,7 +73,7 @@ kmem_cache_t *fm_cache = NULL;
/* Called by the VFS at mount time to initialize the whole file system. */ /* Called by the VFS at mount time to initialize the whole file system. */
static int jffs_fill_super(struct super_block *sb, void *data, int silent) static int jffs_fill_super(struct super_block *sb, void *data, int silent)
{ {
kdev_t dev = sb->s_dev; kdev_t dev = to_kdev_t(sb->s_dev);
struct inode *root_inode; struct inode *root_inode;
struct jffs_control *c; struct jffs_control *c;
......
...@@ -450,7 +450,7 @@ jffs_create_control(struct super_block *sb) ...@@ -450,7 +450,7 @@ jffs_create_control(struct super_block *sb)
DJM(no_hash++); DJM(no_hash++);
for (i = 0; i < c->hash_len; i++) for (i = 0; i < c->hash_len; i++)
INIT_LIST_HEAD(&c->hash[i]); INIT_LIST_HEAD(&c->hash[i]);
if (!(c->fmc = jffs_build_begin(c, sb->s_dev))) { if (!(c->fmc = jffs_build_begin(c, MINOR(sb->s_dev)))) {
goto fail_fminit; goto fail_fminit;
} }
c->next_ino = JFFS_MIN_INO + 1; c->next_ino = JFFS_MIN_INO + 1;
...@@ -3148,7 +3148,7 @@ jffs_try_to_erase(struct jffs_control *c) ...@@ -3148,7 +3148,7 @@ jffs_try_to_erase(struct jffs_control *c)
__u32 pos; __u32 pos;
__u32 end; __u32 end;
pos = (__u32)flash_get_direct_pointer(c->sb->s_dev, offset); pos = (__u32)flash_get_direct_pointer(to_kdev_t(c->sb->s_dev), offset);
end = pos + erase_size; end = pos + erase_size;
D2(printk("JFFS: Checking erased sector(s)...\n")); D2(printk("JFFS: Checking erased sector(s)...\n"));
......
...@@ -31,7 +31,7 @@ extern kmem_cache_t *node_cache; ...@@ -31,7 +31,7 @@ extern kmem_cache_t *node_cache;
/* This function creates a new shiny flash memory control structure. */ /* This function creates a new shiny flash memory control structure. */
struct jffs_fmcontrol * struct jffs_fmcontrol *
jffs_build_begin(struct jffs_control *c, kdev_t dev) jffs_build_begin(struct jffs_control *c, int unit)
{ {
struct jffs_fmcontrol *fmc; struct jffs_fmcontrol *fmc;
struct mtd_info *mtd; struct mtd_info *mtd;
...@@ -46,7 +46,7 @@ jffs_build_begin(struct jffs_control *c, kdev_t dev) ...@@ -46,7 +46,7 @@ jffs_build_begin(struct jffs_control *c, kdev_t dev)
} }
DJM(no_jffs_fmcontrol++); DJM(no_jffs_fmcontrol++);
mtd = get_mtd_device(NULL, minor(dev)); mtd = get_mtd_device(NULL, unit);
if (!mtd) { if (!mtd) {
kfree(fmc); kfree(fmc);
......
...@@ -122,7 +122,7 @@ struct jffs_fmcontrol ...@@ -122,7 +122,7 @@ struct jffs_fmcontrol
struct jffs_fmcontrol *jffs_build_begin(struct jffs_control *c, kdev_t dev); struct jffs_fmcontrol *jffs_build_begin(struct jffs_control *c, int unit);
void jffs_build_end(struct jffs_fmcontrol *fmc); void jffs_build_end(struct jffs_fmcontrol *fmc);
void jffs_cleanup_fmcontrol(struct jffs_fmcontrol *fmc); void jffs_cleanup_fmcontrol(struct jffs_fmcontrol *fmc);
......
...@@ -119,7 +119,7 @@ static int jffs2_sb_set(struct super_block *sb, void *data) ...@@ -119,7 +119,7 @@ static int jffs2_sb_set(struct super_block *sb, void *data)
device */ device */
sb->u.generic_sbp = p; sb->u.generic_sbp = p;
p->os_priv = sb; p->os_priv = sb;
sb->s_dev = mk_kdev(MTD_BLOCK_MAJOR, p->mtd->index); sb->s_dev = MKDEV(MTD_BLOCK_MAJOR, p->mtd->index);
return 0; return 0;
} }
......
...@@ -247,7 +247,7 @@ int nfs_fill_super(struct super_block *sb, struct nfs_mount_data *data, int sile ...@@ -247,7 +247,7 @@ int nfs_fill_super(struct super_block *sb, struct nfs_mount_data *data, int sile
int tcp, version, maxlen; int tcp, version, maxlen;
/* We probably want something more informative here */ /* We probably want something more informative here */
snprintf(sb->s_id, sizeof(sb->s_id), "%x:%x", major(sb->s_dev), minor(sb->s_dev)); snprintf(sb->s_id, sizeof(sb->s_id), "%x:%x", MAJOR(sb->s_dev), MINOR(sb->s_dev));
sb->s_magic = NFS_SUPER_MAGIC; sb->s_magic = NFS_SUPER_MAGIC;
sb->s_op = &nfs_sops; sb->s_op = &nfs_sops;
......
...@@ -52,7 +52,7 @@ static int exp_verify_string(char *cp, int max); ...@@ -52,7 +52,7 @@ static int exp_verify_string(char *cp, int max);
#define CLIENT_HASH(a) \ #define CLIENT_HASH(a) \
((((a)>>24) ^ ((a)>>16) ^ ((a)>>8) ^(a)) & CLIENT_HASHMASK) ((((a)>>24) ^ ((a)>>16) ^ ((a)>>8) ^(a)) & CLIENT_HASHMASK)
/* XXX: is this adequate for 32bit kdev_t ? */ /* XXX: is this adequate for 32bit kdev_t ? */
#define EXPORT_HASH(dev) (minor(dev) & (NFSCLNT_EXPMAX - 1)) #define EXPORT_HASH(dev) (MINOR(dev) & (NFSCLNT_EXPMAX - 1))
#define EXPORT_FSID_HASH(fsid) ((fsid) & (NFSCLNT_EXPMAX - 1)) #define EXPORT_FSID_HASH(fsid) ((fsid) & (NFSCLNT_EXPMAX - 1))
struct svc_clnthash { struct svc_clnthash {
...@@ -75,7 +75,7 @@ exp_get(svc_client *clp, kdev_t dev, ino_t ino) ...@@ -75,7 +75,7 @@ exp_get(svc_client *clp, kdev_t dev, ino_t ino)
if (!clp) if (!clp)
return NULL; return NULL;
head = &clp->cl_export[EXPORT_HASH(dev)]; head = &clp->cl_export[EXPORT_HASH(kdev_t_to_nr(dev))];
list_for_each(p, head) { list_for_each(p, head) {
svc_export *exp = list_entry(p, svc_export, ex_hash); svc_export *exp = list_entry(p, svc_export, ex_hash);
if (exp->ex_ino == ino && kdev_same(exp->ex_dev, dev)) if (exp->ex_ino == ino && kdev_same(exp->ex_dev, dev))
...@@ -364,7 +364,7 @@ exp_export(struct nfsctl_export *nxp) ...@@ -364,7 +364,7 @@ exp_export(struct nfsctl_export *nxp)
if (parent) if (parent)
exp_change_parents(clp, parent, exp); exp_change_parents(clp, parent, exp);
list_add(&exp->ex_hash, clp->cl_export + EXPORT_HASH(dev)); list_add(&exp->ex_hash, clp->cl_export + EXPORT_HASH(kdev_t_to_nr(dev)));
list_add_tail(&exp->ex_list, &clp->cl_list); list_add_tail(&exp->ex_list, &clp->cl_list);
exp_fsid_hash(clp, exp); exp_fsid_hash(clp, exp);
......
...@@ -1951,7 +1951,7 @@ static int journal_init_dev( struct super_block *super, ...@@ -1951,7 +1951,7 @@ static int journal_init_dev( struct super_block *super,
journal -> j_dev_bd = NULL; journal -> j_dev_bd = NULL;
journal -> j_dev_file = NULL; journal -> j_dev_file = NULL;
jdev = SB_ONDISK_JOURNAL_DEVICE( super ) ? jdev = SB_ONDISK_JOURNAL_DEVICE( super ) ?
SB_ONDISK_JOURNAL_DEVICE( super ) : kdev_t_to_nr(super->s_dev); SB_ONDISK_JOURNAL_DEVICE( super ) : super->s_dev;
/* there is no "jdev" option and journal is on separate device */ /* there is no "jdev" option and journal is on separate device */
if( ( !jdev_name || !jdev_name[ 0 ] ) ) { if( ( !jdev_name || !jdev_name[ 0 ] ) ) {
journal -> j_dev_bd = bdget(jdev); journal -> j_dev_bd = bdget(jdev);
......
...@@ -327,7 +327,7 @@ struct super_block * user_get_super(dev_t dev) ...@@ -327,7 +327,7 @@ struct super_block * user_get_super(dev_t dev)
spin_lock(&sb_lock); spin_lock(&sb_lock);
list_for_each(p, &super_blocks) { list_for_each(p, &super_blocks) {
struct super_block *s = sb_entry(p); struct super_block *s = sb_entry(p);
if (kdev_t_to_nr(s->s_dev) == dev) { if (s->s_dev == dev) {
s->s_count++; s->s_count++;
spin_unlock(&sb_lock); spin_unlock(&sb_lock);
down_read(&s->s_umount); down_read(&s->s_umount);
...@@ -419,13 +419,13 @@ int set_anon_super(struct super_block *s, void *data) ...@@ -419,13 +419,13 @@ int set_anon_super(struct super_block *s, void *data)
} }
set_bit(dev, unnamed_dev_in_use); set_bit(dev, unnamed_dev_in_use);
spin_unlock(&unnamed_dev_lock); spin_unlock(&unnamed_dev_lock);
s->s_dev = mk_kdev(0, dev); s->s_dev = MKDEV(0, dev);
return 0; return 0;
} }
void kill_anon_super(struct super_block *sb) void kill_anon_super(struct super_block *sb)
{ {
int slot = minor(sb->s_dev); int slot = MINOR(sb->s_dev);
generic_shutdown_super(sb); generic_shutdown_super(sb);
spin_lock(&unnamed_dev_lock); spin_lock(&unnamed_dev_lock);
clear_bit(slot, unnamed_dev_in_use); clear_bit(slot, unnamed_dev_in_use);
...@@ -442,7 +442,7 @@ void kill_litter_super(struct super_block *sb) ...@@ -442,7 +442,7 @@ void kill_litter_super(struct super_block *sb)
static int set_bdev_super(struct super_block *s, void *data) static int set_bdev_super(struct super_block *s, void *data)
{ {
s->s_bdev = data; s->s_bdev = data;
s->s_dev = to_kdev_t(s->s_bdev->bd_dev); s->s_dev = s->s_bdev->bd_dev;
return 0; return 0;
} }
......
...@@ -627,7 +627,7 @@ extern spinlock_t sb_lock; ...@@ -627,7 +627,7 @@ extern spinlock_t sb_lock;
#define S_BIAS (1<<30) #define S_BIAS (1<<30)
struct super_block { struct super_block {
struct list_head s_list; /* Keep this first */ struct list_head s_list; /* Keep this first */
kdev_t s_dev; dev_t s_dev; /* search index; _not_ kdev_t */
unsigned long s_blocksize; unsigned long s_blocksize;
unsigned long s_old_blocksize; unsigned long s_old_blocksize;
unsigned char s_blocksize_bits; unsigned char s_blocksize_bits;
......
...@@ -36,8 +36,8 @@ typedef struct { unsigned short major, minor; } kdev_t; ...@@ -36,8 +36,8 @@ typedef struct { unsigned short major, minor; } kdev_t;
Admissible operations on an object of type kdev_t: Admissible operations on an object of type kdev_t:
- passing it along - passing it along
- comparing it for equality with another such object - comparing it for equality with another such object
- storing it in ROOT_DEV, inode->i_dev, inode->i_rdev, sb->s_dev, - storing it in inode->i_dev, inode->i_rdev, req->rq_dev, de->dc_dev,
bh->b_dev, req->rq_dev, de->dc_dev, tty->device - tty->device
- using its bit pattern as argument in a hash function - using its bit pattern as argument in a hash function
- finding its major and minor - finding its major and minor
- complaining about it - complaining about it
......
...@@ -329,7 +329,7 @@ static void __init mount_block_root(char *name, int flags) ...@@ -329,7 +329,7 @@ static void __init mount_block_root(char *name, int flags)
out: out:
putname(fs_names); putname(fs_names);
sys_chdir("/root"); sys_chdir("/root");
ROOT_DEV = kdev_t_to_nr(current->fs->pwdmnt->mnt_sb->s_dev); ROOT_DEV = current->fs->pwdmnt->mnt_sb->s_dev;
printk("VFS: Mounted root (%s filesystem)%s.\n", printk("VFS: Mounted root (%s filesystem)%s.\n",
current->fs->pwdmnt->mnt_sb->s_type->name, current->fs->pwdmnt->mnt_sb->s_type->name,
(current->fs->pwdmnt->mnt_sb->s_flags & MS_RDONLY) ? " readonly" : ""); (current->fs->pwdmnt->mnt_sb->s_flags & MS_RDONLY) ? " readonly" : "");
...@@ -703,7 +703,7 @@ static void __init mount_root(void) ...@@ -703,7 +703,7 @@ static void __init mount_root(void)
if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) { if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {
if (mount_nfs_root()) { if (mount_nfs_root()) {
sys_chdir("/root"); sys_chdir("/root");
ROOT_DEV = kdev_t_to_nr(current->fs->pwdmnt->mnt_sb->s_dev); ROOT_DEV = current->fs->pwdmnt->mnt_sb->s_dev;
printk("VFS: Mounted root (nfs filesystem).\n"); printk("VFS: Mounted root (nfs filesystem).\n");
return; return;
} }
......
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