.memory_backed = 1, /* Does not contribute to dirty memory */
};
-struct inode *hwgfs_get_inode(struct super_block *sb, int mode, dev_t dev)
+static struct inode *hwgfs_get_inode(struct super_block *sb, int mode, dev_t dev)
{
struct inode * inode = new_inode(sb);
inode->i_gid = current->fsgid;
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
- inode->i_rdev = NODEV;
inode->i_mapping->a_ops = &hwgfs_aops;
inode->i_mapping->backing_dev_info = &hwgfs_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
#include <linux/swapops.h>
-#ifdef CONFIG_STRAM_SWAP
-#define MAJOR_NR Z2RAM_MAJOR
-#define do_z2_request do_stram_request
-#define DEVICE_NR(device) (minor(device))
-#endif
-
#undef DEBUG
#ifdef DEBUG
#endif
#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
-dev_t __init
+static dev_t __init
find_ide_boot(void)
{
char *p;
unsigned int cmd, unsigned long arg);
#define MAX_DEV (8)
-#define MAX_MINOR (MAX_DEV << UBD_SHIFT)
-
-#define DEVICE_NR(n) (minor(n) >> UBD_SHIFT)
static struct block_device_operations ubd_blops = {
.owner = THIS_MODULE,
struct rw_semaphore *sem;
};
-static inline int dev_to_index(dev_t dev)
-{
- return MAJOR(dev) % 255;
-}
-
int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range,
struct module *module, kobj_probe_t *probe,
int (*lock)(dev_t, void *), void *data)
#define DAC960_MaxPartitions 8
#define DAC960_MaxPartitionsBits 3
-
-/*
- Define macros to extract the Controller Number, Logical Drive Number, and
- Partition Number from a Kernel Device, and to construct a Major Number, Minor
- Number, and Kernel Device from the Controller Number, Logical Drive Number,
- and Partition Number. There is one Major Number assigned to each Controller.
- The associated Minor Number is divided into the Logical Drive Number and
- Partition Number.
-*/
-
-#define DAC960_ControllerNumber(Device) \
- (major(Device) - DAC960_MAJOR)
-
-#define DAC960_LogicalDriveNumber(Device) \
- (minor(Device) >> DAC960_MaxPartitionsBits)
-
-#define DAC960_MajorNumber(ControllerNumber) \
- (DAC960_MAJOR + (ControllerNumber))
-
-#define DAC960_MinorNumber(LogicalDriveNumber, PartitionNumber) \
- (((LogicalDriveNumber) << DAC960_MaxPartitionsBits) | (PartitionNumber))
-
-#define DAC960_MinorCount (DAC960_MaxLogicalDrives \
- * DAC960_MaxPartitions)
-
-#define DAC960_KernelDevice(ControllerNumber, \
- LogicalDriveNumber, \
- PartitionNumber) \
- mk_kdev(DAC960_MajorNumber(ControllerNumber), \
- DAC960_MinorNumber(LogicalDriveNumber, PartitionNumber))
-
-
/*
Define the DAC960 Controller fixed Block Size and Block Size Bits.
*/
/** \name Backward compatibility section */
/*@{*/
-#ifndef minor
-#define minor(x) MINOR((x))
-#endif
-
#ifndef MODULE_LICENSE
#define MODULE_LICENSE(x)
#endif
return 0;
}
-#if (defined(ROCKET_DEBUG_FLOW) || defined(ROCKET_DEBUG_THROTTLE))
-static char *rp_tty_name(struct tty_struct *tty, char *buf)
-{
- if (tty)
- sprintf(buf, "%s%d", TTY_DRIVER_NAME(tty), MINOR(tty->device) - TTY_DRIVER_MINOR_START(tty) + TTY_DRIVER_NAME_BASE);
- else
- strcpy(buf, "NULL tty");
- return buf;
-}
-#endif
-
static void rp_send_xchar(struct tty_struct *tty, char ch)
{
struct r_port *info = (struct r_port *) tty->driver_data;
{
struct r_port *info = (struct r_port *) tty->driver_data;
CHANNEL_t *cp;
-#ifdef ROCKET_DEBUG_THROTTLE
- char buf[64];
- printk(KERN_INFO "throttle %s: %d....\n", rp_tty_name(tty, buf),
+#ifdef ROCKET_DEBUG_THROTTLE
+ printk(KERN_INFO "throttle %s: %d....\n", tty->name,
tty->ldisc.chars_in_buffer(tty));
#endif
struct r_port *info = (struct r_port *) tty->driver_data;
CHANNEL_t *cp;
#ifdef ROCKET_DEBUG_THROTTLE
- char buf[64];
-
- printk(KERN_INFO "unthrottle %s: %d....\n", rp_tty_name(tty, buf),
+ printk(KERN_INFO "unthrottle %s: %d....\n", tty->name,
tty->ldisc.chars_in_buffer(tty));
#endif
static void rp_stop(struct tty_struct *tty)
{
struct r_port *info = (struct r_port *) tty->driver_data;
-#ifdef ROCKET_DEBUG_FLOW
- char buf[64];
- printk(KERN_INFO "stop %s: %d %d....\n", rp_tty_name(tty, buf),
+#ifdef ROCKET_DEBUG_FLOW
+ printk(KERN_INFO "stop %s: %d %d....\n", tty->name,
info->xmit_cnt, info->xmit_fifo_room);
#endif
static void rp_start(struct tty_struct *tty)
{
struct r_port *info = (struct r_port *) tty->driver_data;
-#ifdef ROCKET_DEBUG_FLOW
- char buf[64];
- printk(KERN_INFO "start %s: %d %d....\n", rp_tty_name(tty, buf),
+#ifdef ROCKET_DEBUG_FLOW
+ printk(KERN_INFO "start %s: %d %d....\n", tty->name,
info->xmit_cnt, info->xmit_fifo_room);
#endif
#define VERSION(ver,rel,seq) (((ver)<<16) | ((rel)<<8) | (seq))
#if LINUX_VERSION_CODE < VERSION(2,5,0)
-# define minor(x) MINOR(x)
# define need_resched() (current->need_resched)
#endif
kfree(tty_dev);
}
-void tty_remove_class_device(dev_t dev)
+static void tty_remove_class_device(dev_t dev)
{
struct tty_dev *tty_dev = NULL;
struct list_head *tmp;
spin_lock(&tty_dev_list_lock);
list_for_each (tmp, &tty_dev_list) {
tty_dev = list_entry(tmp, struct tty_dev, node);
- if ((MAJOR(tty_dev->dev) == MAJOR(dev)) &&
- (MINOR(tty_dev->dev) == MINOR(dev))) {
+ if (tty_dev->dev == dev) {
+ list_del(&tty_dev->node);
found = 1;
break;
}
}
- if (found) {
- list_del(&tty_dev->node);
- spin_unlock(&tty_dev_list_lock);
+ spin_unlock(&tty_dev_list_lock);
+ if (found)
class_device_unregister(&tty_dev->class_dev);
- } else {
- spin_unlock(&tty_dev_list_lock);
- }
}
/**
/* The great kdev_t changeover in 2.5.x */
#include <linux/kdev_t.h>
-#ifndef minor
-#define minor(dev) MINOR(dev)
-#endif
-
/* Transaction Label handling */
struct hpsb_tlabel_pool {
}
if (param->flags & DM_PERSISTENT_DEV_FLAG)
- r = dm_create_with_minor(minor(to_kdev_t(param->dev)), &md);
+ r = dm_create_with_minor(MINOR(param->dev), &md);
else
r = dm_create(&md);
return r;
if (param->flags & DM_PERSISTENT_DEV_FLAG)
- r = dm_create_with_minor(minor(to_kdev_t(param->dev)), &md);
+ r = dm_create_with_minor(MINOR(param->dev), &md);
else
r = dm_create(&md);
#define MAJOR_NR MD_MAJOR
#define MD_DRIVER
#define MD_PERSONALITY
-#define DEVICE_NR(device) (minor(device))
/*
* find which device holds a particular offset
#define MAJOR_NR MD_MAJOR
#define MD_DRIVER
-#define DEVICE_NR(device) (minor(device))
#define DEBUG 0
#define dprintk(x...) ((void)(DEBUG && printk(x)))
#define MAJOR_NR MD_MAJOR
#define MD_DRIVER
#define MD_PERSONALITY
-#define DEVICE_NR(device) (minor(device))
#define MAX_WORK_PER_DISK 128
#define MAJOR_NR MD_MAJOR
#define MD_DRIVER
#define MD_PERSONALITY
-#define DEVICE_NR(device) (minor(device))
static int create_strip_zones (mddev_t *mddev)
{
#define MAJOR_NR MD_MAJOR
#define MD_DRIVER
#define MD_PERSONALITY
-#define DEVICE_NR(device) (minor(device))
/*
* Number of guaranteed r1bios in case of extreme VM load:
{
struct video_device *vfd = container_of(cd, struct video_device, class_dev);
dev_t dev = MKDEV(VIDEO_MAJOR, vfd->minor);
- return sprintf(buf,"%04x\n",(int)dev);
+ return sprintf(buf,"%04x\n",old_encode_dev(dev));
}
static CLASS_DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
zoran_open (struct inode *inode,
struct file *file)
{
- unsigned int minor = minor(inode->i_rdev);
+ unsigned int minor = iminor(inode);
struct zoran *zr = NULL;
struct zoran_fh *fh;
int i, res, first_open = 0, have_module_locks = 0;
#define TUBMAXMINS 256
-#define TUB_DEV MKDEV(IBM_FS3270_MAJ, 0) /* Generic /dev/3270/tub */
#define _GEOM_ROWS 24
#define _GEOM_COLS 80
#define GEOM_ROWS (tubp->geom_rows)
#define TUB_UE_BUSY 0x0800
#define TUB_INPUT_HACK 0x1000 /* Early init of command line */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-#define S390_CONSOLE_DEV MKDEV(TTY_MAJOR, 64)
-#define tub_major(x) MAJOR(x)
-#define tub_minor(x) MINOR(x)
-#define tub_mkdev(x, y) MKDEV(x, y)
-#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-#define S390_CONSOLE_DEV MKDEV(TTYAUX_MAJOR, 1)
-#define tub_major(x) MAJOR(x)
-#define tub_minor(x) MINOR(x)
-#define tub_mkdev(x, y) MKDEV(x, y)
-#else
-#define S390_CONSOLE_DEV mk_kdev(TTYAUX_MAJOR, 1)
-#define tub_major(x) major(x)
-#define tub_minor(x) minor(x)
-#define tub_mkdev(x, y) mk_kdev(x, y)
-#endif
-
/*
* Extra stuff for 3270 console support
*/
inode->i_gid = current->fsgid;
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
- inode->i_rdev = NODEV;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
switch (mode & S_IFMT) {
default:
inode->i_nlink = vnode->status.nlink;
inode->i_uid = vnode->status.owner;
inode->i_gid = 0;
- inode->i_rdev = NODEV;
inode->i_size = vnode->status.size;
inode->i_atime.tv_sec = inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = vnode->status.mtime_server;
inode->i_atime.tv_nsec =
}
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
- inode->i_rdev = NODEV;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
if (S_ISDIR(inf->mode)) {
inode->i_blksize = FAKE_BLOCK_SIZE;
inode->i_op = &devfs_iops;
inode->i_fop = &devfs_fops;
- inode->i_rdev = NODEV;
if ( S_ISCHR (de->mode) )
{
inode->i_rdev = to_kdev_t(de->u.cdev.dev);
struct devfs_entry *parent, *de;
struct inode *inode;
- DPRINTK (DEBUG_I_MKNOD, "(%s): mode: 0%o dev: %d\n",
- dentry->d_name.name, mode, rdev);
+ DPRINTK (DEBUG_I_MKNOD, "(%s): mode: 0%o dev: %u:%u\n",
+ dentry->d_name.name, mode, MAJOR(rdev), MINOR(rdev));
parent = get_devfs_entry_from_vfs_inode (dir);
if (parent == NULL) return -ENOENT;
de = _devfs_alloc_entry (dentry->d_name.name, dentry->d_name.len, mode);
/* Initialize the inode */
struct hfs_sb_info *hsb = HFS_SB(sb);
- inode->i_rdev = NODEV;
inode->i_ctime.tv_sec = inode->i_atime.tv_sec = inode->i_mtime.tv_sec =
hfs_m_to_utime(entry->modify_date);
inode->i_ctime.tv_nsec = 0;
inode->i_gid = gid;
inode->i_blksize = HPAGE_SIZE;
inode->i_blocks = 0;
- inode->i_rdev = NODEV;
inode->i_mapping->a_ops = &hugetlbfs_aops;
inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_nlink = raw_inode->nlink;
inode->i_uid = raw_inode->uid;
inode->i_gid = raw_inode->gid;
- inode->i_rdev = NODEV;
inode->i_size = raw_inode->dsize;
inode->i_atime.tv_sec = raw_inode->atime;
inode->i_mtime.tv_sec = raw_inode->mtime;
case S_IFSOCK:
case S_IFIFO:
inode->i_op = &jffs2_file_inode_operations;
- init_special_inode(inode, inode->i_mode, kdev_t_to_nr(mk_kdev(je16_to_cpu(rdev)>>8, je16_to_cpu(rdev)&0xff)));
+ init_special_inode(inode, inode->i_mode, MKDEV(je16_to_cpu(rdev)>>8, je16_to_cpu(rdev)&0xff));
break;
default:
inode->i_nlink = 1;
inode->i_uid = server->m.uid;
inode->i_gid = server->m.gid;
- inode->i_rdev = NODEV;
inode->i_blksize = NCP_BLOCK_SIZE;
ncp_update_dates(inode, &nwinfo->i);
inode->i_gid = current->fsgid;
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
- inode->i_rdev = NODEV;
inode->i_mapping->a_ops = &ramfs_aops;
inode->i_mapping->backing_dev_info = &ramfs_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
default:
/* depending on MBZ for sock/fifos */
nextfh = ntohl(ri.spec);
- /* convert back and forth for typechecking and
- * source tagging */
- nextfh = kdev_t_to_nr(mk_kdev(nextfh>>16,nextfh&0xffff));
- init_special_inode(i, ino, nextfh);
+ init_special_inode(i, ino,
+ MKDEV(nextfh>>16,nextfh&0xffff));
}
}
inode->i_gid = current->fsgid;
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
- inode->i_rdev = NODEV;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_mapping->a_ops = &sysfs_aops;
inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info;
inode->i_gid = current->fsgid;
inode->i_blksize = PAGE_CACHE_SIZE;
inode->i_blocks = 0;
- inode->i_rdev = NODEV;
inode->i_mapping->a_ops = &shmem_aops;
inode->i_mapping->backing_dev_info = &shmem_backing_dev_info;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;