]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ->i_dev switched to dev_t
authorAlexander Viro <viro@math.psu.edu>
Thu, 4 Jul 2002 15:54:08 +0000 (08:54 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 4 Jul 2002 15:54:08 +0000 (08:54 -0700)
* ->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.)

13 files changed:
arch/sparc/kernel/signal.c
arch/sparc64/kernel/signal.c
arch/sparc64/kernel/signal32.c
fs/block_dev.c
fs/inode.c
fs/locks.c
fs/nfsd/nfs3xdr.c
fs/nfsd/vfs.c
fs/proc/array.c
fs/stat.c
include/linux/fs.h
include/linux/kdev_t.h
net/socket.c

index 743a2eed2cd56d5d6eaa9e77b1d806a5aa04ab20..7dfb666b685a0a126dd21d79608b262130a5abb7 100644 (file)
@@ -1090,7 +1090,7 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
 
 #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)
 {
@@ -1107,7 +1107,7 @@ static inline void read_maps (void)
                char *line;
                char str[5], *cp = str;
                int flags;
-               kdev_t dev;
+               dev_t dev;
                unsigned long ino;
 
                /*
@@ -1132,7 +1132,7 @@ static inline void read_maps (void)
                                      buffer, PAGE_SIZE);
                }
                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)
                        printk("%s\n", line);
                else
index 3edaef15cc9e3f8768a81c5a123054eae10a96d8..9cc20dc19033b0101f6a8557ef1bdd1048145490 100644 (file)
@@ -633,7 +633,7 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
 
 #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)
 {
@@ -650,7 +650,7 @@ static inline void read_maps (void)
                char *line;
                char str[5], *cp = str;
                int flags;
-               kdev_t dev;
+               dev_t dev;
                unsigned long ino;
 
                /*
@@ -675,7 +675,7 @@ static inline void read_maps (void)
                                      buffer, PAGE_SIZE);
                }
                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)
                        printk("%s\n", line);
                else
index 4a49af3a33bade94961c374e306c8d33916a8875..47246310aa15f14c519f6b9dcb2075786dcdc772 100644 (file)
@@ -1319,7 +1319,7 @@ static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs
 
 #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)
 {
@@ -1336,7 +1336,7 @@ static inline void read_maps (void)
                char *line;
                char str[5], *cp = str;
                int flags;
-               kdev_t dev;
+               dev_t dev;
                unsigned long ino;
 
                /*
@@ -1361,7 +1361,7 @@ static inline void read_maps (void)
                                      buffer, PAGE_SIZE);
                }
                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)
                        printk("%s\n", line);
                else
index 34f88ef66b0f232378622eec88962e53957885c3..3ee4d14491bc03d30af3fe062f00645e84b817cc 100644 (file)
@@ -299,7 +299,6 @@ struct block_device *bdget(dev_t dev)
                        new_bdev->bd_inode = inode;
                        inode->i_mode = S_IFBLK;
                        inode->i_rdev = kdev;
-                       inode->i_dev = kdev;
                        inode->i_bdev = new_bdev;
                        inode->i_data.a_ops = &def_blk_aops;
                        inode->i_data.gfp_mask = GFP_USER;
index a3b2cd4e8a3c27f00615b59a36ba6253dd8b6e70..d0e6bda9772a0ef5d014d81d734ac2e9669a1834 100644 (file)
@@ -101,7 +101,7 @@ static struct inode *alloc_inode(struct super_block *sb)
                struct address_space * const mapping = &inode->i_data;
 
                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_flags = 0;
                atomic_set(&inode->i_count, 1);
index 1e58f91263c5017a3b2f83b87925a8e5f38ef10a..bb32d15163434a0f4bd87e89bcdc9a9bcf303554 100644 (file)
@@ -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_WRLCK) ? "WRITE" : "READ ");
        }
+       /*
+        *      NOTE: it should be inode->i_sb->s_id, not kdevname(...).
+        */
        out += sprintf(out, "%d %s:%ld ",
                     fl->fl_pid,
-                    inode ? kdevname(inode->i_dev) : "<none>",
+                    inode ? kdevname(to_kdev_t(inode->i_dev)) : "<none>",
                     inode ? inode->i_ino : 0);
        out += sprintf(out, "%Ld ", fl->fl_start);
        if (fl->fl_end == OFFSET_MAX)
index 89d1f99ef77cf0de828d6f69c73b23b73bdd2ba2..71279e639ba333b6e55bc75d5dfcc6eb722e932e 100644 (file)
@@ -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))
                p = xdr_encode_hyper(p, (u64) fhp->fh_export->ex_fsid);
        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 = encode_time3(p, fhp->fh_post_atime);
        p = encode_time3(p, fhp->fh_post_mtime);
