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)
void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr)
{
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 ??
*/
switch (attr->va_type) {
......
......@@ -102,7 +102,6 @@ static struct inode *alloc_inode(struct super_block *sb)
struct address_space * const mapping = &inode->i_data;
inode->i_sb = sb;
inode->i_dev = sb->s_dev;
inode->i_blkbits = sb->s_blocksize_bits;
inode->i_flags = 0;
atomic_set(&inode->i_count, 1);
......
......@@ -67,7 +67,7 @@ int presto_i2m(struct inode *inode)
CDEBUG(D_PSDEV, "\n");
if ( !cache ) {
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;
return -1;
}
......
......@@ -182,7 +182,7 @@ inline void presto_debug_fail_blkdev(struct presto_file_set *fset,
{
int minor = presto_f2m(fset);
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)) {
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,
goto exit_lock;
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;
/*
......@@ -1820,7 +1820,7 @@ int presto_rename_dir(struct presto_file_set *fset, struct dentry *old_parent,
if (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;
if (!new_dentry->d_inode)
......@@ -1901,7 +1901,7 @@ int presto_rename_other(struct presto_file_set *fset, struct dentry *old_parent,
if (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;
if (!new_dentry->d_inode)
......
......@@ -1766,7 +1766,7 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx)
#else
/* kdevname is a broken interface. but we expose it to userspace */
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);
#endif
if (IS_POSIX(fl)) {
......
......@@ -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))
p = xdr_encode_hyper(p, (u64) fhp->fh_export->ex_fsid);
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);
time.tv_sec = fhp->fh_post_atime;
time.tv_nsec = 0;
......
......@@ -632,7 +632,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
#endif
/* 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)
file.f_ra = ra->p_ra;
......@@ -752,7 +752,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
*/
if (EX_WGATHER(exp)) {
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);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((HZ+99)/100);
......@@ -769,7 +769,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
#endif
}
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);
......
......@@ -484,8 +484,9 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map)
dev = 0;
ino = 0;
if (map->vm_file != NULL) {
dev = map->vm_file->f_dentry->d_inode->i_dev;
ino = map->vm_file->f_dentry->d_inode->i_ino;
struct inode *inode = map->vm_file->f_dentry->d_inode;
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
line = d_path(map->vm_file->f_dentry,
map->vm_file->f_vfsmnt,
buf, PAGE_SIZE);
......
......@@ -18,7 +18,7 @@
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->mode = inode->i_mode;
stat->nlink = inode->i_nlink;
......
......@@ -918,7 +918,6 @@ __udf_read_inode(struct inode *inode)
* Set defaults, but the inode is still incomplete!
* Note: get_new_inode() sets the following on a new inode:
* i_sb = sb
* i_dev = sb->s_dev;
* i_no = ino
* i_flags = sb->s_flags
* i_state = 0
......
......@@ -247,8 +247,8 @@ xfs_iget_core(
/*
* 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
* it soon if it's a dup. This should also initialize i_dev, i_ino,
* i_bno, i_mount, and i_index.
* it soon if it's a dup. This should also initialize i_ino, i_bno,
* i_mount, and i_index.
*/
error = xfs_iread(mp, tp, ino, &ip, bno);
if (error) {
......
......@@ -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",
ip->i_ino, atomic_read(&ip->i_count),
ip->i_dev, ip->i_size);
ip->i_sb->s_dev, ip->i_size);
kdb_printf(
" i_mode = 0x%x i_nlink = %d i_rdev = 0x%x i_state = 0x%lx\n",
......
......@@ -362,7 +362,6 @@ struct inode {
struct list_head i_dentry;
unsigned long i_ino;
atomic_t i_count;
dev_t i_dev;
umode_t i_mode;
unsigned int i_nlink;
uid_t i_uid;
......
......@@ -468,7 +468,6 @@ struct socket *sock_alloc(void)
if (!inode)
return NULL;
inode->i_dev = 0;
sock = SOCKET_I(inode);
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