From: Lionel Sambuc Date: Fri, 15 Nov 2013 18:01:25 +0000 (+0100) Subject: Aligning dev_t to 64bits. X-Git-Tag: v3.3.0~502 X-Git-Url: http://zhaoyanbai.com/repos/%22../static/icons/zlib_tech.html?a=commitdiff_plain;h=37598dccf1e3f0e15db3b0a4a182c345ed474ae8;p=minix.git Aligning dev_t to 64bits. Change-Id: I630f72f8530dd4aaf05c35ca23683ae12c9f8328 --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index a2243d3b3..40459736d 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -353,7 +353,7 @@ #define VFS_MKNOD_NAME m1_p1 /* const char * */ #define VFS_MKNOD_LEN m1_i1 /* size_t */ #define VFS_MKNOD_MODE m1_i2 /* mode_t */ -#define VFS_MKNOD_DEV m1_i3 /* dev_t */ +#define VFS_MKNOD_DEV m1_ull1 /* dev_t */ /* Field names for the open(2), chdir(2), chmod(2), chroot(2), rmdir(2), and * unlink(2) calls. diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 41076375e..4fa5bbf21 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -17,9 +17,10 @@ #define M3_LONG_STRING 44 /* current m3_ca1 size (may be increased) */ typedef struct { + uint64_t m1ull1; int m1i1, m1i2, m1i3; char *m1p1, *m1p2, *m1p3, *m1p4; - uint8_t padding[28]; + uint8_t padding[20]; } mess_1; _ASSERT_MSG_SIZE(mess_1); @@ -28,7 +29,7 @@ typedef struct { long m2l1, m2l2; char *m2p1; sigset_t sigset; - short m2s1; + short m2s1; uint8_t padding[14]; } mess_2; _ASSERT_MSG_SIZE(mess_2); @@ -89,9 +90,10 @@ typedef struct { _ASSERT_MSG_SIZE(mess_8); typedef struct { + uint64_t m9ull1; long m9l1, m9l2, m9l3, m9l4, m9l5; short m9s1, m9s2, m9s3, m9s4; - uint8_t padding[28]; + uint8_t padding[20]; } mess_9; _ASSERT_MSG_SIZE(mess_9); @@ -111,15 +113,15 @@ typedef struct { _ASSERT_MSG_SIZE(mess_11); typedef struct { + dev_t dev; /* 64bits long. */ void *block; u32_t dev_offset_pages; u32_t ino_offset_pages; u32_t ino; u32_t *flags_ptr; - u32_t dev; u8_t pages; u8_t flags; - uint8_t padding[30]; + uint8_t padding[26]; } mess_vmmcp; _ASSERT_MSG_SIZE(mess_vmmcp); @@ -134,13 +136,13 @@ _ASSERT_MSG_SIZE(mess_notify); typedef struct { endpoint_t who; u32_t offset; - u32_t dev; + dev_t dev; u32_t ino; u32_t vaddr; u32_t len; u16_t fd; u16_t clearend_and_flags; /* low 12 bits are clearend, rest flags */ - uint8_t padding[28]; + uint8_t padding[24]; } mess_vm_vfs_mmap; _ASSERT_MSG_SIZE(mess_vm_vfs_mmap); @@ -186,6 +188,7 @@ typedef int _ASSERT_message[/* CONSTCOND */sizeof(message) == 64 ?1 : -1]; #define m1_p2 m_u.m_m1.m1p2 #define m1_p3 m_u.m_m1.m1p3 #define m1_p4 m_u.m_m1.m1p4 +#define m1_ull1 m_u.m_m1.m1ull1 #define m2_i1 m_u.m_m2.m2i1 #define m2_i2 m_u.m_m2.m2i2 @@ -251,6 +254,7 @@ typedef int _ASSERT_message[/* CONSTCOND */sizeof(message) == 64 ?1 : -1]; #define m9_s2 m_u.m_m9.m9s2 #define m9_s3 m_u.m_m9.m9s3 #define m9_s4 m_u.m_m9.m9s4 +#define m9_ull1 m_u.m_m9.m9ull1 #define m10_i1 m_u.m_m10.m10i1 #define m10_i2 m_u.m_m10.m10i2 diff --git a/include/minix/rs.h b/include/minix/rs.h index 6a499f55c..f5f8621d6 100644 --- a/include/minix/rs.h +++ b/include/minix/rs.h @@ -118,7 +118,7 @@ struct rprocpub { unsigned sys_flags; /* sys flags */ endpoint_t endpoint; /* process endpoint number */ - dev_t dev_nr; /* major device number or NO_DEV */ + devmajor_t dev_nr; /* major device number or NO_DEV */ char label[RS_MAX_LABEL_LEN]; /* label of this service */ char proc_name[RS_MAX_LABEL_LEN]; /* process name of this service */ diff --git a/include/minix/vfsif.h b/include/minix/vfsif.h index 7e2f0aead..e12837676 100644 --- a/include/minix/vfsif.h +++ b/include/minix/vfsif.h @@ -8,8 +8,7 @@ #define REQ_ACTIME m9_l2 #define REQ_ACNSEC m9_l4 #define REQ_COUNT m9_l2 -#define REQ_DEV m9_l5 -#define REQ_DEV2 m9_l1 +#define REQ_DEV m9_ull1 #define REQ_DIR_INO m9_l3 #define REQ_FLAGS m9_s3 #define REQ_GID m9_s1 @@ -41,7 +40,7 @@ #define REQ_UID m9_s4 /* VFS/FS reply fields */ -#define RES_DEV m9_l4 +#define RES_DEV m9_ull1 #define RES_GID m9_s1 #define RES_INODE_NR m9_l1 #define RES_FILE_SIZE_HI m9_l2 diff --git a/include/minix/vm.h b/include/minix/vm.h index 63bca2b81..b86b365b9 100644 --- a/include/minix/vm.h +++ b/include/minix/vm.h @@ -24,7 +24,7 @@ int vm_watch_exit(endpoint_t ep); int vm_forgetblock(u64_t id); void vm_forgetblocks(void); int minix_vfs_mmap(endpoint_t who, u32_t offset, u32_t len, - u32_t dev, u32_t ino, u16_t fd, u32_t vaddr, u16_t clearend, u16_t + dev_t dev, u32_t ino, u16_t fd, u32_t vaddr, u16_t clearend, u16_t flags); /* minix vfs mmap flags */ @@ -65,13 +65,13 @@ int vm_info_region(endpoint_t who, struct vm_region_info *vri, int count, vir_bytes *next); int vm_procctl(endpoint_t ep, int param); -int vm_set_cacheblock(void *block, u32_t dev, u64_t dev_offset, +int vm_set_cacheblock(void *block, dev_t dev, u64_t dev_offset, u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize); -void *vm_map_cacheblock(u32_t dev, u64_t dev_offset, +void *vm_map_cacheblock(dev_t dev, u64_t dev_offset, u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize); -int vm_clear_cache(u32_t dev); +int vm_clear_cache(dev_t dev); /* flags for vm cache functions */ #define VMMC_FLAGS_LOCKED 0x01 /* someone is updating the flags; don't read/write */ diff --git a/lib/libc/sys-minix/mmap.c b/lib/libc/sys-minix/mmap.c index bdf97ff84..e694f67ff 100644 --- a/lib/libc/sys-minix/mmap.c +++ b/lib/libc/sys-minix/mmap.c @@ -53,7 +53,7 @@ void *minix_mmap_for(endpoint_t forwhom, } int minix_vfs_mmap(endpoint_t who, u32_t offset, u32_t len, - u32_t dev, u32_t ino, u16_t fd, u32_t vaddr, u16_t clearend, + dev_t dev, u32_t ino, u16_t fd, u32_t vaddr, u16_t clearend, u16_t flags) { message m; diff --git a/lib/libminixfs/cache.c b/lib/libminixfs/cache.c index 1968918ed..6e16ce19e 100644 --- a/lib/libminixfs/cache.c +++ b/lib/libminixfs/cache.c @@ -479,7 +479,7 @@ int block_type; /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */ printf("libminixfs: ENOSYS, disabling VM calls\n"); vmcache = 0; } else { - panic("libminixfs: setblock of %p dev 0x%x off " + panic("libminixfs: setblock of %p dev 0x%llx off " "0x%llx failed\n", bp->data, dev, dev_off); } } @@ -940,7 +940,7 @@ int lmfs_rdwt_err(void) int lmfs_do_bpeek(message *m) { block_t startblock, b, limitblock; - dev_t dev = m->REQ_DEV2; + dev_t dev = m->REQ_DEV; u64_t extra, pos = make64(m->REQ_SEEK_POS_LO, m->REQ_SEEK_POS_HI); size_t len = m->REQ_NBYTES; struct buf *bp; diff --git a/lib/libpuffs/misc.c b/lib/libpuffs/misc.c index 4de047ee7..e5886ebcb 100644 --- a/lib/libpuffs/misc.c +++ b/lib/libpuffs/misc.c @@ -41,7 +41,7 @@ int fs_flush() * to disk. */ #if 0 - dev_t dev = (dev_t) fs_m_in.REQ_DEV; + dev_t dev = fs_m_in.REQ_DEV; if(dev == fs_dev) return(EBUSY); diff --git a/lib/libpuffs/open.c b/lib/libpuffs/open.c index f1f7c2508..8888259f4 100644 --- a/lib/libpuffs/open.c +++ b/lib/libpuffs/open.c @@ -161,7 +161,7 @@ int fs_mknod() va.va_mode = (mode_t) fs_m_in.REQ_MODE; va.va_uid = caller_uid; va.va_gid = caller_gid; - va.va_rdev = (dev_t) fs_m_in.REQ_DEV; + va.va_rdev = fs_m_in.REQ_DEV; va.va_atime = va.va_mtime = va.va_ctime = cur_time; if (buildpath) { diff --git a/lib/libsffs/mount.c b/lib/libsffs/mount.c index a2212d0ba..2ed02d191 100644 --- a/lib/libsffs/mount.c +++ b/lib/libsffs/mount.c @@ -23,7 +23,7 @@ int do_readsuper() int r; dprintf(("%s: readsuper (dev %x, flags %x)\n", - sffs_name, (dev_t) m_in.REQ_DEV, m_in.REQ_FLAGS)); + sffs_name, m_in.REQ_DEV, m_in.REQ_FLAGS)); if (m_in.REQ_FLAGS & REQ_ISROOT) { printf("%s: attempt to mount as root device\n", sffs_name); diff --git a/lib/libsys/vm_cache.c b/lib/libsys/vm_cache.c index 171ba39c8..f4ee89829 100644 --- a/lib/libsys/vm_cache.c +++ b/lib/libsys/vm_cache.c @@ -9,7 +9,7 @@ #include #include -int vm_cachecall(message *m, int call, void *addr, u32_t dev, u64_t dev_offset, +int vm_cachecall(message *m, int call, void *addr, dev_t dev, u64_t dev_offset, u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize) { if(blocksize % PAGE_SIZE) @@ -40,7 +40,7 @@ int vm_cachecall(message *m, int call, void *addr, u32_t dev, u64_t dev_offset, return _taskcall(VM_PROC_NR, call, m); } -void *vm_map_cacheblock(u32_t dev, u64_t dev_offset, +void *vm_map_cacheblock(dev_t dev, u64_t dev_offset, u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize) { message m; @@ -52,7 +52,7 @@ void *vm_map_cacheblock(u32_t dev, u64_t dev_offset, return m.m_u.m_vmmcp_reply.addr; } -int vm_set_cacheblock(void *block, u32_t dev, u64_t dev_offset, +int vm_set_cacheblock(void *block, dev_t dev, u64_t dev_offset, u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize) { message m; @@ -62,7 +62,7 @@ int vm_set_cacheblock(void *block, u32_t dev, u64_t dev_offset, } int -vm_clear_cache(u32_t dev) +vm_clear_cache(dev_t dev) { message m; diff --git a/servers/ext2/inode.c b/servers/ext2/inode.c index 9f97359eb..0fdc3f38e 100644 --- a/servers/ext2/inode.c +++ b/servers/ext2/inode.c @@ -41,7 +41,7 @@ int fs_putnode(void) rip = find_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR); if (!rip) { - printf("%s:%d put_inode: inode #%u dev: %d not found\n", __FILE__, + printf("%s:%d put_inode: inode #%u dev: %llx not found\n", __FILE__, __LINE__, (pino_t) fs_m_in.REQ_INODE_NR, fs_dev); panic("fs_putnode failed"); } diff --git a/servers/ext2/misc.c b/servers/ext2/misc.c index f0127889d..6902df25a 100644 --- a/servers/ext2/misc.c +++ b/servers/ext2/misc.c @@ -49,7 +49,7 @@ int fs_flush() /* Flush the blocks of a device from the cache after writing any dirty blocks * to disk. */ - dev_t dev = (dev_t) fs_m_in.REQ_DEV; + dev_t dev = fs_m_in.REQ_DEV; if(dev == fs_dev) return(EBUSY); @@ -71,7 +71,7 @@ int fs_new_driver(void) char label[sizeof(fs_dev_label)]; int r; - dev = (dev_t) fs_m_in.REQ_DEV; + dev = fs_m_in.REQ_DEV; label_gid = (cp_grant_id_t) fs_m_in.REQ_GRANT; label_len = (size_t) fs_m_in.REQ_PATH_LEN; diff --git a/servers/ext2/read.c b/servers/ext2/read.c index b8c9a424f..b4c505d38 100644 --- a/servers/ext2/read.c +++ b/servers/ext2/read.c @@ -164,9 +164,9 @@ int fs_breadwrite(void) (unsigned long) fs_m_in.REQ_SEEK_POS_HI); nrbytes = (size_t) fs_m_in.REQ_NBYTES; - block_size = get_block_size( (dev_t) fs_m_in.REQ_DEV2); + block_size = get_block_size(fs_m_in.REQ_DEV); - rip.i_block[0] = (block_t) fs_m_in.REQ_DEV2; + rip.i_block[0] = (block_t) fs_m_in.REQ_DEV; rip.i_mode = I_BLOCK_SPECIAL; rip.i_size = 0; diff --git a/servers/ext2/stadir.c b/servers/ext2/stadir.c index cc08c872f..f99d54efb 100644 --- a/servers/ext2/stadir.c +++ b/servers/ext2/stadir.c @@ -43,7 +43,7 @@ static int stat_inode( statbuf.st_nlink = rip->i_links_count; statbuf.st_uid = rip->i_uid; statbuf.st_gid = rip->i_gid; - statbuf.st_rdev = (s ? rip->i_block[0] : NO_DEV); + statbuf.st_rdev = (s ? (dev_t)rip->i_block[0] : NO_DEV); statbuf.st_size = rip->i_size; statbuf.st_atime = rip->i_atime; statbuf.st_mtime = rip->i_mtime; diff --git a/servers/iso9660fs/misc.c b/servers/iso9660fs/misc.c index 7c7c9eb91..456f20157 100644 --- a/servers/iso9660fs/misc.c +++ b/servers/iso9660fs/misc.c @@ -26,7 +26,7 @@ int fs_new_driver(void) char label[sizeof(fs_dev_label)]; int r; - dev = (dev_t) fs_m_in.REQ_DEV; + dev = fs_m_in.REQ_DEV; label_gid = (cp_grant_id_t) fs_m_in.REQ_GRANT; label_len = (size_t) fs_m_in.REQ_PATH_LEN; diff --git a/servers/lwip/inet_config.c b/servers/lwip/inet_config.c index d4ec68f10..1f7009f45 100644 --- a/servers/lwip/inet_config.c +++ b/servers/lwip/inet_config.c @@ -56,11 +56,11 @@ static void check_mknod(const char *device, mode_t mode, int minor) { dev_t dev; - dev= (ip_dev & 0xFF00) | minor; + dev= makedev(major(ip_dev), minor); unlink(device); if (mknod(device, S_IFCHR | mode, dev) < 0) fatal(device); - printf("mknod %s c %d %d\n", device, (ip_dev >> 8), minor); + printf("mknod %s c %d %d\n", device, major(ip_dev), minor); } static int cfg_fd; diff --git a/servers/mfs/inode.c b/servers/mfs/inode.c index d18fc8bfb..ce529a1e0 100644 --- a/servers/mfs/inode.c +++ b/servers/mfs/inode.c @@ -45,7 +45,7 @@ int fs_putnode(void) rip = find_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR); if(!rip) { - printf("%s:%d put_inode: inode #%u dev: %d not found\n", __FILE__, + printf("%s:%d put_inode: inode #%u dev: %llx not found\n", __FILE__, __LINE__, (pino_t) fs_m_in.REQ_INODE_NR, fs_dev); panic("fs_putnode failed"); } diff --git a/servers/mfs/misc.c b/servers/mfs/misc.c index 036d84cda..6b0a79d6d 100644 --- a/servers/mfs/misc.c +++ b/servers/mfs/misc.c @@ -38,7 +38,7 @@ int fs_flush() /* Flush the blocks of a device from the cache after writing any dirty blocks * to disk. */ - dev_t dev = (dev_t) fs_m_in.REQ_DEV; + dev_t dev = fs_m_in.REQ_DEV; if(dev == fs_dev) return(EBUSY); lmfs_flushall(); @@ -60,7 +60,7 @@ int fs_new_driver(void) char label[sizeof(fs_dev_label)]; int r; - dev = (dev_t) fs_m_in.REQ_DEV; + dev = fs_m_in.REQ_DEV; label_gid = (cp_grant_id_t) fs_m_in.REQ_GRANT; label_len = (size_t) fs_m_in.REQ_PATH_LEN; diff --git a/servers/mfs/mount.c b/servers/mfs/mount.c index efdcb299b..d4510bb06 100644 --- a/servers/mfs/mount.c +++ b/servers/mfs/mount.c @@ -24,7 +24,7 @@ int fs_readsuper() int r; int readonly, isroot; - fs_dev = (dev_t) fs_m_in.REQ_DEV; + fs_dev = fs_m_in.REQ_DEV; label_gid = (cp_grant_id_t) fs_m_in.REQ_GRANT; label_len = (size_t) fs_m_in.REQ_PATH_LEN; readonly = (fs_m_in.REQ_FLAGS & REQ_RDONLY) ? 1 : 0; @@ -76,7 +76,7 @@ int fs_readsuper() panic("couldn't bdev_open after found unclean FS"); return(EINVAL); } - printf("MFS: WARNING: FS 0x%x unclean, mounting readonly\n", fs_dev); + printf("MFS: WARNING: FS 0x%llx unclean, mounting readonly\n", fs_dev); } lmfs_set_blocksize(superblock.s_block_size, major(fs_dev)); diff --git a/servers/mfs/read.c b/servers/mfs/read.c index 44c383254..c199b9803 100644 --- a/servers/mfs/read.c +++ b/servers/mfs/read.c @@ -160,7 +160,7 @@ int fs_breadwrite(void) r = OK; - target_dev = (dev_t) fs_m_in.REQ_DEV2; + target_dev = fs_m_in.REQ_DEV; /* Get the values from the request message */ rw_flag = (fs_m_in.m_type == REQ_BREAD ? READING : WRITING); diff --git a/servers/mfs/stadir.c b/servers/mfs/stadir.c index 6b21d2952..a5da2ea57 100644 --- a/servers/mfs/stadir.c +++ b/servers/mfs/stadir.c @@ -70,7 +70,7 @@ static int stat_inode( statbuf.st_nlink = (nlink_t) rip->i_nlinks; statbuf.st_uid = rip->i_uid; statbuf.st_gid = rip->i_gid; - statbuf.st_rdev = (s ? (dev_t) rip->i_zone[0] : NO_DEV); + statbuf.st_rdev = (s ? (dev_t)rip->i_zone[0] : NO_DEV); statbuf.st_size = rip->i_size; statbuf.st_atime = rip->i_atime; statbuf.st_mtime = rip->i_mtime; diff --git a/servers/pfs/inode.c b/servers/pfs/inode.c index e81cad202..6d1b3d2f4 100644 --- a/servers/pfs/inode.c +++ b/servers/pfs/inode.c @@ -38,8 +38,8 @@ int fs_putnode(message *fs_m_in, message *fs_m_out) rip = find_inode( (pino_t) fs_m_in->REQ_INODE_NR); if(!rip) { - printf("%s:%d put_inode: inode #%ld dev: %d not found\n", __FILE__, - __LINE__, fs_m_in->REQ_INODE_NR, (dev_t) fs_m_in->REQ_DEV); + printf("%s:%d put_inode: inode #%ld dev: %llx not found\n", __FILE__, + __LINE__, fs_m_in->REQ_INODE_NR, fs_m_in->REQ_DEV); panic("fs_putnode failed"); } diff --git a/servers/pfs/open.c b/servers/pfs/open.c index b7fc0a57f..4d8d202c3 100644 --- a/servers/pfs/open.c +++ b/servers/pfs/open.c @@ -20,7 +20,7 @@ int fs_newnode(message *fs_m_in, message *fs_m_out) uid = (uid_t) fs_m_in->REQ_UID; gid = (gid_t) fs_m_in->REQ_GID; bits = (pmode_t) fs_m_in->REQ_MODE; - dev = (dev_t) fs_m_in->REQ_DEV; + dev = fs_m_in->REQ_DEV; /* Try to allocate the inode */ if( (rip = alloc_inode(dev, bits, uid, gid) ) == NULL) return(err_code); diff --git a/servers/pfs/stadir.c b/servers/pfs/stadir.c index c4bd7727a..e3909fec2 100644 --- a/servers/pfs/stadir.c +++ b/servers/pfs/stadir.c @@ -37,7 +37,7 @@ static int stat_inode( statbuf.st_nlink = rip->i_nlinks; statbuf.st_uid = rip->i_uid; statbuf.st_gid = (short int) rip->i_gid; - statbuf.st_rdev = (dev_t) (s ? rip->i_rdev : NO_DEV); + statbuf.st_rdev = (s ? rip->i_rdev : NO_DEV); statbuf.st_size = rip->i_size; if (!s) statbuf.st_mode &= ~I_REGULAR;/* wipe out I_REGULAR bit for pipes */ statbuf.st_atime = rip->i_atime; diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 13d9435a3..071d4aa1a 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -505,7 +505,7 @@ int do_ioctl(void) } if (r == OK) { - dev = (dev_t) vp->v_sdev; + dev = vp->v_sdev; if (S_ISBLK(vp->v_mode)) { f->filp_ioctl_fp = fp; diff --git a/servers/vfs/dmap.c b/servers/vfs/dmap.c index 4bc5785ff..6a411661c 100644 --- a/servers/vfs/dmap.c +++ b/servers/vfs/dmap.c @@ -58,10 +58,8 @@ void unlock_dmap(struct dmap *dp) /*===========================================================================* * map_driver * *===========================================================================*/ -static int map_driver(label, major, proc_nr_e) -const char label[LABEL_MAX]; /* name of the driver */ -int major; /* major number of the device */ -endpoint_t proc_nr_e; /* process number of the driver */ +static int map_driver(const char label[LABEL_MAX], devmajor_t major, + endpoint_t proc_nr_e) { /* Add a new device driver mapping in the dmap table. If the proc_nr is set to * NONE, we're supposed to unmap it. diff --git a/servers/vfs/filedes.c b/servers/vfs/filedes.c index 81c40557e..0141de922 100644 --- a/servers/vfs/filedes.c +++ b/servers/vfs/filedes.c @@ -361,7 +361,7 @@ struct filp *f; if (f->filp_count - 1 == 0 && f->filp_mode != FILP_CLOSED) { /* Check to see if the file is special. */ if (S_ISCHR(vp->v_mode) || S_ISBLK(vp->v_mode)) { - dev = (dev_t) vp->v_sdev; + dev = vp->v_sdev; if (S_ISBLK(vp->v_mode)) { lock_bsf(); if (vp->v_bfs_e == ROOT_FS_E) { @@ -402,7 +402,7 @@ struct filp *f; f->filp_mode = FILP_CLOSED; f->filp_count = 0; } else if (f->filp_count < 0) { - panic("VFS: invalid filp count: %d ino %d/%llu", f->filp_count, + panic("VFS: invalid filp count: %d ino %llx/%llu", f->filp_count, vp->v_dev, vp->v_inode_nr); } else { unlock_vnode(f->filp_vno); diff --git a/servers/vfs/misc.c b/servers/vfs/misc.c index e02648519..b78bf6a63 100644 --- a/servers/vfs/misc.c +++ b/servers/vfs/misc.c @@ -311,7 +311,7 @@ int dupvm(struct fproc *rfp, int pfd, int *vmfd, struct filp **newfilp) assert(f->filp_vno->v_vmnt); if (!S_ISREG(f->filp_vno->v_mode) && !S_ISBLK(f->filp_vno->v_mode)) { - printf("VFS: mmap regular/blockdev only; dev 0x%x ino %llu has mode 0%o\n", + printf("VFS: mmap regular/blockdev only; dev 0x%llx ino %llu has mode 0%o\n", f->filp_vno->v_dev, f->filp_vno->v_inode_nr, f->filp_vno->v_mode); unlock_filp(f); return EINVAL; @@ -648,7 +648,7 @@ static void free_proc(int flags) if (rfilp->filp_mode == FILP_CLOSED) continue; vp = rfilp->filp_vno; if (!S_ISCHR(vp->v_mode)) continue; - if ((dev_t) vp->v_sdev != dev) continue; + if (vp->v_sdev != dev) continue; lock_filp(rfilp, VNODE_READ); (void) cdev_close(dev); /* Ignore any errors. */ diff --git a/servers/vfs/mount.c b/servers/vfs/mount.c index 6569eb86d..a97d1ea01 100644 --- a/servers/vfs/mount.c +++ b/servers/vfs/mount.c @@ -178,7 +178,7 @@ char mount_label[LABEL_MAX] ) /* Get driver process' endpoint */ dp = &dmap[major(dev)]; if (dp->dmap_driver == NONE) { - printf("VFS: no driver for dev %d\n", dev); + printf("VFS: no driver for dev %llx\n", dev); return(EINVAL); } @@ -466,7 +466,7 @@ int unmount( /* Find vmnt that is to be unmounted */ for (vmp_i = &vmnt[0]; vmp_i < &vmnt[NR_MNTS]; ++vmp_i) { if (vmp_i->m_dev == dev) { - if(vmp) panic("device mounted more than once: %d", dev); + if(vmp) panic("device mounted more than once: %llx", dev); vmp = vmp_i; } } @@ -565,7 +565,7 @@ void unmount_all(int force) /* Verify we succesfully unmounted all file systems */ for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; vmp++) { if (vmp->m_dev != NO_DEV) { - panic("vmp still mounted: %s %d %d\n", vmp->m_label, + panic("vmp still mounted: %s %d %llx\n", vmp->m_label, vmp->m_fs_e, vmp->m_dev); } } diff --git a/servers/vfs/open.c b/servers/vfs/open.c index 23db128b7..641224ebc 100644 --- a/servers/vfs/open.c +++ b/servers/vfs/open.c @@ -159,7 +159,7 @@ int common_open(char path[PATH_MAX], int oflags, mode_t omode) break; case S_IFCHR: /* Invoke the driver for special processing. */ - dev = (dev_t) vp->v_sdev; + dev = vp->v_sdev; /* TTY needs to know about the O_NOCTTY flag. */ r = cdev_open(dev, bits | (oflags & O_NOCTTY)); vp = filp->filp_vno; /* Might be updated by @@ -170,7 +170,7 @@ int common_open(char path[PATH_MAX], int oflags, mode_t omode) lock_bsf(); /* Invoke the driver for special processing. */ - dev = (dev_t) vp->v_sdev; + dev = vp->v_sdev; r = bdev_open(dev, bits); if (r != OK) { unlock_bsf(); diff --git a/servers/vfs/pipe.c b/servers/vfs/pipe.c index ab658d438..ce0909727 100644 --- a/servers/vfs/pipe.c +++ b/servers/vfs/pipe.c @@ -551,7 +551,7 @@ void unpause(void) panic("process %d blocked on empty fd %d", fp->fp_endpoint, fild); } - dev = (dev_t) f->filp_vno->v_sdev; /* device hung on */ + dev = f->filp_vno->v_sdev; /* device hung on */ status = cdev_cancel(dev); diff --git a/servers/vfs/read.c b/servers/vfs/read.c index c3c96d05f..36c91019b 100644 --- a/servers/vfs/read.c +++ b/servers/vfs/read.c @@ -167,12 +167,12 @@ int read_write(struct fproc *rfp, int rw_flag, struct filp *f, if (vp->v_sdev == NO_DEV) panic("VFS: read_write tries to access char dev NO_DEV"); - dev = (dev_t) vp->v_sdev; + dev = vp->v_sdev; r = cdev_io(op, dev, for_e, buf, position, size, f->filp_flags); if (r >= 0) { /* This should no longer happen: all calls are asynchronous. */ - printf("VFS: I/O to device %x succeeded immediately!?\n", dev); + printf("VFS: I/O to device %llx succeeded immediately!?\n", dev); cum_io = r; position += r; r = OK; diff --git a/servers/vfs/request.c b/servers/vfs/request.c index e6a91a780..df0aedf8f 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -50,7 +50,7 @@ int req_breadwrite( /* Fill in request message */ m.m_type = rw_flag == READING ? REQ_BREAD : REQ_BWRITE; - m.REQ_DEV2 = dev; + m.REQ_DEV = dev; m.REQ_GRANT = grant_id; m.REQ_SEEK_POS_LO = ex64lo(pos); m.REQ_SEEK_POS_HI = ex64hi(pos); @@ -79,7 +79,7 @@ int req_bpeek(endpoint_t fs_e, dev_t dev, off_t pos, unsigned int num_of_bytes) /* Fill in request message */ m.m_type = REQ_BPEEK; - m.REQ_DEV2 = dev; + m.REQ_DEV = dev; m.REQ_SEEK_POS_LO = ex64lo(pos); m.REQ_SEEK_POS_HI = ex64hi(pos); m.REQ_NBYTES = num_of_bytes; diff --git a/servers/vfs/select.c b/servers/vfs/select.c index fc8b189d4..537e4d879 100644 --- a/servers/vfs/select.c +++ b/servers/vfs/select.c @@ -805,7 +805,7 @@ int status; /* This should never happen. The driver may be misbehaving. * For now we assume that the reply we want will arrive later.. */ - printf("VFS (%s:%d): expected reply from dev %d not %d\n", + printf("VFS (%s:%d): expected reply from dev %llx not %llx\n", __FILE__, __LINE__, vp->v_sdev, dev); return; } diff --git a/servers/vfs/stadir.c b/servers/vfs/stadir.c index f864dbf27..971fc6830 100644 --- a/servers/vfs/stadir.c +++ b/servers/vfs/stadir.c @@ -276,9 +276,9 @@ static int fill_statvfs(struct vmnt *vmp, endpoint_t endpt, vir_bytes buf_addr, if (vmp->m_flags & VMNT_READONLY) buf.f_flag |= ST_RDONLY; - buf.f_fsid = vmp->m_dev; - buf.f_fsidx.__fsid_val[0] = 0; - buf.f_fsidx.__fsid_val[1] = vmp->m_dev; + buf.f_fsid = (unsigned long)vmp->m_dev; + buf.f_fsidx.__fsid_val[0] = (long)vmp->m_dev; /* This is what is done on NetBSD */ + buf.f_fsidx.__fsid_val[1] = 0; /* Here they convert the FS type name into a number. */ strlcpy(buf.f_fstypename, vmp->m_fstype, sizeof(buf.f_fstypename)); strlcpy(buf.f_mntonname, vmp->m_mount_path, sizeof(buf.f_mntonname)); diff --git a/servers/vfs/vmnt.c b/servers/vfs/vmnt.c index b7e3d6567..7e17d204f 100644 --- a/servers/vfs/vmnt.c +++ b/servers/vfs/vmnt.c @@ -49,7 +49,7 @@ void check_vmnt_locks() for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; vmp++) if (is_vmnt_locked(vmp)) { count++; - printf("vmnt %p is %s, fs_e=%d dev=%d\n", vmp, (tll_islocked(&vmp->m_lock) ? "locked":"pending locked"), vmp->m_fs_e, vmp->m_dev); + printf("vmnt %p is %s, fs_e=%d dev=%llx\n", vmp, (tll_islocked(&vmp->m_lock) ? "locked":"pending locked"), vmp->m_fs_e, vmp->m_dev); } if (count) panic("%d locked vmnts\n", count); diff --git a/sys/sys/types.h b/sys/sys/types.h index 140eebcc1..18c557b24 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -183,9 +183,7 @@ typedef __daddr_t daddr_t; /* disk address */ typedef int64_t daddr_t; /* disk address */ #endif -#if defined(__minix) /* LSC: Wait until bigger message to enlarge the data type. */ -typedef uint32_t dev_t; /* device number */ -#endif /* defined(__minix) */ +typedef uint64_t dev_t; /* device number */ typedef uint32_t fixpt_t; /* fixed point number */ #ifndef gid_t diff --git a/test/blocktest/blocktest.c b/test/blocktest/blocktest.c index 70c49431d..995bd9a39 100644 --- a/test/blocktest/blocktest.c +++ b/test/blocktest/blocktest.c @@ -29,7 +29,7 @@ typedef struct { } result_t; static char driver_label[32] = ""; /* driver DS label */ -static dev_t driver_minor = -1; /* driver's partition minor to use */ +static devminor_t driver_minor = -1; /* driver's partition minor to use */ static endpoint_t driver_endpt; /* driver endpoint */ static int may_write = FALSE; /* may we write to the device? */ diff --git a/test/test72.c b/test/test72.c index 4407fc239..ba48c2170 100644 --- a/test/test72.c +++ b/test/test72.c @@ -252,19 +252,19 @@ u32_t sqrt_approx(u32_t v) return (u32_t) sqrt(v); } -int vm_set_cacheblock(void *block, u32_t dev, u64_t dev_offset, +int vm_set_cacheblock(void *block, dev_t dev, u64_t dev_offset, u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize) { return ENOSYS; } -void *vm_map_cacheblock(u32_t dev, u64_t dev_offset, +void *vm_map_cacheblock(dev_t dev, u64_t dev_offset, u64_t ino, u64_t ino_offset, u32_t *flags, int blocksize) { return MAP_FAILED; } -int vm_clear_cache(u32_t dev) +int vm_clear_cache(dev_t dev) { return 0; }