Commit 47de5842 authored by Andries E. Brouwer's avatar Andries E. Brouwer Committed by Linus Torvalds

[PATCH] kill i_dev

The i_dev field is deleted and the few uses are replaced by i_sb->s_dev.

There is a single side effect: a stat on a socket now sees a nonzero
st_dev.  There is nothing against that - FreeBSD has a nonzero value as
well - but there is at least one utility (fuser) that will need an
update.
parent d7111bbc
...@@ -100,7 +100,7 @@ unsigned short coda_flags_to_cflags(unsigned short flags) ...@@ -100,7 +100,7 @@ unsigned short coda_flags_to_cflags(unsigned short flags)
void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr)
{ {
int inode_type; int inode_type;
/* inode's i_dev, i_flags, i_ino are set by iget /* inode's i_flags, i_ino are set by iget
XXX: is this all we need ?? XXX: is this all we need ??
*/ */
switch (attr->va_type) { switch (attr->va_type) {
......
...@@ -102,7 +102,6 @@ static struct inode *alloc_inode(struct super_block *sb) ...@@ -102,7 +102,6 @@ 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_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);
......
...@@ -67,7 +67,7 @@ int presto_i2m(struct inode *inode) ...@@ -67,7 +67,7 @@ int presto_i2m(struct inode *inode)
CDEBUG(D_PSDEV, "\n"); CDEBUG(D_PSDEV, "\n");
if ( !cache ) { if ( !cache ) {
CERROR("PRESTO: BAD: cannot find cache for dev %d, ino %ld\n", CERROR("PRESTO: BAD: cannot find cache for dev %d, ino %ld\n",
inode->i_dev, inode->i_ino); inode->i_sb->s_dev, inode->i_ino);
EXIT; EXIT;
return -1; return -1;
} }
......
...@@ -182,7 +182,7 @@ inline void presto_debug_fail_blkdev(struct presto_file_set *fset, ...@@ -182,7 +182,7 @@ inline void presto_debug_fail_blkdev(struct presto_file_set *fset,
{ {
int minor = presto_f2m(fset); int minor = presto_f2m(fset);
int errorval = izo_channels[minor].uc_errorval; int errorval = izo_channels[minor].uc_errorval;
kdev_t dev = to_kdev_t(fset->fset_dentry->d_inode->i_dev); kdev_t dev = to_kdev_t(fset->fset_dentry->d_inode->i_sb->s_dev);
if (errorval && errorval == (long)value && !is_read_only(dev)) { if (errorval && errorval == (long)value && !is_read_only(dev)) {
CDEBUG(D_SUPER, "setting device %s read only\n", kdevname(dev)); CDEBUG(D_SUPER, "setting device %s read only\n", kdevname(dev));
...@@ -763,7 +763,7 @@ int presto_do_link(struct presto_file_set *fset, struct dentry *old_dentry, ...@@ -763,7 +763,7 @@ int presto_do_link(struct presto_file_set *fset, struct dentry *old_dentry,
goto exit_lock; goto exit_lock;
error = -EXDEV; error = -EXDEV;
if (dir->d_inode->i_dev != inode->i_dev) if (dir->d_inode->i_sb->s_dev != inode->i_sb->s_dev)
goto exit_lock; goto exit_lock;
/* /*
...@@ -1820,7 +1820,7 @@ int presto_rename_dir(struct presto_file_set *fset, struct dentry *old_parent, ...@@ -1820,7 +1820,7 @@ int presto_rename_dir(struct presto_file_set *fset, struct dentry *old_parent,
if (error) if (error)
return error; return error;
if (new_dir->i_dev != old_dir->i_dev) if (new_dir->i_sb->s_dev != old_dir->i_sb->s_dev)
return -EXDEV; return -EXDEV;
if (!new_dentry->d_inode) if (!new_dentry->d_inode)
...@@ -1901,7 +1901,7 @@ int presto_rename_other(struct presto_file_set *fset, struct dentry *old_parent, ...@@ -1901,7 +1901,7 @@ int presto_rename_other(struct presto_file_set *fset, struct dentry *old_parent,
if (error) if (error)
return error; return error;
if (new_dir->i_dev != old_dir->i_dev) if (new_dir->i_sb->s_dev != old_dir->i_sb->s_dev)
return -EXDEV; return -EXDEV;
if (!new_dentry->d_inode) if (!new_dentry->d_inode)
......
...@@ -1766,7 +1766,7 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx) ...@@ -1766,7 +1766,7 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx)
#else #else
/* kdevname is a broken interface. but we expose it to userspace */ /* kdevname is a broken interface. but we expose it to userspace */
out += sprintf(out, "%d %s:%ld ", fl->fl_pid, out += sprintf(out, "%d %s:%ld ", fl->fl_pid,
inode ? kdevname(to_kdev_t(inode->i_dev)) : "<none>", inode ? kdevname(to_kdev_t(inode->i_sb->s_dev)) : "<none>",
inode ? inode->i_ino : 0); inode ? inode->i_ino : 0);
#endif #endif
if (IS_POSIX(fl)) { if (IS_POSIX(fl)) {
......
...@@ -226,7 +226,7 @@ encode_saved_post_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp) ...@@ -226,7 +226,7 @@ encode_saved_post_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
&& (fhp->fh_export->ex_flags & NFSEXP_FSID)) && (fhp->fh_export->ex_flags & NFSEXP_FSID))
p = xdr_encode_hyper(p, (u64) fhp->fh_export->ex_fsid); p = xdr_encode_hyper(p, (u64) fhp->fh_export->ex_fsid);
else else
p = xdr_encode_hyper(p, (u64) inode->i_dev); p = xdr_encode_hyper(p, (u64) inode->i_sb->s_dev);
p = xdr_encode_hyper(p, (u64) inode->i_ino); p = xdr_encode_hyper(p, (u64) inode->i_ino);
time.tv_sec = fhp->fh_post_atime; time.tv_sec = fhp->fh_post_atime;
time.tv_nsec = 0; time.tv_nsec = 0;
......
...@@ -632,7 +632,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -632,7 +632,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
#endif #endif
/* Get readahead parameters */ /* Get readahead parameters */
ra = nfsd_get_raparms(inode->i_dev, inode->i_ino); ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino);
if (ra) if (ra)
file.f_ra = ra->p_ra; file.f_ra = ra->p_ra;
...@@ -752,7 +752,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -752,7 +752,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
*/ */
if (EX_WGATHER(exp)) { if (EX_WGATHER(exp)) {
if (atomic_read(&inode->i_writecount) > 1 if (atomic_read(&inode->i_writecount) > 1
|| (last_ino == inode->i_ino && last_dev == inode->i_dev)) { || (last_ino == inode->i_ino && last_dev == inode->i_sb->s_dev)) {
dprintk("nfsd: write defer %d\n", current->pid); dprintk("nfsd: write defer %d\n", current->pid);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((HZ+99)/100); schedule_timeout((HZ+99)/100);
...@@ -769,7 +769,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -769,7 +769,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
#endif #endif
} }
last_ino = inode->i_ino; last_ino = inode->i_ino;
last_dev = inode->i_dev; last_dev = inode->i_sb->s_dev;
} }
dprintk("nfsd: write complete err=%d\n", err); dprintk("nfsd: write complete err=%d\n", err);
......
...@@ -484,8 +484,9 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map) ...@@ -484,8 +484,9 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map)
dev = 0; dev = 0;
ino = 0; ino = 0;
if (map->vm_file != NULL) { if (map->vm_file != NULL) {
dev = map->vm_file->f_dentry->d_inode->i_dev; struct inode *inode = map->vm_file->f_dentry->d_inode;
ino = map->vm_file->f_dentry->d_inode->i_ino; dev = inode->i_sb->s_dev;
ino = inode->i_ino;
line = d_path(map->vm_file->f_dentry, line = d_path(map->vm_file->f_dentry,
map->vm_file->f_vfsmnt, map->vm_file->f_vfsmnt,
buf, PAGE_SIZE); buf, PAGE_SIZE);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
void generic_fillattr(struct inode *inode, struct kstat *stat) void generic_fillattr(struct inode *inode, struct kstat *stat)
{ {
stat->dev = inode->i_dev; stat->dev = inode->i_sb->s_dev;
stat->ino = inode->i_ino; stat->ino = inode->i_ino;
stat->mode = inode->i_mode; stat->mode = inode->i_mode;
stat->nlink = inode->i_nlink; stat->nlink = inode->i_nlink;
......
...@@ -918,7 +918,6 @@ __udf_read_inode(struct inode *inode) ...@@ -918,7 +918,6 @@ __udf_read_inode(struct inode *inode)
* Set defaults, but the inode is still incomplete! * Set defaults, but the inode is still incomplete!
* Note: get_new_inode() sets the following on a new inode: * Note: get_new_inode() sets the following on a new inode:
* i_sb = sb * i_sb = sb
* i_dev = sb->s_dev;
* i_no = ino * i_no = ino
* i_flags = sb->s_flags * i_flags = sb->s_flags
* i_state = 0 * i_state = 0
......
...@@ -247,8 +247,8 @@ xfs_iget_core( ...@@ -247,8 +247,8 @@ xfs_iget_core(
/* /*
* Read the disk inode attributes into a new inode structure and get * Read the disk inode attributes into a new inode structure and get
* a new vnode for it. Initialize the inode lock so we can idestroy * a new vnode for it. Initialize the inode lock so we can idestroy
* it soon if it's a dup. This should also initialize i_dev, i_ino, * it soon if it's a dup. This should also initialize i_ino, i_bno,
* i_bno, i_mount, and i_index. * i_mount, and i_index.
*/ */
error = xfs_iread(mp, tp, ino, &ip, bno); error = xfs_iread(mp, tp, ino, &ip, bno);
if (error) { if (error) {
......
...@@ -1639,7 +1639,7 @@ static void printinode(struct inode *ip) ...@@ -1639,7 +1639,7 @@ static void printinode(struct inode *ip)
kdb_printf(" i_ino = %lu i_count = %u i_dev = 0x%x i_size %Ld\n", kdb_printf(" i_ino = %lu i_count = %u i_dev = 0x%x i_size %Ld\n",
ip->i_ino, atomic_read(&ip->i_count), ip->i_ino, atomic_read(&ip->i_count),
ip->i_dev, ip->i_size); ip->i_sb->s_dev, ip->i_size);
kdb_printf( kdb_printf(
" i_mode = 0x%x i_nlink = %d i_rdev = 0x%x i_state = 0x%lx\n", " i_mode = 0x%x i_nlink = %d i_rdev = 0x%x i_state = 0x%lx\n",
......
...@@ -362,7 +362,6 @@ struct inode { ...@@ -362,7 +362,6 @@ struct inode {
struct list_head i_dentry; struct list_head i_dentry;
unsigned long i_ino; unsigned long i_ino;
atomic_t i_count; atomic_t i_count;
dev_t i_dev;
umode_t i_mode; umode_t i_mode;
unsigned int i_nlink; unsigned int i_nlink;
uid_t i_uid; uid_t i_uid;
......
...@@ -468,7 +468,6 @@ struct socket *sock_alloc(void) ...@@ -468,7 +468,6 @@ struct socket *sock_alloc(void)
if (!inode) if (!inode)
return NULL; return NULL;
inode->i_dev = 0;
sock = SOCKET_I(inode); sock = SOCKET_I(inode);
inode->i_mode = S_IFSOCK|S_IRWXUGO; inode->i_mode = S_IFSOCK|S_IRWXUGO;
......
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