Commit 6343913a authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (5/14) resync

misc gratitious kdev_t uses fixed (janitorial stuff - e.g. quota
patches had reintroduced kdevname(sb->s_dev) in places where we'd
switched to sb->s_id, etc.)
parent b83c1ac7
...@@ -1578,7 +1578,7 @@ void generic_make_request(struct bio *bio) ...@@ -1578,7 +1578,7 @@ void generic_make_request(struct bio *bio)
printk(KERN_INFO printk(KERN_INFO
"attempt to access beyond end of device\n"); "attempt to access beyond end of device\n");
printk(KERN_INFO "%s: rw=%ld, want=%ld, limit=%Lu\n", printk(KERN_INFO "%s: rw=%ld, want=%ld, limit=%Lu\n",
kdevname(to_kdev_t(bio->bi_bdev->bd_dev)), bdevname(bio->bi_bdev),
bio->bi_rw, bio->bi_rw,
sector + nr_sectors, sector + nr_sectors,
(long long) maxsector); (long long) maxsector);
...@@ -1601,7 +1601,7 @@ void generic_make_request(struct bio *bio) ...@@ -1601,7 +1601,7 @@ void generic_make_request(struct bio *bio)
if (!q) { if (!q) {
printk(KERN_ERR printk(KERN_ERR
"generic_make_request: Trying to access nonexistent block-device %s (%Lu)\n", "generic_make_request: Trying to access nonexistent block-device %s (%Lu)\n",
kdevname(to_kdev_t(bio->bi_bdev->bd_dev)), bdevname(bio->bi_bdev),
(long long) bio->bi_sector); (long long) bio->bi_sector);
end_io: end_io:
bio->bi_end_io(bio); bio->bi_end_io(bio);
......
...@@ -105,11 +105,9 @@ static struct sysrq_key_op sysrq_reboot_op = { ...@@ -105,11 +105,9 @@ static struct sysrq_key_op sysrq_reboot_op = {
/* do_emergency_sync helper function */ /* do_emergency_sync helper function */
/* Guesses if the device is a local hard drive */ /* Guesses if the device is a local hard drive */
static int is_local_disk(kdev_t dev) { static int is_local_disk(struct block_device *bdev)
unsigned int major; {
major = major(dev); switch (MAJOR(bdev->bd_dev)) {
switch (major) {
case IDE0_MAJOR: case IDE0_MAJOR:
case IDE1_MAJOR: case IDE1_MAJOR:
case IDE2_MAJOR: case IDE2_MAJOR:
...@@ -143,7 +141,7 @@ static void go_sync(struct super_block *sb, int remount_flag) ...@@ -143,7 +141,7 @@ static void go_sync(struct super_block *sb, int remount_flag)
console_loglevel = 7; console_loglevel = 7;
printk(KERN_INFO "%sing device %s ... ", printk(KERN_INFO "%sing device %s ... ",
remount_flag ? "Remount" : "Sync", remount_flag ? "Remount" : "Sync",
kdevname(sb->s_dev)); sb->s_id);
if (remount_flag) { /* Remount R/O */ if (remount_flag) { /* Remount R/O */
int ret, flags; int ret, flags;
...@@ -202,13 +200,13 @@ void do_emergency_sync(void) { ...@@ -202,13 +200,13 @@ void do_emergency_sync(void) {
for (sb = sb_entry(super_blocks.next); for (sb = sb_entry(super_blocks.next);
sb != sb_entry(&super_blocks); sb != sb_entry(&super_blocks);
sb = sb_entry(sb->s_list.next)) sb = sb_entry(sb->s_list.next))
if (is_local_disk(sb->s_dev)) if (sb->s_bdev && is_local_disk(sb->s_bdev))
go_sync(sb, remount_flag); go_sync(sb, remount_flag);
for (sb = sb_entry(super_blocks.next); for (sb = sb_entry(super_blocks.next);
sb != sb_entry(&super_blocks); sb != sb_entry(&super_blocks);
sb = sb_entry(sb->s_list.next)) sb = sb_entry(sb->s_list.next))
if (!is_local_disk(sb->s_dev) && major(sb->s_dev)) if (sb->s_bdev && !is_local_disk(sb->s_bdev))
go_sync(sb, remount_flag); go_sync(sb, remount_flag);
unlock_kernel(); unlock_kernel();
......
...@@ -341,11 +341,10 @@ void ll_rw_kio(int rw, struct kiobuf *kio, struct block_device *bdev, sector_t s ...@@ -341,11 +341,10 @@ void ll_rw_kio(int rw, struct kiobuf *kio, struct block_device *bdev, sector_t s
int i, offset, size, err, map_i, total_nr_pages, nr_pages; int i, offset, size, err, map_i, total_nr_pages, nr_pages;
struct bio_vec *bvec; struct bio_vec *bvec;
struct bio *bio; struct bio *bio;
kdev_t dev = to_kdev_t(bdev->bd_dev);
err = 0; err = 0;
if ((rw & WRITE) && bdev_read_only(bdev)) { if ((rw & WRITE) && bdev_read_only(bdev)) {
printk("ll_rw_bio: WRITE to ro device %s\n", kdevname(dev)); printk("ll_rw_bio: WRITE to ro device %s\n", bdevname(bdev));
err = -EPERM; err = -EPERM;
goto out; goto out;
} }
......
...@@ -197,8 +197,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) ...@@ -197,8 +197,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
goto error; goto error;
} }
printk("coda_read_super: rootinode is %ld dev %x\n", printk("coda_read_super: rootinode is %ld dev %s\n",
root->i_ino, kdev_val(root->i_dev)); root->i_ino, root->i_sb->s_id);
sb->s_root = d_alloc_root(root); sb->s_root = d_alloc_root(root);
return 0; return 0;
......
...@@ -179,7 +179,7 @@ static inline void put_dquot_dup_ref(struct dquot *dquot) ...@@ -179,7 +179,7 @@ static inline void put_dquot_dup_ref(struct dquot *dquot)
static inline int const hashfn(struct super_block *sb, unsigned int id, int type) static inline int const hashfn(struct super_block *sb, unsigned int id, int type)
{ {
return((HASHDEV(sb->s_dev) ^ id) * (MAXQUOTAS - type)) % NR_DQHASH; return((((unsigned long)sb>>L1_CACHE_SHIFT) ^ id) * (MAXQUOTAS - type)) % NR_DQHASH;
} }
static inline void insert_dquot_hash(struct dquot *dquot) static inline void insert_dquot_hash(struct dquot *dquot)
......
...@@ -105,7 +105,7 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent, ...@@ -105,7 +105,7 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
/* It's a directory, or we are required to confirm the file's /* It's a directory, or we are required to confirm the file's
* location in the tree based on the parent information * location in the tree based on the parent information
*/ */
dprintk("find_exported_dentry: need to look harder for %d/%d\n",kdev_t_to_nr(sb->s_dev),*(int*)obj); dprintk("find_exported_dentry: need to look harder for %s/%d\n",sb->s_id,*(int*)obj);
if (S_ISDIR(result->d_inode->i_mode)) if (S_ISDIR(result->d_inode->i_mode))
target_dir = dget(result); target_dir = dget(result);
else { else {
......
...@@ -507,7 +507,7 @@ static int logMOUNT(struct super_block *sb) ...@@ -507,7 +507,7 @@ static int logMOUNT(struct super_block *sb)
lrd.backchain = 0; lrd.backchain = 0;
lrd.type = cpu_to_le16(LOG_MOUNT); lrd.type = cpu_to_le16(LOG_MOUNT);
lrd.length = 0; lrd.length = 0;
lrd.aggregate = cpu_to_le32(kdev_t_to_nr(sb->s_dev)); lrd.aggregate = cpu_to_le32(sb->s_bdev->bd_dev);
lmLog(log, NULL, &lrd, NULL); lmLog(log, NULL, &lrd, NULL);
return 0; return 0;
......
...@@ -1325,7 +1325,7 @@ static int txLog(log_t * log, tblock_t * tblk, commit_t * cd) ...@@ -1325,7 +1325,7 @@ static int txLog(log_t * log, tblock_t * tblk, commit_t * cd)
/* initialize lrd common */ /* initialize lrd common */
ip = tlck->ip; ip = tlck->ip;
lrd->aggregate = cpu_to_le32(kdev_t_to_nr(ip->i_dev)); lrd->aggregate = cpu_to_le32(ip->i_sb->s_bdev->bd_dev);
lrd->log.redopage.fileset = cpu_to_le32(JFS_IP(ip)->fileset); lrd->log.redopage.fileset = cpu_to_le32(JFS_IP(ip)->fileset);
lrd->log.redopage.inode = cpu_to_le32(ip->i_ino); lrd->log.redopage.inode = cpu_to_le32(ip->i_ino);
......
...@@ -92,7 +92,7 @@ static int v1_commit_dqblk(struct dquot *dquot) ...@@ -92,7 +92,7 @@ static int v1_commit_dqblk(struct dquot *dquot)
sizeof(struct v1_disk_dqblk), &offset); sizeof(struct v1_disk_dqblk), &offset);
if (ret != sizeof(struct v1_disk_dqblk)) { if (ret != sizeof(struct v1_disk_dqblk)) {
printk(KERN_WARNING "VFS: dquota write failed on dev %s\n", printk(KERN_WARNING "VFS: dquota write failed on dev %s\n",
kdevname(dquot->dq_sb->s_dev)); dquot->dq_sb->s_id);
if (ret >= 0) if (ret >= 0)
ret = -EIO; ret = -EIO;
goto out; goto out;
...@@ -145,7 +145,7 @@ static int v1_check_quota_file(struct super_block *sb, int type) ...@@ -145,7 +145,7 @@ static int v1_check_quota_file(struct super_block *sb, int type)
return 1; /* Probably not new format */ return 1; /* Probably not new format */
if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type]) if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type])
return 1; /* Definitely not new format */ return 1; /* Definitely not new format */
printk(KERN_INFO "VFS: %s: Refusing to turn on old quota format on given file. It probably contains newer quota format.\n", kdevname(sb->s_dev)); printk(KERN_INFO "VFS: %s: Refusing to turn on old quota format on given file. It probably contains newer quota format.\n", sb->s_id);
return 0; /* Seems like a new format file -> refuse it */ return 0; /* Seems like a new format file -> refuse it */
} }
......
...@@ -60,7 +60,7 @@ static int v2_read_file_info(struct super_block *sb, int type) ...@@ -60,7 +60,7 @@ static int v2_read_file_info(struct super_block *sb, int type)
set_fs(fs); set_fs(fs);
if (size != sizeof(struct v2_disk_dqinfo)) { if (size != sizeof(struct v2_disk_dqinfo)) {
printk(KERN_WARNING "Can't read info structure on device %s.\n", printk(KERN_WARNING "Can't read info structure on device %s.\n",
kdevname(f->f_dentry->d_sb->s_dev)); f->f_vfsmnt->mnt_sb->s_id);
return -1; return -1;
} }
info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace); info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace);
...@@ -95,7 +95,7 @@ static int v2_write_file_info(struct super_block *sb, int type) ...@@ -95,7 +95,7 @@ static int v2_write_file_info(struct super_block *sb, int type)
set_fs(fs); set_fs(fs);
if (size != sizeof(struct v2_disk_dqinfo)) { if (size != sizeof(struct v2_disk_dqinfo)) {
printk(KERN_WARNING "Can't write info structure on device %s.\n", printk(KERN_WARNING "Can't write info structure on device %s.\n",
kdevname(f->f_dentry->d_sb->s_dev)); f->f_vfsmnt->mnt_sb->s_id);
return -1; return -1;
} }
return 0; return 0;
...@@ -424,7 +424,7 @@ static int v2_write_dquot(struct dquot *dquot) ...@@ -424,7 +424,7 @@ static int v2_write_dquot(struct dquot *dquot)
ret = filp->f_op->write(filp, (char *)&ddquot, sizeof(struct v2_disk_dqblk), &offset); ret = filp->f_op->write(filp, (char *)&ddquot, sizeof(struct v2_disk_dqblk), &offset);
set_fs(fs); set_fs(fs);
if (ret != sizeof(struct v2_disk_dqblk)) { if (ret != sizeof(struct v2_disk_dqblk)) {
printk(KERN_WARNING "VFS: dquota write failed on dev %s\n", kdevname(dquot->dq_sb->s_dev)); printk(KERN_WARNING "VFS: dquota write failed on dev %s\n", dquot->dq_sb->s_id);
if (ret >= 0) if (ret >= 0)
ret = -ENOSPC; ret = -ENOSPC;
} }
......
...@@ -588,7 +588,7 @@ struct proc_dir_entry *reiserfs_proc_register( struct super_block *sb, ...@@ -588,7 +588,7 @@ struct proc_dir_entry *reiserfs_proc_register( struct super_block *sb,
{ {
return ( REISERFS_SB(sb)->procdir ) ? create_proc_read_entry return ( REISERFS_SB(sb)->procdir ) ? create_proc_read_entry
( name, 0, REISERFS_SB(sb)->procdir, func, ( name, 0, REISERFS_SB(sb)->procdir, func,
( void * ) kdev_t_to_nr( sb -> s_dev ) ) : NULL; ( void * ) sb->s_bdev->bd_dev) : NULL;
} }
void reiserfs_proc_unregister( struct super_block *sb, const char *name ) void reiserfs_proc_unregister( struct super_block *sb, const char *name )
......
...@@ -1641,13 +1641,10 @@ extern wait_queue_head_t reiserfs_commit_thread_wait ; ...@@ -1641,13 +1641,10 @@ extern wait_queue_head_t reiserfs_commit_thread_wait ;
#define JBH_HASH_SHIFT 13 /* these are based on journal hash size of 8192 */ #define JBH_HASH_SHIFT 13 /* these are based on journal hash size of 8192 */
#define JBH_HASH_MASK 8191 #define JBH_HASH_MASK 8191
/* After several hours of tedious analysis, the following hash #define _jhashfn(sb,block) \
* function won. Do not mess with it... -DaveM (((unsigned long)sb>>L1_CACHE_SHIFT) ^ \
*/
#define _jhashfn(dev,block) \
((((dev)<<(JBH_HASH_SHIFT - 6)) ^ ((dev)<<(JBH_HASH_SHIFT - 9))) ^ \
(((block)<<(JBH_HASH_SHIFT - 6)) ^ ((block) >> 13) ^ ((block) << (JBH_HASH_SHIFT - 12)))) (((block)<<(JBH_HASH_SHIFT - 6)) ^ ((block) >> 13) ^ ((block) << (JBH_HASH_SHIFT - 12))))
#define journal_hash(t,sb,block) ((t)[_jhashfn((kdev_t_to_nr(sb->s_dev)),(block)) & JBH_HASH_MASK]) #define journal_hash(t,sb,block) ((t)[_jhashfn((sb),(block)) & JBH_HASH_MASK])
/* finds n'th buffer with 0 being the start of this commit. Needs to go away, j_ap_blocks has changed /* finds n'th buffer with 0 being the start of this commit. Needs to go away, j_ap_blocks has changed
** since I created this. One chunk of code in journal.c needs changing before deleting it ** since I created this. One chunk of code in journal.c needs changing before deleting it
......
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