diff options
| author | James Simmons <jsimmons@kozmo.(none)> | 2003-04-03 17:35:19 -0800 |
|---|---|---|
| committer | James Simmons <jsimmons@kozmo.(none)> | 2003-04-03 17:35:19 -0800 |
| commit | 87454c4a42191065c2333e57d37861de4ff10371 (patch) | |
| tree | d3c6798273b340bf14e9e726e9e3008a1b9e2007 /include/linux | |
| parent | f251e181dd850d1d87064afbf502b27bf6bf486e (diff) | |
| parent | 2c12e127559292eeabf121eb5ebd1593c9ec52c7 (diff) | |
Merge kozmo.(none):/usr/src/linus-2.5
into kozmo.(none):/usr/src/fbdev-2.5
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/atm.h | 11 | ||||
| -rw-r--r-- | include/linux/bio.h | 11 | ||||
| -rw-r--r-- | include/linux/dcache.h | 39 | ||||
| -rw-r--r-- | include/linux/dnotify.h | 19 | ||||
| -rw-r--r-- | include/linux/elf.h | 5 | ||||
| -rw-r--r-- | include/linux/fs.h | 6 | ||||
| -rw-r--r-- | include/linux/if_pppox.h | 2 | ||||
| -rw-r--r-- | include/linux/inet.h | 7 | ||||
| -rw-r--r-- | include/linux/ip.h | 4 | ||||
| -rw-r--r-- | include/linux/ipv6.h | 4 | ||||
| -rw-r--r-- | include/linux/jbd.h | 43 | ||||
| -rw-r--r-- | include/linux/net.h | 138 | ||||
| -rw-r--r-- | include/linux/netdevice.h | 1 | ||||
| -rw-r--r-- | include/linux/pfkeyv2.h | 30 | ||||
| -rw-r--r-- | include/linux/raid/md.h | 2 | ||||
| -rw-r--r-- | include/linux/raid/md_k.h | 1 | ||||
| -rw-r--r-- | include/linux/udp.h | 5 | ||||
| -rw-r--r-- | include/linux/umsdos_fs.h | 37 | ||||
| -rw-r--r-- | include/linux/xfrm.h | 7 |
19 files changed, 223 insertions, 149 deletions
diff --git a/include/linux/atm.h b/include/linux/atm.h index b5d4c29ba6c4..0380156f9c86 100644 --- a/include/linux/atm.h +++ b/include/linux/atm.h @@ -236,15 +236,4 @@ struct atmif_sioc { }; typedef unsigned short atm_backend_t; - -#ifdef __KERNEL__ - -#include <linux/net.h> /* struct net_proto */ - - -void atmpvc_proto_init(struct net_proto *pro); -void atmsvc_proto_init(struct net_proto *pro); - -#endif /* __KERNEL__ */ - #endif diff --git a/include/linux/bio.h b/include/linux/bio.h index 4eb82c8b33fb..19451364a58e 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -148,10 +148,11 @@ struct bio { * permanent PIO fall back, user is probably better off disabling highmem * I/O completely on that queue (see ide-dma for example) */ -#define __bio_kmap(bio, idx) (kmap(bio_iovec_idx((bio), (idx))->bv_page) + bio_iovec_idx((bio), (idx))->bv_offset) -#define bio_kmap(bio) __bio_kmap((bio), (bio)->bi_idx) -#define __bio_kunmap(bio, idx) kunmap(bio_iovec_idx((bio), (idx))->bv_page) -#define bio_kunmap(bio) __bio_kunmap((bio), (bio)->bi_idx) +#define __bio_kmap_atomic(bio, idx, kmtype) \ + (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page, kmtype) + \ + bio_iovec_idx((bio), (idx))->bv_offset) + +#define __bio_kunmap_atomic(addr, kmtype) kunmap_atomic(addr, kmtype) /* * merge helpers etc @@ -238,7 +239,7 @@ extern inline char *bio_kmap_irq(struct bio *bio, unsigned long *flags) * might not be a highmem page, but the preempt/irq count * balancing is a lot nicer this way */ - local_save_flags(*flags); + local_irq_save(*flags); addr = (unsigned long) kmap_atomic(bio_page(bio), KM_BIO_SRC_IRQ); if (addr & ~PAGE_MASK) diff --git a/include/linux/dcache.h b/include/linux/dcache.h index b8cc7693f3de..db979c3cf890 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -48,19 +48,24 @@ extern struct dentry_stat_t dentry_stat; #define init_name_hash() 0 /* partial hash update function. Assume roughly 4 bits per character */ -static __inline__ unsigned long partial_name_hash(unsigned long c, unsigned long prevhash) +static inline unsigned long +partial_name_hash(unsigned long c, unsigned long prevhash) { return (prevhash + (c << 4) + (c >> 4)) * 11; } -/* Finally: cut down the number of bits to a int value (and try to avoid losing bits) */ -static __inline__ unsigned long end_name_hash(unsigned long hash) +/* + * Finally: cut down the number of bits to a int value (and try to avoid + * losing bits) + */ +static inline unsigned long end_name_hash(unsigned long hash) { return (unsigned int) hash; } /* Compute the hash for a name string. */ -static __inline__ unsigned int full_name_hash(const unsigned char * name, unsigned int len) +static inline unsigned int +full_name_hash(const unsigned char *name, unsigned int len) { unsigned long hash = init_name_hash(); while (len--) @@ -149,7 +154,6 @@ d_iput: no no yes #define DCACHE_UNHASHED 0x0010 extern spinlock_t dcache_lock; -extern rwlock_t dparent_lock; /** * d_drop - drop a dentry @@ -168,20 +172,20 @@ extern rwlock_t dparent_lock; * timeouts or autofs deletes). */ -static __inline__ void __d_drop(struct dentry * dentry) +static inline void __d_drop(struct dentry *dentry) { dentry->d_vfs_flags |= DCACHE_UNHASHED; hlist_del_rcu(&dentry->d_hash); } -static __inline__ void d_drop(struct dentry * dentry) +static inline void d_drop(struct dentry *dentry) { spin_lock(&dcache_lock); __d_drop(dentry); spin_unlock(&dcache_lock); } -static __inline__ int dname_external(struct dentry *d) +static inline int dname_external(struct dentry *d) { return d->d_name.name != d->d_iname; } @@ -227,7 +231,7 @@ extern void d_rehash(struct dentry *); * The entry was actually filled in earlier during d_alloc(). */ -static __inline__ void d_add(struct dentry * entry, struct inode * inode) +static inline void d_add(struct dentry *entry, struct inode *inode) { d_instantiate(entry, inode); d_rehash(entry); @@ -238,6 +242,7 @@ extern void d_move(struct dentry *, struct dentry *); /* appendix may either be NULL or be used for transname suffixes */ extern struct dentry * d_lookup(struct dentry *, struct qstr *); +extern struct dentry * __d_lookup(struct dentry *, struct qstr *); /* validate "insecure" dentry pointer */ extern int d_validate(struct dentry *, struct dentry *); @@ -259,7 +264,7 @@ extern char * d_path(struct dentry *, struct vfsmount *, char *, int); * and call dget_locked() instead of dget(). */ -static __inline__ struct dentry * dget(struct dentry *dentry) +static inline struct dentry *dget(struct dentry *dentry) { if (dentry) { if (!atomic_read(&dentry->d_count)) @@ -279,14 +284,24 @@ extern struct dentry * dget_locked(struct dentry *); * Returns true if the dentry passed is not currently hashed. */ -static __inline__ int d_unhashed(struct dentry *dentry) +static inline int d_unhashed(struct dentry *dentry) { return (dentry->d_vfs_flags & DCACHE_UNHASHED); } +static inline struct dentry *dget_parent(struct dentry *dentry) +{ + struct dentry *ret; + + spin_lock(&dentry->d_lock); + ret = dget(dentry->d_parent); + spin_unlock(&dentry->d_lock); + return ret; +} + extern void dput(struct dentry *); -static __inline__ int d_mountpoint(struct dentry *dentry) +static inline int d_mountpoint(struct dentry *dentry) { return dentry->d_mounted; } diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h index 2db6774c9330..5cffeedac412 100644 --- a/include/linux/dnotify.h +++ b/include/linux/dnotify.h @@ -18,27 +18,10 @@ struct dnotify_struct { extern void __inode_dir_notify(struct inode *, unsigned long); extern void dnotify_flush(struct file *filp, fl_owner_t id); extern int fcntl_dirnotify(int, struct file *, unsigned long); +void dnotify_parent(struct dentry *dentry, unsigned long event); static inline void inode_dir_notify(struct inode *inode, unsigned long event) { if ((inode)->i_dnotify_mask & (event)) __inode_dir_notify(inode, event); } - -/* - * This is hopelessly wrong, but unfixable without API changes. At - * least it doesn't oops the kernel... - */ -static inline void dnotify_parent(struct dentry *dentry, unsigned long event) -{ - struct dentry *parent; - read_lock(&dparent_lock); - parent = dentry->d_parent; - if (parent->d_inode->i_dnotify_mask & event) { - dget(parent); - read_unlock(&dparent_lock); - __inode_dir_notify(parent->d_inode, event); - dput(parent); - } else - read_unlock(&dparent_lock); -} diff --git a/include/linux/elf.h b/include/linux/elf.h index 5945cb301e02..0a7a35e2722b 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -274,6 +274,10 @@ typedef struct { #define R_MIPS_LOVENDOR 100 #define R_MIPS_HIVENDOR 127 +/* + * Sparc section types + */ +#define STT_REGISTER 13 /* * Sparc ELF relocation types @@ -311,6 +315,7 @@ typedef struct { #define R_SPARC_10 30 #define R_SPARC_11 31 #define R_SPARC_64 32 +#define R_SPARC_OLO10 33 #define R_SPARC_WDISP16 40 #define R_SPARC_WDISP19 41 #define R_SPARC_7 43 diff --git a/include/linux/fs.h b/include/linux/fs.h index 5594259b2795..af3852b4281d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1112,6 +1112,7 @@ unsigned long invalidate_inode_pages(struct address_space *mapping); extern void invalidate_inode_pages2(struct address_space *mapping); extern void write_inode_now(struct inode *, int); extern int filemap_fdatawrite(struct address_space *); +extern int filemap_flush(struct address_space *); extern int filemap_fdatawait(struct address_space *); extern void sync_supers(void); extern void sync_filesystems(int wait); @@ -1305,9 +1306,10 @@ extern void inode_update_time(struct inode *inode, int ctime_too); static inline ino_t parent_ino(struct dentry *dentry) { ino_t res; - read_lock(&dparent_lock); + + spin_lock(&dentry->d_lock); res = dentry->d_parent->d_inode->i_ino; - read_unlock(&dparent_lock); + spin_unlock(&dentry->d_lock); return res; } diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index a4633c570266..948826892b82 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h @@ -158,8 +158,6 @@ enum { extern struct ppp_channel_ops pppoe_chan_ops; -extern int pppox_proto_init(struct net_proto *np); - #endif /* __KERNEL__ */ #endif /* !(__LINUX_IF_PPPOX_H) */ diff --git a/include/linux/inet.h b/include/linux/inet.h index ffbfe45a365d..af4fa41bd632 100644 --- a/include/linux/inet.h +++ b/include/linux/inet.h @@ -43,11 +43,6 @@ #define _LINUX_INET_H #ifdef __KERNEL__ - -#include <linux/net.h> - -extern void inet_proto_init(struct net_proto *pro); -extern __u32 in_aton(const char *str); - +extern __u32 in_aton(const char *str); #endif #endif /* _LINUX_INET_H */ diff --git a/include/linux/ip.h b/include/linux/ip.h index 1c26df3103a8..5d3212a73ace 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h @@ -188,13 +188,13 @@ struct ip_auth_hdr { __u16 reserved; __u32 spi; __u32 seq_no; /* Sequence number */ - __u8 auth_data[4]; /* Variable len but >=4. Mind the 64 bit alignment! */ + __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */ }; struct ip_esp_hdr { __u32 spi; __u32 seq_no; /* Sequence number */ - __u8 enc_data[8]; /* Variable len but >=8. Mind the 64 bit alignment! */ + __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */ }; #endif /* _LINUX_IP_H */ diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 647c40c96452..caab8bbc88fe 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -80,13 +80,13 @@ struct ipv6_auth_hdr { __u16 reserved; __u32 spi; __u32 seq_no; /* Sequence number */ - __u8 auth_data[4]; /* Length variable but >=4. Mind the 64 bit alignment! */ + __u8 auth_data[0]; /* Length variable but >=4. Mind the 64 bit alignment! */ }; struct ipv6_esp_hdr { __u32 spi; __u32 seq_no; /* Sequence number */ - __u8 enc_data[8]; /* Length variable but >=8. Mind the 64 bit alignment! */ + __u8 enc_data[0]; /* Length variable but >=8. Mind the 64 bit alignment! */ }; /* diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 0ffe50ade606..2cddeb1f450e 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -33,6 +33,15 @@ #define journal_oom_retry 1 +/* + * Define JBD_PARANIOD_IOFAIL to cause a kernel BUG() if ext3 finds + * certain classes of error which can occur due to failed IOs. Under + * normal use we want ext3 to continue after such errors, because + * hardware _can_ fail, but for debugging purposes when running tests on + * known-good hardware we may want to trap these errors. + */ +#undef JBD_PARANOID_IOFAIL + #ifdef CONFIG_JBD_DEBUG /* * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal @@ -257,6 +266,23 @@ void buffer_assertion_failure(struct buffer_head *bh); #define J_ASSERT(assert) do { } while (0) #endif /* JBD_ASSERTIONS */ +#if defined(JBD_PARANOID_IOFAIL) +#define J_EXPECT(expr, why...) J_ASSERT(expr) +#define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr) +#define J_EXPECT_JH(jh, expr, why...) J_ASSERT_JH(jh, expr) +#else +#define __journal_expect(expr, why...) \ + do { \ + if (!(expr)) { \ + printk(KERN_ERR "EXT3-fs unexpected failure: %s;\n", # expr); \ + printk(KERN_ERR ## why); \ + } \ + } while (0) +#define J_EXPECT(expr, why...) __journal_expect(expr, ## why) +#define J_EXPECT_BH(bh, expr, why...) __journal_expect(expr, ## why) +#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) +#endif + enum jbd_state_bits { BH_JBD /* Has an attached ext3 journal_head */ = BH_PrivateStart, @@ -788,6 +814,21 @@ extern void journal_remove_journal_head(struct buffer_head *bh); extern void __journal_remove_journal_head(struct buffer_head *bh); extern void journal_unlock_journal_head(struct journal_head *jh); +/* + * handle management + */ +extern kmem_cache_t *jbd_handle_cache; + +static inline handle_t *jbd_alloc_handle(int gfp_flags) +{ + return kmem_cache_alloc(jbd_handle_cache, gfp_flags); +} + +static inline void jbd_free_handle(handle_t *handle) +{ + kmem_cache_free(jbd_handle_cache, handle); +} + /* Primary revoke support */ #define JOURNAL_REVOKE_DEFAULT_HASH 256 extern int journal_init_revoke(journal_t *, int); @@ -814,7 +855,7 @@ extern void journal_brelse_array(struct buffer_head *b[], int n); extern int log_space_left (journal_t *); /* Called with journal locked */ extern tid_t log_start_commit (journal_t *, transaction_t *); -extern void log_wait_commit (journal_t *, tid_t); +extern int log_wait_commit (journal_t *, tid_t); extern int log_do_checkpoint (journal_t *, int); extern void log_wait_for_space(journal_t *, int nblocks); diff --git a/include/linux/net.h b/include/linux/net.h index ea530b53cd3b..55083c938298 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -27,7 +27,6 @@ struct inode; #define NPROTO 32 /* should be enough for now.. */ - #define SYS_SOCKET 1 /* sys_socket(2) */ #define SYS_BIND 2 /* sys_bind(2) */ #define SYS_CONNECT 3 /* sys_connect(2) */ @@ -46,16 +45,15 @@ struct inode; #define SYS_SENDMSG 16 /* sys_sendmsg(2) */ #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ - typedef enum { - SS_FREE = 0, /* not allocated */ - SS_UNCONNECTED, /* unconnected to any socket */ - SS_CONNECTING, /* in process of connecting */ - SS_CONNECTED, /* connected to socket */ - SS_DISCONNECTING /* in process of disconnecting */ + SS_FREE = 0, /* not allocated */ + SS_UNCONNECTED, /* unconnected to any socket */ + SS_CONNECTING, /* in process of connecting */ + SS_CONNECTED, /* connected to socket */ + SS_DISCONNECTING /* in process of disconnecting */ } socket_state; -#define __SO_ACCEPTCON (1<<16) /* performed a listen */ +#define __SO_ACCEPTCON (1 << 16) /* performed a listen */ #ifdef __KERNEL__ @@ -63,17 +61,26 @@ typedef enum { #define SOCK_ASYNC_WAITDATA 1 #define SOCK_NOSPACE 2 -struct socket -{ +/** + * struct socket - general BSD socket + * @state - socket state (%SS_CONNECTED, etc) + * @flags - socket flags (%SOCK_ASYNC_NOSPACE, etc) + * @ops - protocol specific socket operations + * @fasync_list - Asynchronous wake up list + * @file - File back pointer for gc + * @sk - internal networking protocol agnostic socket representation + * @wait - wait queue for several uses + * @type - socket type (%SOCK_STREAM, etc) + * @passcred - credentials (used only in Unix Sockets (aka PF_LOCAL)) + */ +struct socket { socket_state state; - unsigned long flags; struct proto_ops *ops; - struct fasync_struct *fasync_list; /* Asynchronous wake up list */ - struct file *file; /* File back pointer for gc */ + struct fasync_struct *fasync_list; + struct file *file; struct sock *sk; wait_queue_head_t wait; - short type; unsigned char passcred; }; @@ -83,37 +90,43 @@ struct page; struct kiocb; struct proto_ops { - int family; - - int (*release) (struct socket *sock); - int (*bind) (struct socket *sock, struct sockaddr *umyaddr, - int sockaddr_len); - int (*connect) (struct socket *sock, struct sockaddr *uservaddr, - int sockaddr_len, int flags); - int (*socketpair) (struct socket *sock1, struct socket *sock2); - int (*accept) (struct socket *sock, struct socket *newsock, - int flags); - int (*getname) (struct socket *sock, struct sockaddr *uaddr, - int *usockaddr_len, int peer); - unsigned int (*poll) (struct file *file, struct socket *sock, struct poll_table_struct *wait); - int (*ioctl) (struct socket *sock, unsigned int cmd, - unsigned long arg); - int (*listen) (struct socket *sock, int len); - int (*shutdown) (struct socket *sock, int flags); - int (*setsockopt) (struct socket *sock, int level, int optname, - char *optval, int optlen); - int (*getsockopt) (struct socket *sock, int level, int optname, - char *optval, int *optlen); - int (*sendmsg) (struct kiocb *iocb, struct socket *sock, - struct msghdr *m, int total_len); - int (*recvmsg) (struct kiocb *iocb, struct socket *sock, - struct msghdr *m, int total_len, int flags); - int (*mmap) (struct file *file, struct socket *sock, struct vm_area_struct * vma); - ssize_t (*sendpage) (struct socket *sock, struct page *page, int offset, size_t size, int flags); + int family; + int (*release) (struct socket *sock); + int (*bind) (struct socket *sock, + struct sockaddr *umyaddr, + int sockaddr_len); + int (*connect) (struct socket *sock, + struct sockaddr *uservaddr, + int sockaddr_len, int flags); + int (*socketpair)(struct socket *sock1, + struct socket *sock2); + int (*accept) (struct socket *sock, + struct socket *newsock, int flags); + int (*getname) (struct socket *sock, + struct sockaddr *uaddr, + int *usockaddr_len, int peer); + unsigned int (*poll) (struct file *file, struct socket *sock, + struct poll_table_struct *wait); + int (*ioctl) (struct socket *sock, unsigned int cmd, + unsigned long arg); + int (*listen) (struct socket *sock, int len); + int (*shutdown) (struct socket *sock, int flags); + int (*setsockopt)(struct socket *sock, int level, + int optname, char *optval, int optlen); + int (*getsockopt)(struct socket *sock, int level, + int optname, char *optval, int *optlen); + int (*sendmsg) (struct kiocb *iocb, struct socket *sock, + struct msghdr *m, int total_len); + int (*recvmsg) (struct kiocb *iocb, struct socket *sock, + struct msghdr *m, int total_len, + int flags); + int (*mmap) (struct file *file, struct socket *sock, + struct vm_area_struct * vma); + ssize_t (*sendpage) (struct socket *sock, struct page *page, + int offset, size_t size, int flags); }; -struct net_proto_family -{ +struct net_proto_family { int family; int (*create)(struct socket *sock, int protocol); /* These are counters for the number of different methods of @@ -123,30 +136,27 @@ struct net_proto_family short encrypt_net; }; -struct net_proto -{ - const char *name; /* Protocol name */ - void (*init_func)(struct net_proto *); /* Bootstrap */ -}; - -extern int sock_wake_async(struct socket *sk, int how, int band); -extern int sock_register(struct net_proto_family *fam); -extern int sock_unregister(int family); +extern int sock_wake_async(struct socket *sk, int how, int band); +extern int sock_register(struct net_proto_family *fam); +extern int sock_unregister(int family); extern struct socket *sock_alloc(void); -extern int sock_create(int family, int type, int proto, struct socket **); -extern void sock_release(struct socket *); -extern int sock_sendmsg(struct socket *, struct msghdr *m, int len); -extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags); -extern int sock_readv_writev(int type, struct inode * inode, struct file * file, - const struct iovec * iov, long count, long size); -extern int sock_map_fd(struct socket *sock); - +extern int sock_create(int family, int type, int proto, + struct socket **res); +extern void sock_release(struct socket *sock); +extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, + int len); +extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, + int size, int flags); +extern int sock_readv_writev(int type, struct inode *inode, + struct file *file, + const struct iovec *iov, long count, + long size); +extern int sock_map_fd(struct socket *sock); extern struct socket *sockfd_lookup(int fd, int *err); -#define sockfd_put(sock) fput(sock->file) - -extern int net_ratelimit(void); +#define sockfd_put(sock) fput(sock->file) +extern int net_ratelimit(void); extern unsigned long net_random(void); -extern void net_srandom(unsigned long); +extern void net_srandom(unsigned long); #ifndef CONFIG_SMP #define SOCKOPS_WRAPPED(name) name diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6e291c99688b..080084cc3afc 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -486,6 +486,7 @@ extern int dev_close(struct net_device *dev); extern int dev_queue_xmit(struct sk_buff *skb); extern int register_netdevice(struct net_device *dev); extern int unregister_netdevice(struct net_device *dev); +extern void synchronize_net(void); extern int register_netdevice_notifier(struct notifier_block *nb); extern int unregister_netdevice_notifier(struct notifier_block *nb); extern int call_netdevice_notifiers(unsigned long val, void *v); diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index efb41c857ea3..b5efb37a1c2f 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h @@ -194,6 +194,26 @@ struct sadb_x_ipsecrequest { } __attribute__((packed)); /* sizeof(struct sadb_x_ipsecrequest) == 16 */ +/* This defines the TYPE of Nat Traversal in use. Currently only one + * type of NAT-T is supported, draft-ietf-ipsec-udp-encaps-06 + */ +struct sadb_x_nat_t_type { + uint16_t sadb_x_nat_t_type_len; + uint16_t sadb_x_nat_t_type_exttype; + uint8_t sadb_x_nat_t_type_type; + uint8_t sadb_x_nat_t_type_reserved[3]; +} __attribute__((packed)); +/* sizeof(struct sadb_x_nat_t_type) == 8 */ + +/* Pass a NAT Traversal port (Source or Dest port) */ +struct sadb_x_nat_t_port { + uint16_t sadb_x_nat_t_port_len; + uint16_t sadb_x_nat_t_port_exttype; + uint16_t sadb_x_nat_t_port_port; + uint16_t sadb_x_nat_t_port_reserved; +} __attribute__((packed)); +/* sizeof(struct sadb_x_nat_t_port) == 8 */ + /* Message types */ #define SADB_RESERVED 0 #define SADB_GETSPI 1 @@ -218,7 +238,8 @@ struct sadb_x_ipsecrequest { #define SADB_X_SPDSETIDX 20 #define SADB_X_SPDEXPIRE 21 #define SADB_X_SPDDELETE2 22 -#define SADB_MAX 22 +#define SADB_X_NAT_T_NEW_MAPPING 23 +#define SADB_MAX 23 /* Security Association flags */ #define SADB_SAFLAGS_PFS 1 @@ -291,7 +312,12 @@ struct sadb_x_ipsecrequest { #define SADB_X_EXT_KMPRIVATE 17 #define SADB_X_EXT_POLICY 18 #define SADB_X_EXT_SA2 19 -#define SADB_EXT_MAX 19 +/* The next four entries are for setting up NAT Traversal */ +#define SADB_X_EXT_NAT_T_TYPE 20 +#define SADB_X_EXT_NAT_T_SPORT 21 +#define SADB_X_EXT_NAT_T_DPORT 22 +#define SADB_X_EXT_NAT_T_OA 23 +#define SADB_EXT_MAX 23 /* Identity Extension values */ #define SADB_IDENTTYPE_RESERVED 0 diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index 3d4faa9f7171..02ff30e5a187 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h @@ -61,8 +61,6 @@ #define MD_MINOR_VERSION 90 #define MD_PATCHLEVEL_VERSION 0 -extern sector_t md_size[MAX_MD_DEVS]; - extern inline char * bdev_partition_name (struct block_device *bdev) { return partition_name(bdev ? bdev->bd_dev : 0); diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c9716b27c04e..8a80a9ea69a0 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -203,6 +203,7 @@ struct mddev_s int raid_disks; int max_disks; sector_t size; /* used size of component devices */ + sector_t array_size; /* exported array size */ __u64 events; char uuid[16]; diff --git a/include/linux/udp.h b/include/linux/udp.h index 5bdb970a1b69..2cd62b5b79f3 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -30,10 +30,15 @@ struct udphdr { /* UDP socket options */ #define UDP_CORK 1 /* Never send partially complete segments */ +#define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ + +/* UDP encapsulation types */ +#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ struct udp_opt { int pending; /* Any pending frames ? */ unsigned int corkflag; /* Cork is required */ + __u16 encap_type; /* Is this an Encapsulation socket? */ /* * Following members retains the infomation to create a UDP header * when the socket is uncorked. diff --git a/include/linux/umsdos_fs.h b/include/linux/umsdos_fs.h index 8dcb93719cd7..67c25693db66 100644 --- a/include/linux/umsdos_fs.h +++ b/include/linux/umsdos_fs.h @@ -49,7 +49,7 @@ # else # define Printk(x) # endif -#endif +#endif /* __KERNEL__ */ struct umsdos_fake_info { @@ -70,8 +70,7 @@ struct umsdos_dirent { time_t atime; /* Access time */ time_t mtime; /* Last modification time */ time_t ctime; /* Creation time */ - dev_t rdev; /* major and minor number of a device */ - /* special file */ + unsigned short rdev; /* major and minor of a device special file */ umode_t mode; /* Standard UNIX permissions bits + type of */ char spare[12]; /* unused bytes for future extensions */ /* file, see linux/stat.h */ @@ -129,34 +128,32 @@ struct umsdos_info { struct umsdos_ioctl { struct dirent dos_dirent; struct umsdos_dirent umsdos_dirent; - /* The following structure is used to exchange some data - * with utilities (umsdos_progs/util/umsdosio.c). The first - * releases were using struct stat from "sys/stat.h". This was - * causing some problem for cross compilation of the kernel - * Since I am not really using the structure stat, but only some field - * of it, I have decided to replicate the structure here - * for compatibility with the binaries out there + /* The following structure is used to exchange some data with + * utilities (umsdos_progs/util/umsdosio.c). The first releases + * were using struct stat from "sys/stat.h". This was causing + * some problem for cross compilation of the kernel. + * Since I am not really using the structure stat, but only + * some fields of it, I have decided to replicate the structure + * here for compatibility with the binaries out there. * FIXME PTW 1998, this has probably changed */ struct { - dev_t st_dev; - unsigned short __pad1; - ino_t st_ino; - umode_t st_mode; + unsigned long st_dev; + ino_t st_ino; /* used */ + umode_t st_mode; /* used */ nlink_t st_nlink; __kernel_uid_t st_uid; __kernel_gid_t st_gid; - dev_t st_rdev; - unsigned short __pad2; - off_t st_size; + unsigned long st_rdev; + off_t st_size; /* used */ unsigned long st_blksize; unsigned long st_blocks; - time_t st_atime; + time_t st_atime; /* used */ unsigned long __unused1; - time_t st_mtime; + time_t st_mtime; /* used */ unsigned long __unused2; - time_t st_ctime; + time_t st_ctime; /* used */ unsigned long __unused3; uid_t st_uid32; gid_t st_gid32; diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 8b1ae0cc3ebe..46144681c5a7 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h @@ -130,12 +130,19 @@ struct xfrm_user_tmpl { __u32 calgos; }; +struct xfrm_encap_tmpl { + __u16 encap_type; + __u16 encap_sport; + __u16 encap_dport; +}; + /* Netlink message attributes. */ enum xfrm_attr_type_t { XFRMA_UNSPEC, XFRMA_ALG_AUTH, /* struct xfrm_algo */ XFRMA_ALG_CRYPT, /* struct xfrm_algo */ XFRMA_ALG_COMP, /* struct xfrm_algo */ + XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ #define XFRMA_MAX XFRMA_TMPL |
