Commit 88cc0d3e authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ->i_dev switched to dev_t

	* ->i_dev followed the example of ->s_dev - it's dev_t now.  All
remaining uses of ->i_dev either outright want dev_t (stat()) or couldn't
care less (printing major:minor in /proc/<pid>/maps, etc.)
parent c9add9b8
...@@ -1090,7 +1090,7 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, ...@@ -1090,7 +1090,7 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
#ifdef DEBUG_SIGNALS_MAPS #ifdef DEBUG_SIGNALS_MAPS
#define MAPS_LINE_FORMAT "%08lx-%08lx %s %08lx %s %lu " #define MAPS_LINE_FORMAT "%08lx-%08lx %s %08lx %02x:%02x %lu "
static inline void read_maps (void) static inline void read_maps (void)
{ {
...@@ -1107,7 +1107,7 @@ static inline void read_maps (void) ...@@ -1107,7 +1107,7 @@ static inline void read_maps (void)
char *line; char *line;
char str[5], *cp = str; char str[5], *cp = str;
int flags; int flags;
kdev_t dev; dev_t dev;
unsigned long ino; unsigned long ino;
/* /*
...@@ -1132,7 +1132,7 @@ static inline void read_maps (void) ...@@ -1132,7 +1132,7 @@ static inline void read_maps (void)
buffer, PAGE_SIZE); buffer, PAGE_SIZE);
} }
printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT, printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT,
kdevname(dev), ino); MAJOR(dev), MINOR(dev), ino);
if (map->vm_file != NULL) if (map->vm_file != NULL)
printk("%s\n", line); printk("%s\n", line);
else else
......
...@@ -633,7 +633,7 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, ...@@ -633,7 +633,7 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
#ifdef DEBUG_SIGNALS_MAPS #ifdef DEBUG_SIGNALS_MAPS
#define MAPS_LINE_FORMAT "%016lx-%016lx %s %016lx %s %lu " #define MAPS_LINE_FORMAT "%016lx-%016lx %s %016lx %02x:%02x %lu "
static inline void read_maps (void) static inline void read_maps (void)
{ {
...@@ -650,7 +650,7 @@ static inline void read_maps (void) ...@@ -650,7 +650,7 @@ static inline void read_maps (void)
char *line; char *line;
char str[5], *cp = str; char str[5], *cp = str;
int flags; int flags;
kdev_t dev; dev_t dev;
unsigned long ino; unsigned long ino;
/* /*
...@@ -675,7 +675,7 @@ static inline void read_maps (void) ...@@ -675,7 +675,7 @@ static inline void read_maps (void)
buffer, PAGE_SIZE); buffer, PAGE_SIZE);
} }
printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT, printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT,
kdevname(dev), ino); MAJOR(dev), MINOR(dev), ino);
if (map->vm_file != NULL) if (map->vm_file != NULL)
printk("%s\n", line); printk("%s\n", line);
else else
......
...@@ -1319,7 +1319,7 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs ...@@ -1319,7 +1319,7 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs
#ifdef DEBUG_SIGNALS_MAPS #ifdef DEBUG_SIGNALS_MAPS
#define MAPS_LINE_FORMAT "%016lx-%016lx %s %016lx %s %lu " #define MAPS_LINE_FORMAT "%016lx-%016lx %s %016lx %02x:%02x %lu "
static inline void read_maps (void) static inline void read_maps (void)
{ {
...@@ -1336,7 +1336,7 @@ static inline void read_maps (void) ...@@ -1336,7 +1336,7 @@ static inline void read_maps (void)
char *line; char *line;
char str[5], *cp = str; char str[5], *cp = str;
int flags; int flags;
kdev_t dev; dev_t dev;
unsigned long ino; unsigned long ino;
/* /*
...@@ -1361,7 +1361,7 @@ static inline void read_maps (void) ...@@ -1361,7 +1361,7 @@ static inline void read_maps (void)
buffer, PAGE_SIZE); buffer, PAGE_SIZE);
} }
printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT, printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT,
kdevname(dev), ino); MAJOR(dev), MINOR(dev), ino);
if (map->vm_file != NULL) if (map->vm_file != NULL)
printk("%s\n", line); printk("%s\n", line);
else else
......
...@@ -299,7 +299,6 @@ struct block_device *bdget(dev_t dev) ...@@ -299,7 +299,6 @@ struct block_device *bdget(dev_t dev)
new_bdev->bd_inode = inode; new_bdev->bd_inode = inode;
inode->i_mode = S_IFBLK; inode->i_mode = S_IFBLK;
inode->i_rdev = kdev; inode->i_rdev = kdev;
inode->i_dev = kdev;
inode->i_bdev = new_bdev; inode->i_bdev = new_bdev;
inode->i_data.a_ops = &def_blk_aops; inode->i_data.a_ops = &def_blk_aops;
inode->i_data.gfp_mask = GFP_USER; inode->i_data.gfp_mask = GFP_USER;
......
...@@ -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 = to_kdev_t(sb->s_dev); 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);
......
...@@ -1751,9 +1751,12 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx) ...@@ -1751,9 +1751,12 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx)
? (fl->fl_type & F_UNLCK) ? "UNLCK" : "READ " ? (fl->fl_type & F_UNLCK) ? "UNLCK" : "READ "
: (fl->fl_type & F_WRLCK) ? "WRITE" : "READ "); : (fl->fl_type & F_WRLCK) ? "WRITE" : "READ ");
} }
/*
* NOTE: it should be inode->i_sb->s_id, not kdevname(...).
*/
out += sprintf(out, "%d %s:%ld ", out += sprintf(out, "%d %s:%ld ",
fl->fl_pid, fl->fl_pid,
inode ? kdevname(inode->i_dev) : "<none>", inode ? kdevname(to_kdev_t(inode->i_dev)) : "<none>",
inode ? inode->i_ino : 0); inode ? inode->i_ino : 0);
out += sprintf(out, "%Ld ", fl->fl_start); out += sprintf(out, "%Ld ", fl->fl_start);
if (fl->fl_end == OFFSET_MAX) if (fl->fl_end == OFFSET_MAX)
......
...@@ -219,7 +219,7 @@ encode_saved_post_attr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp) ...@@ -219,7 +219,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) kdev_t_to_nr(inode->i_dev)); p = xdr_encode_hyper(p, (u64) inode->i_dev);
p = xdr_encode_hyper(p, (u64) inode->i_ino); p = xdr_encode_hyper(p, (u64) inode->i_ino);
p = encode_time3(p, fhp->fh_post_atime); p = encode_time3(p, fhp->fh_post_atime);
p = encode_time3(p, fhp->fh_post_mtime); p = encode_time3(p, fhp->fh_post_mtime);
......
...@@ -66,7 +66,7 @@ struct raparms { ...@@ -66,7 +66,7 @@ struct raparms {
struct raparms *p_next; struct raparms *p_next;
unsigned int p_count; unsigned int p_count;
ino_t p_ino; ino_t p_ino;
kdev_t p_dev; dev_t p_dev;
struct file_ra_state p_ra; struct file_ra_state p_ra;
}; };
...@@ -527,14 +527,14 @@ nfsd_sync_dir(struct dentry *dp) ...@@ -527,14 +527,14 @@ nfsd_sync_dir(struct dentry *dp)
static spinlock_t ra_lock = SPIN_LOCK_UNLOCKED; static spinlock_t ra_lock = SPIN_LOCK_UNLOCKED;
static inline struct raparms * static inline struct raparms *
nfsd_get_raparms(kdev_t dev, ino_t ino) nfsd_get_raparms(dev_t dev, ino_t ino)
{ {
struct raparms *ra, **rap, **frap = NULL; struct raparms *ra, **rap, **frap = NULL;
int depth = 0; int depth = 0;
spin_lock(&ra_lock); spin_lock(&ra_lock);
for (rap = &raparm_cache; (ra = *rap); rap = &ra->p_next) { for (rap = &raparm_cache; (ra = *rap); rap = &ra->p_next) {
if (ra->p_ino == ino && kdev_same(ra->p_dev, dev)) if (ra->p_ino == ino && ra->p_dev == dev)
goto found; goto found;
depth++; depth++;
if (ra->p_count == 0) if (ra->p_count == 0)
...@@ -691,8 +691,8 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -691,8 +691,8 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
} }
if (err >= 0 && stable) { if (err >= 0 && stable) {
static unsigned long last_ino; static ino_t last_ino;
static kdev_t last_dev = NODEV; static dev_t last_dev = 0;
/* /*
* Gathered writes: If another process is currently * Gathered writes: If another process is currently
...@@ -708,7 +708,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -708,7 +708,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 && kdev_same(last_dev, inode->i_dev))) { || (last_ino == inode->i_ino && last_dev == inode->i_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);
......
...@@ -538,11 +538,11 @@ int proc_pid_statm(struct task_struct *task, char * buffer) ...@@ -538,11 +538,11 @@ int proc_pid_statm(struct task_struct *task, char * buffer)
* + (index into the line) * + (index into the line)
*/ */
/* for systems with sizeof(void*) == 4: */ /* for systems with sizeof(void*) == 4: */
#define MAPS_LINE_FORMAT4 "%08lx-%08lx %s %08lx %s %lu" #define MAPS_LINE_FORMAT4 "%08lx-%08lx %s %08lx %02x:%02x %lu"
#define MAPS_LINE_MAX4 49 /* sum of 8 1 8 1 4 1 8 1 5 1 10 1 */ #define MAPS_LINE_MAX4 49 /* sum of 8 1 8 1 4 1 8 1 5 1 10 1 */
/* for systems with sizeof(void*) == 8: */ /* for systems with sizeof(void*) == 8: */
#define MAPS_LINE_FORMAT8 "%016lx-%016lx %s %016lx %s %lu" #define MAPS_LINE_FORMAT8 "%016lx-%016lx %s %016lx %02x:%02x %lu"
#define MAPS_LINE_MAX8 73 /* sum of 16 1 16 1 4 1 16 1 5 1 10 1 */ #define MAPS_LINE_MAX8 73 /* sum of 16 1 16 1 4 1 16 1 5 1 10 1 */
#define MAPS_LINE_FORMAT (sizeof(void*) == 4 ? MAPS_LINE_FORMAT4 : MAPS_LINE_FORMAT8) #define MAPS_LINE_FORMAT (sizeof(void*) == 4 ? MAPS_LINE_FORMAT4 : MAPS_LINE_FORMAT8)
...@@ -554,7 +554,7 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map) ...@@ -554,7 +554,7 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map)
char *line; char *line;
char str[5]; char str[5];
int flags; int flags;
kdev_t dev; dev_t dev;
unsigned long ino; unsigned long ino;
int len; int len;
...@@ -566,7 +566,7 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map) ...@@ -566,7 +566,7 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map)
str[3] = flags & VM_MAYSHARE ? 's' : 'p'; str[3] = flags & VM_MAYSHARE ? 's' : 'p';
str[4] = 0; str[4] = 0;
dev = NODEV; 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; dev = map->vm_file->f_dentry->d_inode->i_dev;
...@@ -584,7 +584,7 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map) ...@@ -584,7 +584,7 @@ static int proc_pid_maps_get_line (char *buf, struct vm_area_struct *map)
len = sprintf(line, len = sprintf(line,
MAPS_LINE_FORMAT, MAPS_LINE_FORMAT,
map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT, map->vm_start, map->vm_end, str, map->vm_pgoff << PAGE_SHIFT,
kdevname(dev), ino); MAJOR(dev), MINOR(dev), ino);
if(map->vm_file) { if(map->vm_file) {
int i; int i;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
void generic_fillattr(struct inode *inode, struct kstat *stat) void generic_fillattr(struct inode *inode, struct kstat *stat)
{ {
stat->dev = kdev_t_to_nr(inode->i_dev); stat->dev = inode->i_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;
......
...@@ -359,7 +359,7 @@ struct inode { ...@@ -359,7 +359,7 @@ 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;
kdev_t i_dev; dev_t i_dev;
umode_t i_mode; umode_t i_mode;
nlink_t i_nlink; nlink_t i_nlink;
uid_t i_uid; uid_t i_uid;
......
...@@ -36,8 +36,7 @@ typedef struct { unsigned short major, minor; } kdev_t; ...@@ -36,8 +36,7 @@ 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 inode->i_dev, inode->i_rdev, req->rq_dev, de->dc_dev, - storing it in inode->i_rdev, 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
......
...@@ -465,7 +465,7 @@ struct socket *sock_alloc(void) ...@@ -465,7 +465,7 @@ struct socket *sock_alloc(void)
if (!inode) if (!inode)
return NULL; return NULL;
inode->i_dev = NODEV; 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