diff options
| author | Jens Axboe <axboe@burns.home.kernel.dk> | 2002-02-07 10:37:19 +0100 |
|---|---|---|
| committer | Jens Axboe <axboe@burns.home.kernel.dk> | 2002-02-07 10:37:19 +0100 |
| commit | 2adf779dd193e1c8673f5896da4fef1dda830774 (patch) | |
| tree | f8014bbf33b023dd09bda6f9145bb776f73389d2 /include/linux | |
| parent | 07916eb45f4a6c63acb93e269c10490e4e623a0c (diff) | |
| parent | 0ec120046dee44027a28b66a3c28d1031982a9eb (diff) | |
Merge http://linux.bkbits.net/linux-2.5
into burns.home.kernel.dk:/usr/local/kernel/BK/linux-2.5
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 56 | ||||
| -rw-r--r-- | include/linux/hpfs_fs_sb.h | 5 | ||||
| -rw-r--r-- | include/linux/net.h | 4 | ||||
| -rw-r--r-- | include/linux/nfs_fs.h | 1 | ||||
| -rw-r--r-- | include/linux/proc_fs.h | 24 | ||||
| -rw-r--r-- | include/linux/proc_fs_i.h | 9 | ||||
| -rw-r--r-- | include/linux/sched.h | 6 | ||||
| -rw-r--r-- | include/linux/stat.h | 19 | ||||
| -rw-r--r-- | include/linux/usb.h | 4 | ||||
| -rw-r--r-- | include/linux/zconf.h | 90 | ||||
| -rw-r--r-- | include/linux/zutil.h | 126 |
11 files changed, 318 insertions, 26 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index cdfaac0cdc0e..8e3ce34f39da 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -91,7 +91,6 @@ extern int leases_enable, dir_notify_enable, lease_break_time; #define FS_NO_PRELIM 4 /* prevent preloading of dentries, even if * FS_NO_DCACHE is not set. */ -#define FS_SINGLE 8 /* Filesystem that can have only one superblock */ #define FS_NOMOUNT 16 /* Never mount from userland */ #define FS_LITTER 32 /* Keeps the tree in dcache */ #define FS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon @@ -208,6 +207,7 @@ extern void update_atime (struct inode *); extern void buffer_init(unsigned long); extern void inode_init(unsigned long); extern void mnt_init(unsigned long); +extern void files_init(unsigned long); /* bh state bits */ enum bh_state_bits { @@ -289,7 +289,6 @@ extern void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long #include <linux/pipe_fs_i.h> /* #include <linux/umsdos_fs_i.h> */ #include <linux/romfs_fs_i.h> -#include <linux/proc_fs_i.h> #include <linux/cramfs_fs_sb.h> /* @@ -455,12 +454,25 @@ struct inode { union { /* struct umsdos_inode_info umsdos_i; */ struct romfs_inode_info romfs_i; - struct proc_inode_info proc_i; - struct socket socket_i; void *generic_ip; } u; }; +struct socket_alloc { + struct socket socket; + struct inode vfs_inode; +}; + +static inline struct socket *SOCKET_I(struct inode *inode) +{ + return &list_entry(inode, struct socket_alloc, vfs_inode)->socket; +} + +static inline struct inode *SOCK_INODE(struct socket *socket) +{ + return &list_entry(socket, struct socket_alloc, socket)->vfs_inode; +} + #include <linux/shmem_fs.h> /* will die */ #include <linux/coda_fs_i.h> @@ -507,6 +519,14 @@ extern int init_private_file(struct file *, struct dentry *, int); #define MAX_NON_LFS ((1UL<<31) - 1) +/* Page cache limit. The filesystems should put that into their s_maxbytes + limits, otherwise bad things can happen in VM. */ +#if BITS_PER_LONG==32 +#define MAX_LFS_FILESIZE (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) +#elif BITS_PER_LONG==64 +#define MAX_LFS_FILESIZE 0x7fffffffffffffff +#endif + #define FL_POSIX 1 #define FL_FLOCK 2 #define FL_BROKEN 4 /* broken flock() emulation */ @@ -914,15 +934,36 @@ struct dquot_operations { int (*transfer) (struct inode *, struct iattr *); }; +/* + * NOTE NOTE NOTE + * + * ->read_super() is going to die. New method (->get_sb) should replace + * it. The only reason why ->read_super() is left for _SHORT_ transition + * period is to avoid a single patch touching every fs. They will be + * converted one-by-one and ONCE THAT IS DONE OR TWO WEEKS HAD PASSED + * (whatever sooner) ->read_super() WILL DISAPPEAR. + */ + struct file_system_type { const char *name; int fs_flags; + struct super_block *(*get_sb) (struct file_system_type *, int, char *, void *); struct super_block *(*read_super) (struct super_block *, void *, int); struct module *owner; struct file_system_type * next; struct list_head fs_supers; }; +struct super_block *get_sb_bdev(struct file_system_type *fs_type, + int flags, char *dev_name, void * data, + int (*fill_super)(struct super_block *, void *, int)); +struct super_block *get_sb_single(struct file_system_type *fs_type, + int flags, void *data, + int (*fill_super)(struct super_block *, void *, int)); +struct super_block *get_sb_nodev(struct file_system_type *fs_type, + int flags, void *data, + int (*fill_super)(struct super_block *, void *, int)); + #define DECLARE_FSTYPE(var,type,read,flags) \ struct file_system_type var = { \ name: type, \ @@ -1449,6 +1490,7 @@ extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *) extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t); extern loff_t no_llseek(struct file *file, loff_t offset, int origin); extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); +extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *); extern int generic_file_open(struct inode * inode, struct file * filp); @@ -1463,6 +1505,10 @@ extern struct inode_operations page_symlink_inode_operations; extern int vfs_readdir(struct file *, filldir_t, void *); extern int dcache_readdir(struct file *, void *, filldir_t); +extern int vfs_stat(char *, struct kstat *); +extern int vfs_lstat(char *, struct kstat *); +extern int vfs_fstat(unsigned int, struct kstat *); + extern struct file_system_type *get_fs_type(const char *name); extern struct super_block *get_super(kdev_t); extern void drop_super(struct super_block *sb); @@ -1475,8 +1521,6 @@ static inline int is_mounted(kdev_t dev) } return 0; } -unsigned long generate_cluster(kdev_t, int b[], int); -unsigned long generate_cluster_swab32(kdev_t, int b[], int); extern kdev_t ROOT_DEV; extern char root_device_name[]; diff --git a/include/linux/hpfs_fs_sb.h b/include/linux/hpfs_fs_sb.h index 9059054cf82d..068035e9a4bd 100644 --- a/include/linux/hpfs_fs_sb.h +++ b/include/linux/hpfs_fs_sb.h @@ -30,9 +30,8 @@ struct hpfs_sb_info { /* 128 bytes lowercasing table */ unsigned *sb_bmp_dir; /* main bitmap directory */ unsigned sb_c_bitmap; /* current bitmap */ - wait_queue_head_t sb_creation_de;/* when creating dirents, nobody else + struct semaphore hpfs_creation_de; /* when creating dirents, nobody else can alloc blocks */ - unsigned sb_creation_de_lock : 1; /*unsigned sb_mounting : 1;*/ int sb_timeshift; }; @@ -60,8 +59,6 @@ struct hpfs_sb_info { #define s_hpfs_cp_table u.hpfs_sb.sb_cp_table #define s_hpfs_bmp_dir u.hpfs_sb.sb_bmp_dir #define s_hpfs_c_bitmap u.hpfs_sb.sb_c_bitmap -#define s_hpfs_creation_de u.hpfs_sb.sb_creation_de -#define s_hpfs_creation_de_lock u.hpfs_sb.sb_creation_de_lock #define s_hpfs_iget_q u.hpfs_sb.sb_iget_q /*#define s_hpfs_mounting u.hpfs_sb.sb_mounting*/ #define s_hpfs_timeshift u.hpfs_sb.sb_timeshift diff --git a/include/linux/net.h b/include/linux/net.h index 39493fc2e265..8cd440ce36d6 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -23,6 +23,7 @@ #include <linux/wait.h> struct poll_table_struct; +struct inode; #define NPROTO 32 /* should be enough for now.. */ @@ -68,7 +69,6 @@ struct socket unsigned long flags; struct proto_ops *ops; - struct inode *inode; struct fasync_struct *fasync_list; /* Asynchronous wake up list */ struct file *file; /* File back pointer for gc */ struct sock *sk; @@ -78,8 +78,6 @@ struct socket unsigned char passcred; }; -#define SOCK_INODE(S) ((S)->inode) - struct scm_cookie; struct vm_area_struct; struct page; diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index eda80eca898e..e95a085a2fdd 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -226,7 +226,6 @@ unsigned long page_index(struct page *page) /* * linux/fs/nfs/inode.c */ -extern struct super_block *nfs_read_super(struct super_block *, void *, int); extern void nfs_zap_caches(struct inode *); extern int nfs_inode_is_stale(struct inode *, struct nfs_fh *, struct nfs_fattr *); diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 4688c8c90ede..5c0a4642fd69 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -97,7 +97,7 @@ extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); extern struct vfsmount *proc_mnt; -extern struct super_block *proc_read_super(struct super_block *,void *,int); +extern int proc_fill_super(struct super_block *,void *,int); extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *); extern int proc_match(int, const char *,struct proc_dir_entry *); @@ -205,4 +205,26 @@ extern struct proc_dir_entry proc_root; #endif /* CONFIG_PROC_FS */ +struct proc_inode { + struct task_struct *task; + int type; + union { + int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); + int (*proc_read)(struct task_struct *task, char *page); + } op; + struct file *file; + struct proc_dir_entry *pde; + struct inode vfs_inode; +}; + +static inline struct proc_inode *PROC_I(struct inode *inode) +{ + return list_entry(inode, struct proc_inode, vfs_inode); +} + +static inline struct proc_dir_entry *PDE(struct inode *inode) +{ + return PROC_I(inode)->pde; +} + #endif /* _LINUX_PROC_FS_H */ diff --git a/include/linux/proc_fs_i.h b/include/linux/proc_fs_i.h deleted file mode 100644 index d4bde0989084..000000000000 --- a/include/linux/proc_fs_i.h +++ /dev/null @@ -1,9 +0,0 @@ -struct proc_inode_info { - struct task_struct *task; - int type; - union { - int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); - int (*proc_read)(struct task_struct *task, char *page); - } op; - struct file *file; -}; diff --git a/include/linux/sched.h b/include/linux/sched.h index 6805d6ae39df..5d3f7b02ce08 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -564,6 +564,7 @@ extern int in_egroup_p(gid_t); extern void proc_caches_init(void); extern void flush_signals(struct task_struct *); extern void flush_signal_handlers(struct task_struct *); +extern void sig_exit(int, int, struct siginfo *); extern int dequeue_signal(sigset_t *, siginfo_t *); extern void block_all_signals(int (*notifier)(void *priv), void *priv, sigset_t *mask); @@ -839,9 +840,14 @@ do { \ #define for_each_task(p) \ for (p = &init_task ; (p = p->next_task) != &init_task ; ) +#define for_each_thread(task) \ + for (task = next_thread(current) ; task != current ; task = next_thread(task)) + #define next_thread(p) \ list_entry((p)->thread_group.next, struct task_struct, thread_group) +#define thread_group_leader(p) (p->pid == p->tgid) + static inline void unhash_process(struct task_struct *p) { write_lock_irq(&tasklist_lock); diff --git a/include/linux/stat.h b/include/linux/stat.h index e43e241f31cb..d78a416a3a39 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -52,6 +52,25 @@ #define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) #define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) #define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) + +#include <linux/types.h> + +struct kstat { + unsigned long ino; + dev_t dev; + umode_t mode; + nlink_t nlink; + uid_t uid; + gid_t gid; + dev_t rdev; + loff_t size; + time_t atime; + time_t mtime; + time_t ctime; + unsigned long blksize; + unsigned long blocks; +}; + #endif #endif diff --git a/include/linux/usb.h b/include/linux/usb.h index 4c5837e684cd..d598c720ad2d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -857,7 +857,7 @@ extern struct urb *usb_alloc_urb(int iso_packets); extern void usb_free_urb(struct urb *urb); #define usb_put_urb usb_free_urb extern struct urb *usb_get_urb(struct urb *urb); -extern int usb_submit_urb(struct urb *urb); +extern int usb_submit_urb(struct urb *urb, int mem_flags); extern int usb_unlink_urb(struct urb *urb); /*-------------------------------------------------------------------* @@ -906,7 +906,7 @@ struct usb_operations { int (*allocate)(struct usb_device *); int (*deallocate)(struct usb_device *); int (*get_frame_number) (struct usb_device *usb_dev); - int (*submit_urb) (struct urb *urb); + int (*submit_urb) (struct urb *urb, int mem_flags); int (*unlink_urb) (struct urb *urb); }; diff --git a/include/linux/zconf.h b/include/linux/zconf.h new file mode 100644 index 000000000000..0b5ec883812b --- /dev/null +++ b/include/linux/zconf.h @@ -0,0 +1,90 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-1998 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef _ZCONF_H +#define _ZCONF_H + +#if defined(__GNUC__) || defined(__386__) || defined(i386) +# ifndef __32BIT__ +# define __32BIT__ +# endif +#endif + +#if defined(__STDC__) || defined(__cplusplus) +# ifndef STDC +# define STDC +# endif +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# define MAX_MEM_LEVEL 9 +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef FAR +# define FAR +#endif + +typedef unsigned char Byte; /* 8 bits */ +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +typedef Byte FAR Bytef; +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +typedef void FAR *voidpf; +typedef void *voidp; + +#include <linux/types.h> /* for off_t */ +#include <linux/unistd.h> /* for SEEK_* and off_t */ +#define z_off_t off_t + +#endif /* _ZCONF_H */ diff --git a/include/linux/zutil.h b/include/linux/zutil.h new file mode 100644 index 000000000000..a4a4d8d75f1e --- /dev/null +++ b/include/linux/zutil.h @@ -0,0 +1,126 @@ +/* zutil.h -- internal interface and configuration of the compression library + * Copyright (C) 1995-1998 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id: zutil.h,v 1.1 2000/01/01 03:32:23 davem Exp $ */ + +#ifndef _Z_UTIL_H +#define _Z_UTIL_H + +#include <linux/zlib.h> +#include <linux/string.h> +#include <linux/errno.h> +#include <linux/kernel.h> + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + + /* Common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + + /* functions */ + +typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, + uInt len)); + + + /* checksum functions */ + +#define BASE 65521L /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {s1 += buf[i]; s2 += s1;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* ========================================================================= */ +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ +static inline uLong zlib_adler32(uLong adler, + const Bytef *buf, + uInt len) +{ + unsigned long s1 = adler & 0xffff; + unsigned long s2 = (adler >> 16) & 0xffff; + int k; + + if (buf == Z_NULL) return 1L; + + while (len > 0) { + k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) { + DO16(buf); + buf += 16; + k -= 16; + } + if (k != 0) do { + s1 += *buf++; + s2 += s1; + } while (--k); + s1 %= BASE; + s2 %= BASE; + } + return (s2 << 16) | s1; +} + +#endif /* _Z_UTIL_H */ |
