summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2003-09-22 22:59:04 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-09-22 22:59:04 -0700
commitab168caf67c5ac1c99a1aca5679d9bd0e07ba43e (patch)
treea06b41f0d72abbad84b1cd374564a3665147a69d /include/linux
parent843a763d740fa12ebe6c50d44638670fcf881224 (diff)
parentd3861d447abddde9057cbf7ed6f8c090bd063bdc (diff)
Merge bk://kernel.bkbits.net/davem/net-2.5
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/kdev_t.h74
-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/tty.h6
-rw-r--r--include/linux/types.h2
11 files changed, 102 insertions, 54 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/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/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/tty.h b/include/linux/tty.h
index c575197f00b3..946702c37e6e 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;
@@ -419,5 +418,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;