index 02419edd0250b07658efcf3c44bb19c4372a9439..56cd76ef5c5751138a039f2c8d4cfc3614deb16c 100644 (file)
@@ -66,7 +66,7 @@ struct raparms {
        struct raparms          *p_next;
        unsigned int            p_count;
        ino_t                   p_ino;
-       kdev_t                  p_dev;
+       dev_t                   p_dev;
        struct file_ra_state    p_ra;
 };
 
@@ -527,14 +527,14 @@ nfsd_sync_dir(struct dentry *dp)
 static spinlock_t ra_lock = SPIN_LOCK_UNLOCKED;
 
 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;
        int depth = 0;
 
        spin_lock(&ra_lock);
        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;
                depth++;
                if (ra->p_count == 0)
@@ -691,8 +691,8 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
        }
 
        if (err >= 0 && stable) {
-               static unsigned long    last_ino;
-               static kdev_t           last_dev = NODEV;
+               static ino_t    last_ino;
+               static dev_t    last_dev = 0;
 
                /*
                 * Gathered writes: If another process is currently
@@ -708,7 +708,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 && 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);
                                set_current_state(TASK_UNINTERRUPTIBLE);
                                schedule_timeout((HZ+99)/100);
index ff74e5098ea70a93a84ea8a83970e2ddf6e683d2..218e20e62701a70dee961d2fa49c0916c44ae6ac 100644 (file)
@@ -538,11 +538,11 @@ int proc_pid_statm(struct task_struct *task, char * buffer)
  *         + (index into the line)
  */
 /* 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 */
 
 /* 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_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)
        char *line;
        char str[5];
        int flags;
-       kdev_t dev;
+       dev_t dev;
        unsigned long ino;
        int len;
 
@@ -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[4] = 0;
 
-       dev = NODEV;
+       dev = 0;
        ino = 0;
        if (map->vm_file != NULL) {
                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)
        len = sprintf(line,
                      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) {
                int i;
index 3f87e0e823ecd96865c327c255d03f9ea550e0b3..bce88512b2b54c50fde65c2770e45e8294cde4ab 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -17,7 +17,7 @@
 
 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->mode = inode->i_mode;
        stat->nlink = inode->i_nlink;
index 1292fc4474ccbb899ed0e2403dc4e3dc2163188b..647d2e20ce525e5feb6b42f9eab3dc82c1150b3c 100644 (file)
@@ -359,7 +359,7 @@ struct inode {
        struct list_head        i_dentry;
        unsigned long           i_ino;
        atomic_t                i_count;
-       kdev_t                  i_dev;
+       dev_t                   i_dev;
        umode_t                 i_mode;
        nlink_t                 i_nlink;
        uid_t                   i_uid;
index 2c61fc5161b606d4a02947d0ea122edb88688fb1..1721915141c7a4f33022b8bd9ab76e46ca17e4fa 100644 (file)
@@ -36,8 +36,7 @@ typedef struct { unsigned short major, minor; } kdev_t;
 Admissible operations on an object of type kdev_t:
 - passing it along
 - comparing it for equality with another such object
-- storing it in inode->i_dev, inode->i_rdev, req->rq_dev, de->dc_dev,
-- tty->device
+- storing it in inode->i_rdev, req->rq_dev, de->dc_dev, tty->device
 - using its bit pattern as argument in a hash function
 - finding its major and minor
 - complaining about it
index bed470afb5edb0a65f5eea51945b263dd342b5a1..798eeab2f47c0139416cfe6408911bede0f6a4a9 100644 (file)
@@ -465,7 +465,7 @@ struct socket *sock_alloc(void)
        if (!inode)
                return NULL;
 
-       inode->i_dev = NODEV;
+       inode->i_dev = 0;
        sock = SOCKET_I(inode);
 
        inode->i_mode = S_IFSOCK|S_IRWXUGO;