summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2003-09-23 18:25:54 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-09-23 18:25:54 -0700
commit83157abd1d74d385af3555f3e5e4147289523bde (patch)
tree40f77a5012ff83b6e73f04670e1615d55bf7ed7d /include/linux
parente3cac9df6a96da17f3e2291b7401448a7338501e (diff)
parent12689c9c783c3c96064251882811d5c9b0d1726f (diff)
Merge http://mdomsch.bkbits.net/linux-2.5-dellname
into home.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dm-ioctl-v1.h4
-rw-r--r--include/linux/fs.h3
-rw-r--r--include/linux/hugetlb.h2
-rw-r--r--include/linux/kdev_t.h74
-rw-r--r--include/linux/major.h30
-rw-r--r--include/linux/nfsd/export.h2
-rw-r--r--include/linux/nfsd/nfsd.h12
-rw-r--r--include/linux/nfsd/nfsfh.h26
-rw-r--r--include/linux/raid/md_k.h6
-rw-r--r--include/linux/reiserfs_fs.h19
-rw-r--r--include/linux/reiserfs_fs_sb.h2
-rw-r--r--include/linux/rtnetlink.h32
-rw-r--r--include/linux/tty.h22
-rw-r--r--include/linux/types.h2
14 files changed, 126 insertions, 110 deletions
diff --git a/include/linux/dm-ioctl-v1.h b/include/linux/dm-ioctl-v1.h
index 21bef9ec14b0..8a20b91c0e45 100644
--- a/include/linux/dm-ioctl-v1.h
+++ b/include/linux/dm-ioctl-v1.h
@@ -50,7 +50,7 @@ struct dm_ioctl {
uint32_t open_count; /* out */
uint32_t flags; /* in/out */
- __kernel_dev_t dev; /* in/out */
+ __kernel_old_dev_t dev; /* in/out */
char name[DM_NAME_LEN]; /* device name */
char uuid[DM_UUID_LEN]; /* unique identifier for
@@ -87,7 +87,7 @@ struct dm_target_spec {
struct dm_target_deps {
uint32_t count;
- __kernel_dev_t dev[0]; /* out */
+ __kernel_old_dev_t dev[0]; /* out */
};
/*
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 20a7b18b0841..b3a714c094d2 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1392,9 +1392,6 @@ struct tree_descr { char *name; struct file_operations *ops; int mode; };
extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);
extern void simple_release_fs(struct vfsmount **mount, int *count);
-extern int old_valid_dev(dev_t);
-extern u16 old_encode_dev(dev_t);
-extern dev_t old_decode_dev(u16);
extern int inode_change_ok(struct inode *, struct iattr *);
extern int inode_setattr(struct inode *, struct iattr *);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index edc512ee628f..b3dd00de8dc3 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -98,6 +98,8 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
extern struct file_operations hugetlbfs_file_operations;
extern struct vm_operations_struct hugetlb_vm_ops;
struct file *hugetlb_zero_setup(size_t);
+int hugetlb_get_quota(struct address_space *mapping);
+void hugetlb_put_quota(struct address_space *mapping);
static inline int is_file_hugepages(struct file *file)
{
diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h
index f60508da024d..bceea527dd37 100644
--- a/include/linux/kdev_t.h
+++ b/include/linux/kdev_t.h
@@ -1,8 +1,7 @@
#ifndef _LINUX_KDEV_T_H
#define _LINUX_KDEV_T_H
#ifdef __KERNEL__
-/* These are for user-level "dev_t" */
-#define MINORBITS 8
+#define MINORBITS 20
#define MINORMASK ((1U << MINORBITS) - 1)
#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS))
@@ -18,6 +17,77 @@
buffer; \
})
+/* acceptable for old filesystems */
+static inline int old_valid_dev(dev_t dev)
+{
+ return MAJOR(dev) < 256 && MINOR(dev) < 256;
+}
+
+static inline u16 old_encode_dev(dev_t dev)
+{
+ return (MAJOR(dev) << 8) | MINOR(dev);
+}
+
+static inline dev_t old_decode_dev(u16 val)
+{
+ return MKDEV((val >> 8) & 255, val & 255);
+}
+
+static inline int new_valid_dev(dev_t dev)
+{
+ return 1;
+}
+
+static inline u32 new_encode_dev(dev_t dev)
+{
+ unsigned major = MAJOR(dev);
+ unsigned minor = MINOR(dev);
+ return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
+}
+
+static inline dev_t new_decode_dev(u32 dev)
+{
+ unsigned major = (dev & 0xfff00) >> 8;
+ unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00);
+ return MKDEV(major, minor);
+}
+
+static inline int huge_valid_dev(dev_t dev)
+{
+ return 1;
+}
+
+static inline u64 huge_encode_dev(dev_t dev)
+{
+ return new_encode_dev(dev);
+}
+
+static inline dev_t huge_decode_dev(u64 dev)
+{
+ return new_decode_dev(dev);
+}
+
+static inline int sysv_valid_dev(dev_t dev)
+{
+ return MAJOR(dev) < (1<<14) && MINOR(dev) < (1<<18);
+}
+
+static inline u32 sysv_encode_dev(dev_t dev)
+{
+ return MINOR(dev) | (MAJOR(dev) << 18);
+}
+
+static inline unsigned sysv_major(u32 dev)
+{
+ return (dev >> 18) & 0x3fff;
+}
+
+static inline unsigned sysv_minor(u32 dev)
+{
+ return dev & 0x3ffff;
+}
+
+
#else /* __KERNEL__ */
/*
diff --git a/include/linux/major.h b/include/linux/major.h
index 0e2d112c89e5..39a77a2c7035 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -160,34 +160,4 @@
#define IBM_TTY3270_MAJOR 227
#define IBM_FS3270_MAJOR 228
-/*
- * Tests for SCSI devices.
- */
-
-#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \
- ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR) || \
- ((M) >= SCSI_DISK8_MAJOR && (M) <= SCSI_DISK15_MAJOR))
-
-#define SCSI_BLK_MAJOR(M) \
- (SCSI_DISK_MAJOR(M) \
- || (M) == SCSI_CDROM_MAJOR)
-
-static __inline__ int scsi_blk_major(int m) {
- return SCSI_BLK_MAJOR(m);
-}
-
-/*
- * Tests for IDE devices
- */
-#define IDE_DISK_MAJOR(M) ((M) == IDE0_MAJOR || (M) == IDE1_MAJOR || \
- (M) == IDE2_MAJOR || (M) == IDE3_MAJOR || \
- (M) == IDE4_MAJOR || (M) == IDE5_MAJOR || \
- (M) == IDE6_MAJOR || (M) == IDE7_MAJOR || \
- (M) == IDE8_MAJOR || (M) == IDE9_MAJOR)
-
-static __inline__ int ide_blk_major(int m)
-{
- return IDE_DISK_MAJOR(m);
-}
-
#endif
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 74272d6a562e..204294616cf1 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -65,7 +65,7 @@ struct svc_expkey {
struct auth_domain * ek_client;
int ek_fsidtype;
- u32 ek_fsid[2];
+ u32 ek_fsid[3];
struct svc_export * ek_export;
};
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 8c4fb5cfff21..97a57608a6e6 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -15,6 +15,7 @@
#include <linux/unistd.h>
#include <linux/dirent.h>
#include <linux/fs.h>
+#include <linux/mount.h>
#include <linux/nfsd/debug.h>
#include <linux/nfsd/nfsfh.h>
@@ -209,6 +210,17 @@ void nfsd_lockd_shutdown(void);
*/
extern struct timeval nfssvc_boot;
+static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
+{
+ if (fh->fh_export->ex_flags & NFSEXP_FSID) {
+ struct vfsmount *mnt = fh->fh_export->ex_mnt;
+ if (!old_valid_dev(mnt->mnt_sb->s_dev) ||
+ (reffh->fh_version == 1 && reffh->fh_fsid_type == 1))
+ return 1;
+ }
+ return 0;
+}
+
#ifdef CONFIG_NFSD_V4
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index d4d63cc8e5fa..555793d69ddc 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -117,26 +117,6 @@ struct knfsd_fh {
#ifdef __KERNEL__
-/*
- * Conversion macros for the filehandle fields.
- *
- * Keep the device numbers in "backwards compatible
- * format", ie the low 16 bits contain the low 8 bits
- * of the 20-bit minor and the 12-bit major number.
- *
- * The high 16 bits contain the rest (4 bits major
- * and 12 bits minor),
- */
-
-static inline dev_t u32_to_dev_t(__u32 udev)
-{
- unsigned int minor, major;
-
- minor = (udev & 0xff) | ((udev >> 8) & 0xfff00);
- major = ((udev >> 8) & 0xff) | ((udev >> 20) & 0xf00);
- return MKDEV(major, minor);
-}
-
static inline __u32 ino_t_to_u32(ino_t ino)
{
return (__u32) ino;
@@ -196,6 +176,12 @@ static inline void mk_fsid_v1(u32 *fsidv, u32 fsid)
fsidv[0] = fsid;
}
+static inline void mk_fsid_v2(u32 *fsidv, dev_t dev, ino_t ino)
+{
+ fsidv[0] = htonl(MAJOR(dev));
+ fsidv[1] = htonl(MINOR(dev));
+ fsidv[2] = ino_t_to_u32(ino);
+}
/*
* Shorthand for dprintk()'s
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 70c5d117da8d..c9466321a2b2 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -64,11 +64,7 @@ static inline int level_to_pers (int level)
typedef struct mddev_s mddev_t;
typedef struct mdk_rdev_s mdk_rdev_t;
-#if (MINORBITS != 8)
-#error MD does not handle bigger kdev yet
-#endif
-
-#define MAX_MD_DEVS (1<<MINORBITS) /* Max number of md dev */
+#define MAX_MD_DEVS 256 /* Max number of md dev */
/*
* options passed in raidrun:
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 0d8f3ad21fdd..a34e79044978 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1931,32 +1931,13 @@ struct dentry *reiserfs_get_parent(struct dentry *) ;
int reiserfs_proc_info_init( struct super_block *sb );
int reiserfs_proc_info_done( struct super_block *sb );
-struct proc_dir_entry *reiserfs_proc_register( struct super_block *sb,
- char *name, read_proc_t *func );
-void reiserfs_proc_unregister( struct super_block *sb, const char *name );
struct proc_dir_entry *reiserfs_proc_register_global( char *name,
read_proc_t *func );
void reiserfs_proc_unregister_global( const char *name );
int reiserfs_proc_info_global_init( void );
int reiserfs_proc_info_global_done( void );
-int reiserfs_proc_tail( int len, char *buffer, char **start,
- off_t offset, int count, int *eof );
int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data );
-int reiserfs_version_in_proc( char *buffer, char **start, off_t offset,
- int count, int *eof, void *data );
-int reiserfs_super_in_proc( char *buffer, char **start, off_t offset,
- int count, int *eof, void *data );
-int reiserfs_per_level_in_proc( char *buffer, char **start, off_t offset,
- int count, int *eof, void *data );
-int reiserfs_bitmap_in_proc( char *buffer, char **start, off_t offset,
- int count, int *eof, void *data );
-int reiserfs_on_disk_super_in_proc( char *buffer, char **start, off_t offset,
- int count, int *eof, void *data );
-int reiserfs_oidmap_in_proc( char *buffer, char **start, off_t offset,
- int count, int *eof, void *data );
-int reiserfs_journal_in_proc( char *buffer, char **start, off_t offset,
- int count, int *eof, void *data );
#if defined( REISERFS_PROC_INFO )
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 956b0d22d500..4c675f30a8ae 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -468,7 +468,7 @@ struct reiserfs_sb_info
void reiserfs_file_buffer (struct buffer_head * bh, int list);
-int is_reiserfs_super(struct super_block *s) ;
+extern struct file_system_type reiserfs_fs_type;
int journal_mark_dirty(struct reiserfs_transaction_handle *, struct super_block *, struct buffer_head *bh) ;
int flush_old_commits(struct super_block *s, int) ;
int show_reiserfs_locks(void) ;
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 502a1389f689..1141ec3c5321 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -618,7 +618,7 @@ enum
#include <linux/config.h>
-static __inline__ int rtattr_strcmp(struct rtattr *rta, char *str)
+static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
{
int len = strlen(str) + 1;
return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
@@ -642,8 +642,9 @@ extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
#define RTA_PUT(skb, attrtype, attrlen, data) \
-({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \
- __rta_fill(skb, attrtype, attrlen, data); })
+({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
+ goto rtattr_failure; \
+ __rta_fill(skb, attrtype, attrlen, data); })
static inline struct rtattr *
__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
@@ -658,8 +659,9 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
}
#define __RTA_PUT(skb, attrtype, attrlen) \
-({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \
- __rta_reserve(skb, attrtype, attrlen); })
+({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
+ goto rtattr_failure; \
+ __rta_reserve(skb, attrtype, attrlen); })
extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
@@ -681,11 +683,21 @@ extern void rtnl_lock(void);
extern void rtnl_unlock(void);
extern void rtnetlink_init(void);
-#define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0) { up(&rtnl_sem); \
-printk("RTNL: assertion failed at " __FILE__ "(%d)\n", __LINE__); } \
- } while(0)
-#define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d)\n", __LINE__); }
-
+#define ASSERT_RTNL() do { \
+ if (unlikely(down_trylock(&rtnl_sem) == 0)) { \
+ up(&rtnl_sem); \
+ printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \
+ __FILE__, __LINE__); \
+ dump_stack(); \
+ } \
+} while(0)
+
+#define BUG_TRAP(x) do { \
+ if (unlikely(!(x))) { \
+ printk(KERN_ERR "KERNEL: assertion (%s) failed at %s (%d)\n", \
+ #x, __FILE__ , __LINE__); \
+ } \
+} while(0)
#endif /* __KERNEL__ */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index c575197f00b3..0626d1b321aa 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -264,7 +264,6 @@ struct tty_struct {
char name[64];
int pgrp;
int session;
- dev_t device;
unsigned long flags;
int count;
struct winsize winsize;
@@ -348,23 +347,7 @@ extern int fg_console, last_console, want_console;
extern int kmsg_redirect;
extern void console_init(void);
-
-extern int lp_init(void);
-extern int pty_init(void);
-extern int mxser_init(void);
-extern int moxa_init(void);
-extern int ip2_init(void);
-extern int pcxe_init(void);
-extern int pc_init(void);
extern int vcs_init(void);
-extern int rp_init(void);
-extern int cy_init(void);
-extern int stl_init(void);
-extern int stli_init(void);
-extern int specialix_init(void);
-extern int espserial_init(void);
-extern int macserial_init(void);
-extern int a2232board_init(void);
extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
const char *routine);
@@ -419,5 +402,10 @@ extern void console_print(const char *);
extern int vt_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg);
+static inline dev_t tty_devnum(struct tty_struct *tty)
+{
+ return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index;
+}
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/linux/types.h b/include/linux/types.h
index 87a71f8f2416..3b407b06b48f 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -17,6 +17,8 @@
#ifndef __KERNEL_STRICT_NAMES
+typedef __u32 __kernel_dev_t;
+
typedef __kernel_fd_set fd_set;
typedef __kernel_dev_t dev_t;
typedef __kernel_ino_t ino_t;