summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2002-10-30 00:25:56 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-10-30 00:25:56 -0800
commitdc85a09d313235fd1dab3adeeb2f79142475b49e (patch)
tree41750fef3d2517ae01a889b5110dae1fd626c5b4 /include/linux
parent4c664ca51867c1d26d4a294db435584faad200e4 (diff)
parenta0e7d495df35797364092fedff52ec488ec702eb (diff)
Merge master.kernel.org:/home/davem/BK/net-2.5
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/eventpoll.h51
-rw-r--r--include/linux/fcblist.h71
-rw-r--r--include/linux/fs.h6
-rw-r--r--include/linux/gfp.h9
-rw-r--r--include/linux/kobject.h57
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mmzone.h17
-rw-r--r--include/linux/nfsd/cache.h4
-rw-r--r--include/linux/nfsd/export.h1
-rw-r--r--include/linux/nfsd/nfsd.h26
-rw-r--r--include/linux/nfsd/xdr.h13
-rw-r--r--include/linux/nfsd/xdr3.h12
-rw-r--r--include/linux/nfsd/xdr4.h5
-rw-r--r--include/linux/notifier.h6
-rw-r--r--include/linux/page-flags.h10
-rw-r--r--include/linux/pagemap.h7
-rw-r--r--include/linux/pagevec.h10
-rw-r--r--include/linux/pipe_fs_i.h4
-rw-r--r--include/linux/raid/md_k.h4
-rw-r--r--include/linux/rcupdate.h15
-rw-r--r--include/linux/sched.h22
-rw-r--r--include/linux/sonypi.h10
-rw-r--r--include/linux/sunrpc/svc.h110
-rw-r--r--include/linux/sys.h2
-rw-r--r--include/linux/sysfs.h29
-rw-r--r--include/linux/timer.h1
26 files changed, 396 insertions, 107 deletions
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
new file mode 100644
index 000000000000..c028d5b7576b
--- /dev/null
+++ b/include/linux/eventpoll.h
@@ -0,0 +1,51 @@
+/*
+ * include/linux/eventpoll.h ( Efficent event polling implementation )
+ * Copyright (C) 2001,...,2002 Davide Libenzi
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#ifndef _LINUX_EVENTPOLL_H
+#define _LINUX_EVENTPOLL_H
+
+
+#define EVENTPOLL_MINOR 124
+#define POLLFD_X_PAGE (PAGE_SIZE / sizeof(struct pollfd))
+#define MAX_FDS_IN_EVENTPOLL (1024 * 128)
+#define MAX_EVENTPOLL_PAGES (MAX_FDS_IN_EVENTPOLL / POLLFD_X_PAGE)
+#define EVENT_PAGE_INDEX(n) ((n) / POLLFD_X_PAGE)
+#define EVENT_PAGE_REM(n) ((n) % POLLFD_X_PAGE)
+#define EVENT_PAGE_OFFSET(n) (((n) % POLLFD_X_PAGE) * sizeof(struct pollfd))
+#define EP_FDS_PAGES(n) (((n) + POLLFD_X_PAGE - 1) / POLLFD_X_PAGE)
+#define EP_MAP_SIZE(n) (EP_FDS_PAGES(n) * PAGE_SIZE * 2)
+
+
+struct evpoll {
+ int ep_timeout;
+ unsigned long ep_resoff;
+};
+
+#define EP_ALLOC _IOR('P', 1, int)
+#define EP_POLL _IOWR('P', 2, struct evpoll)
+#define EP_FREE _IO('P', 3)
+#define EP_ISPOLLED _IOWR('P', 4, struct pollfd)
+
+#define EP_CTL_ADD 1
+#define EP_CTL_DEL 2
+#define EP_CTL_MOD 3
+
+
+asmlinkage int sys_epoll_create(int maxfds);
+asmlinkage int sys_epoll_ctl(int epfd, int op, int fd, unsigned int events);
+asmlinkage int sys_epoll_wait(int epfd, struct pollfd const **events, int timeout);
+
+
+
+#endif
+
diff --git a/include/linux/fcblist.h b/include/linux/fcblist.h
new file mode 100644
index 000000000000..85be93ae40fd
--- /dev/null
+++ b/include/linux/fcblist.h
@@ -0,0 +1,71 @@
+/*
+ * include/linux/fcblist.h ( File event callbacks handling )
+ * Copyright (C) 2001,...,2002 Davide Libenzi
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Davide Libenzi <davidel@xmailserver.org>
+ *
+ */
+
+#ifndef __LINUX_FCBLIST_H
+#define __LINUX_FCBLIST_H
+
+#include <linux/config.h>
+#include <linux/list.h>
+#include <linux/spinlock.h>
+#include <linux/fs.h>
+#include <linux/file.h>
+
+
+
+/* file callback notification events */
+#define ION_IN 1
+#define ION_OUT 2
+#define ION_HUP 3
+#define ION_ERR 4
+
+#define FCB_LOCAL_SIZE 4
+
+
+struct fcb_struct {
+ struct list_head llink;
+ void (*cbproc)(struct file *, void *, unsigned long *, long *);
+ void *data;
+ unsigned long local[FCB_LOCAL_SIZE];
+};
+
+
+extern long ion_band_table[];
+extern long poll_band_table[];
+
+
+void file_notify_event(struct file *filep, long *event);
+
+int file_notify_addcb(struct file *filep,
+ void (*cbproc)(struct file *, void *, unsigned long *, long *),
+ void *data);
+
+int file_notify_delcb(struct file *filep,
+ void (*cbproc)(struct file *, void *, unsigned long *, long *));
+
+void file_notify_cleanup(struct file *filep);
+
+
+static inline void file_notify_init(struct file *filep)
+{
+ rwlock_init(&filep->f_cblock);
+ INIT_LIST_HEAD(&filep->f_cblist);
+}
+
+static inline void file_send_notify(struct file *filep, long ioevt, long plevt)
+{
+ long event[] = { ioevt, plevt, -1 };
+
+ file_notify_event(filep, event);
+}
+
+#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5694a661878e..9a3e78ba7592 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -504,6 +504,10 @@ struct file {
/* needed for tty driver, and maybe others */
void *private_data;
+
+ /* file callback list */
+ rwlock_t f_cblock;
+ struct list_head f_cblist;
};
extern spinlock_t files_lock;
#define file_list_lock() spin_lock(&files_lock);
@@ -791,6 +795,8 @@ struct seq_file;
extern ssize_t vfs_read(struct file *, char *, size_t, loff_t *);
extern ssize_t vfs_write(struct file *, const char *, size_t, loff_t *);
+extern ssize_t vfs_readv(struct file *, struct iovec *, int, size_t, loff_t *);
+extern ssize_t vfs_writev(struct file *, const struct iovec *, int, size_t, loff_t *);
/*
* NOTE: write_inode, delete_inode, clear_inode, put_inode can be called
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 939f16910233..8e093813e4f7 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -17,6 +17,7 @@
#define __GFP_IO 0x40 /* Can start low memory physical IO? */
#define __GFP_HIGHIO 0x80 /* Can start high mem physical IO? */
#define __GFP_FS 0x100 /* Can call down to low-level FS? */
+#define __GFP_COLD 0x200 /* Cache-cold page required */
#define GFP_NOHIGHIO ( __GFP_WAIT | __GFP_IO)
#define GFP_NOIO ( __GFP_WAIT)
@@ -32,6 +33,7 @@
#define GFP_DMA __GFP_DMA
+
/*
* There is only one page-allocator function, and two main namespaces to
* it. The alloc_page*() variants return 'struct page *' and as such
@@ -77,13 +79,14 @@ extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask));
#define __get_dma_pages(gfp_mask, order) \
__get_free_pages((gfp_mask) | GFP_DMA,(order))
-/*
- * There is only one 'core' page-freeing function.
- */
extern void FASTCALL(__free_pages(struct page *page, unsigned int order));
extern void FASTCALL(free_pages(unsigned long addr, unsigned int order));
+extern void FASTCALL(free_hot_page(struct page *page));
+extern void FASTCALL(free_cold_page(struct page *page));
#define __free_page(page) __free_pages((page), 0)
#define free_page(addr) free_pages((addr),0)
+void page_alloc_init(void);
+
#endif /* __LINUX_GFP_H */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
new file mode 100644
index 000000000000..d2f0629a6189
--- /dev/null
+++ b/include/linux/kobject.h
@@ -0,0 +1,57 @@
+/*
+ * kobject.h - generic kernel object infrastructure.
+ *
+ */
+
+#ifndef _KOBJECT_H_
+#define _KOBJECT_H_
+
+#include <linux/types.h>
+#include <linux/list.h>
+#include <linux/sysfs.h>
+#include <linux/rwsem.h>
+#include <asm/atomic.h>
+
+struct kobject {
+ char name[16];
+ atomic_t refcount;
+ struct list_head entry;
+ struct kobject * parent;
+ struct subsystem * subsys;
+ struct dentry * dentry;
+};
+
+extern void kobject_init(struct kobject *);
+
+extern int kobject_register(struct kobject *);
+extern void kobject_unregister(struct kobject *);
+
+extern struct kobject * kobject_get(struct kobject *);
+extern void kobject_put(struct kobject *);
+
+
+struct subsystem {
+ struct kobject kobj;
+ struct list_head list;
+ struct rw_semaphore rwsem;
+ struct subsystem * parent;
+ void (*release)(struct kobject *);
+ struct sysfs_ops * sysfs_ops;
+ struct attribute ** default_attrs;
+};
+
+extern void subsystem_init(struct subsystem *);
+extern int subsystem_register(struct subsystem *);
+extern void subsystem_unregister(struct subsystem *);
+
+static inline struct subsystem * subsys_get(struct subsystem * s)
+{
+ return container_of(kobject_get(&s->kobj),struct subsystem,kobj);
+}
+
+static inline void subsys_put(struct subsystem * s)
+{
+ kobject_put(&s->kobj);
+}
+
+#endif /* _KOBJECT_H_ */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index cab2c4342047..d9d2f20732d4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -211,7 +211,6 @@ struct page {
#define set_page_count(p,v) atomic_set(&(p)->count, v)
extern void FASTCALL(__page_cache_release(struct page *));
-void FASTCALL(__free_pages_ok(struct page *page, unsigned int order));
static inline void put_page(struct page *page)
{
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 10c4ee968020..d80490b1265c 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -9,6 +9,7 @@
#include <linux/list.h>
#include <linux/wait.h>
#include <linux/cache.h>
+#include <linux/threads.h>
#include <asm/atomic.h>
#ifdef CONFIG_DISCONTIGMEM
#include <asm/numnodes.h>
@@ -46,6 +47,18 @@ struct zone_padding {
#define ZONE_PADDING(name)
#endif
+struct per_cpu_pages {
+ int count; /* number of pages in the list */
+ int low; /* low watermark, refill needed */
+ int high; /* high watermark, emptying needed */
+ int batch; /* chunk size for buddy add/remove */
+ struct list_head list; /* the list of pages */
+};
+
+struct per_cpu_pageset {
+ struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */
+} ____cacheline_aligned_in_smp;
+
/*
* On machines where it is needed (eg PCs) we divide physical memory
* into multiple physical zones. On a PC we have 3 zones:
@@ -107,6 +120,10 @@ struct zone {
unsigned long wait_table_size;
unsigned long wait_table_bits;
+ ZONE_PADDING(_pad3_)
+
+ struct per_cpu_pageset pageset[NR_CPUS];
+
/*
* Discontig memory support fields.
*/
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index ae2da13bed23..b780f9635930 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -32,12 +32,12 @@ struct svc_cacherep {
u32 c_vers;
unsigned long c_timestamp;
union {
- struct svc_buf u_buffer;
+ struct iovec u_vec;
u32 u_status;
} c_u;
};
-#define c_replbuf c_u.u_buffer
+#define c_replvec c_u.u_vec
#define c_replstat c_u.u_status
/* cache entry states */
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 4d692bb2797f..864e3b801f0f 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -83,6 +83,7 @@ struct svc_expkey {
*/
void nfsd_export_init(void);
void nfsd_export_shutdown(void);
+void nfsd_export_flush(void);
void exp_readlock(void);
void exp_readunlock(void);
struct svc_expkey * exp_find_key(struct auth_domain *clp,
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index c72354852e2b..1b8b01067391 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -48,16 +48,7 @@
* Callback function for readdir
*/
struct readdir_cd {
- struct svc_rqst * rqstp;
- struct svc_fh * dirfh;
- u32 * buffer;
- int buflen;
- u32 * offset; /* previous dirent->d_next */
- char plus; /* readdirplus */
- char eob; /* end of buffer */
- char dotonly;
- int nfserr; /* v4 only */
- u32 bmval[2]; /* v4 only */
+ int err; /* 0, nfserr, or nfserr_eof */
};
typedef int (*encode_dent_fn)(struct readdir_cd *, const char *,
int, loff_t, ino_t, unsigned int);
@@ -97,9 +88,9 @@ int nfsd_open(struct svc_rqst *, struct svc_fh *, int,
int, struct file *);
void nfsd_close(struct file *);
int nfsd_read(struct svc_rqst *, struct svc_fh *,
- loff_t, char *, unsigned long *);
+ loff_t, struct iovec *,int, unsigned long *);
int nfsd_write(struct svc_rqst *, struct svc_fh *,
- loff_t, char *, unsigned long, int *);
+ loff_t, struct iovec *,int, unsigned long, int *);
int nfsd_readlink(struct svc_rqst *, struct svc_fh *,
char *, int *);
int nfsd_symlink(struct svc_rqst *, struct svc_fh *,
@@ -117,9 +108,7 @@ int nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
int nfsd_truncate(struct svc_rqst *, struct svc_fh *,
unsigned long size);
int nfsd_readdir(struct svc_rqst *, struct svc_fh *,
- loff_t, encode_dent_fn,
- u32 *buffer, int *countp, u32 *verf,
- u32 *bmval);
+ loff_t *, struct readdir_cd *, encode_dent_fn);
int nfsd_statfs(struct svc_rqst *, struct svc_fh *,
struct statfs *);
@@ -180,10 +169,13 @@ void nfsd_lockd_shutdown(void);
#define nfserr_readdir_nospc __constant_htonl(NFSERR_READDIR_NOSPC)
#define nfserr_bad_xdr __constant_htonl(NFSERR_BAD_XDR)
-/* error code for internal use - if a request fails due to
- * kmalloc failure, it gets dropped. Client should resend eventually
+/* error codes for internal use */
+/* if a request fails due to kmalloc failure, it gets dropped.
+ * Client should resend eventually
*/
#define nfserr_dropit __constant_htonl(30000)
+/* end-of-file indicator in readdir */
+#define nfserr_eof __constant_htonl(30001)
/* Check for dir entries '.' and '..' */
#define isdotent(n, l) (l < 3 && n[0] == '.' && (l == 1 || n[1] == '.'))
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index d81b71fefe6d..97078834e430 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -29,16 +29,16 @@ struct nfsd_readargs {
struct svc_fh fh;
__u32 offset;
__u32 count;
- __u32 totalsize;
+ struct iovec vec[RPCSVC_MAXPAGES];
+ int vlen;
};
struct nfsd_writeargs {
svc_fh fh;
- __u32 beginoffset;
__u32 offset;
- __u32 totalcount;
- __u8 * data;
int len;
+ struct iovec vec[RPCSVC_MAXPAGES];
+ int vlen;
};
struct nfsd_createargs {
@@ -98,6 +98,11 @@ struct nfsd_readres {
struct nfsd_readdirres {
int count;
+
+ struct readdir_cd common;
+ u32 * buffer;
+ int buflen;
+ u32 * offset;
};
struct nfsd_statfsres {
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 35d167ad6cd2..1576a6db4a17 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -33,6 +33,8 @@ struct nfsd3_readargs {
struct svc_fh fh;
__u64 offset;
__u32 count;
+ struct iovec vec[RPCSVC_MAXPAGES];
+ int vlen;
};
struct nfsd3_writeargs {
@@ -40,8 +42,9 @@ struct nfsd3_writeargs {
__u64 offset;
__u32 count;
int stable;
- __u8 * data;
int len;
+ struct iovec vec[RPCSVC_MAXPAGES];
+ int vlen;
};
struct nfsd3_createargs {
@@ -156,6 +159,13 @@ struct nfsd3_readdirres {
struct svc_fh fh;
int count;
__u32 verf[2];
+
+ struct readdir_cd common;
+ u32 * buffer;
+ int buflen;
+ u32 * offset;
+ struct svc_rqst * rqstp;
+
};
struct nfsd3_fsstatres {
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 2bf2c5d3b24e..4238cb04ad90 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -185,6 +185,11 @@ struct nfsd4_readdir {
u32 rd_bmval[2]; /* request */
struct svc_rqst *rd_rqstp; /* response */
struct svc_fh * rd_fhp; /* response */
+
+ struct readdir_cd common;
+ u32 * buffer;
+ int buflen;
+ u32 * offset;
};
struct nfsd4_readlink {
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 05d2e7968646..f9638ff66bb9 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -60,7 +60,11 @@ extern int notifier_call_chain(struct notifier_block **n, unsigned long val, voi
#define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */
-#define CPU_ONLINE 0x0002 /* CPU (unsigned)v coming up */
+#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
+#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
+#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */
+#define CPU_OFFLINE 0x0005 /* CPU (unsigned)v offline (still scheduling) */
+#define CPU_DEAD 0x0006 /* CPU (unsigned)v dead */
#endif /* __KERNEL__ */
#endif /* _LINUX_NOTIFIER_H */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 5c770f49787a..282902bb9816 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -5,6 +5,8 @@
#ifndef PAGE_FLAGS_H
#define PAGE_FLAGS_H
+#include <linux/percpu.h>
+
/*
* Various page->flags bits:
*
@@ -73,7 +75,7 @@
* Global page accounting. One instance per CPU. Only unsigned longs are
* allowed.
*/
-extern struct page_state {
+struct page_state {
unsigned long nr_dirty;
unsigned long nr_writeback;
unsigned long nr_pagecache;
@@ -103,7 +105,9 @@ extern struct page_state {
unsigned long kswapd_steal;
unsigned long pageoutrun;
unsigned long allocstall;
-} ____cacheline_aligned_in_smp page_states[NR_CPUS];
+};
+
+DECLARE_PER_CPU(struct page_state, page_states);
extern void get_page_state(struct page_state *ret);
extern void get_full_page_state(struct page_state *ret);
@@ -111,7 +115,7 @@ extern void get_full_page_state(struct page_state *ret);
#define mod_page_state(member, delta) \
do { \
int cpu = get_cpu(); \
- page_states[cpu].member += (delta); \
+ per_cpu(page_states, cpu).member += (delta); \
put_cpu(); \
} while (0)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 1fe640eaf601..04751ceba493 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -24,13 +24,18 @@
#define page_cache_get(page) get_page(page)
#define page_cache_release(page) put_page(page)
-void release_pages(struct page **pages, int nr);
+void release_pages(struct page **pages, int nr, int cold);
static inline struct page *page_cache_alloc(struct address_space *x)
{
return alloc_pages(x->gfp_mask, 0);
}
+static inline struct page *page_cache_alloc_cold(struct address_space *x)
+{
+ return alloc_pages(x->gfp_mask|__GFP_COLD, 0);
+}
+
typedef int filler_t(void *, struct page *);
extern struct page * find_get_page(struct address_space *mapping,
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
index 0207270b0fe7..d149e0688b1e 100644
--- a/include/linux/pagevec.h
+++ b/include/linux/pagevec.h
@@ -12,6 +12,7 @@ struct address_space;
struct pagevec {
unsigned nr;
+ int cold;
struct page *pages[PAGEVEC_SIZE];
};
@@ -25,7 +26,13 @@ void pagevec_strip(struct pagevec *pvec);
unsigned int pagevec_lookup(struct pagevec *pvec, struct address_space *mapping,
pgoff_t start, unsigned int nr_pages);
-static inline void pagevec_init(struct pagevec *pvec)
+static inline void pagevec_init(struct pagevec *pvec, int cold)
+{
+ pvec->nr = 0;
+ pvec->cold = cold;
+}
+
+static inline void pagevec_reinit(struct pagevec *pvec)
{
pvec->nr = 0;
}
@@ -49,6 +56,7 @@ static inline unsigned pagevec_add(struct pagevec *pvec, struct page *page)
return pagevec_space(pvec);
}
+
static inline void pagevec_release(struct pagevec *pvec)
{
if (pagevec_count(pvec))
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 407c0e0b3e84..bdf0a3686916 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -12,6 +12,8 @@ struct pipe_inode_info {
unsigned int waiting_writers;
unsigned int r_counter;
unsigned int w_counter;
+ struct file *rdfile;
+ struct file *wrfile;
struct fasync_struct *fasync_readers;
struct fasync_struct *fasync_writers;
};
@@ -30,6 +32,8 @@ struct pipe_inode_info {
#define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers)
#define PIPE_RCOUNTER(inode) ((inode).i_pipe->r_counter)
#define PIPE_WCOUNTER(inode) ((inode).i_pipe->w_counter)
+#define PIPE_READFILE(inode) ((inode).i_pipe->rdfile)
+#define PIPE_WRITEFILE(inode) ((inode).i_pipe->wrfile)
#define PIPE_FASYNC_READERS(inode) (&((inode).i_pipe->fasync_readers))
#define PIPE_FASYNC_WRITERS(inode) (&((inode).i_pipe->fasync_writers))
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 453324c18bdd..f658735d28b2 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -151,8 +151,9 @@ struct mdk_rdev_s
struct block_device *bdev; /* block device handle */
struct page *sb_page;
- mdp_super_t *sb;
+ int sb_loaded;
sector_t sb_offset;
+ int preferred_minor; /* autorun support */
/* A device can be in one of three states based on two flags:
* Not working: faulty==1 in_sync==0
@@ -196,6 +197,7 @@ struct mddev_s
time_t ctime, utime;
int level, layout;
int raid_disks;
+ int max_disks;
unsigned long state;
sector_t size; /* used size of component devices */
__u64 events;
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index a5ffb7bb5743..e9e2287e1e1c 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -39,6 +39,7 @@
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/threads.h>
+#include <linux/percpu.h>
/**
* struct rcu_head - callback structure for use with RCU
@@ -94,16 +95,16 @@ struct rcu_data {
long batch; /* Batch # for current RCU batch */
struct list_head nxtlist;
struct list_head curlist;
-} ____cacheline_aligned_in_smp;
+};
-extern struct rcu_data rcu_data[NR_CPUS];
+DECLARE_PER_CPU(struct rcu_data, rcu_data);
extern struct rcu_ctrlblk rcu_ctrlblk;
-#define RCU_qsctr(cpu) (rcu_data[(cpu)].qsctr)
-#define RCU_last_qsctr(cpu) (rcu_data[(cpu)].last_qsctr)
-#define RCU_batch(cpu) (rcu_data[(cpu)].batch)
-#define RCU_nxtlist(cpu) (rcu_data[(cpu)].nxtlist)
-#define RCU_curlist(cpu) (rcu_data[(cpu)].curlist)
+#define RCU_qsctr(cpu) (per_cpu(rcu_data, (cpu)).qsctr)
+#define RCU_last_qsctr(cpu) (per_cpu(rcu_data, (cpu)).last_qsctr)
+#define RCU_batch(cpu) (per_cpu(rcu_data, (cpu)).batch)
+#define RCU_nxtlist(cpu) (per_cpu(rcu_data, (cpu)).nxtlist)
+#define RCU_curlist(cpu) (per_cpu(rcu_data, (cpu)).curlist)
#define RCU_QSCTR_INVALID 0
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b5e63d8ade25..65f9799aa896 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -293,9 +293,6 @@ struct task_struct {
struct list_head ptrace_list;
struct mm_struct *mm, *active_mm;
- struct list_head local_pages;
-
- unsigned int allocation_order, nr_local_pages;
/* task state */
struct linux_binfmt *binfmt;
@@ -411,16 +408,15 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
#define PF_SIGNALED 0x00000400 /* killed by a signal */
#define PF_MEMALLOC 0x00000800 /* Allocating memory */
#define PF_MEMDIE 0x00001000 /* Killed for out-of-memory */
-#define PF_FREE_PAGES 0x00002000 /* per process page freeing */
-#define PF_FLUSHER 0x00004000 /* responsible for disk writeback */
-#define PF_NOWARN 0x00008000 /* debug: don't warn if alloc fails */
-
-#define PF_FREEZE 0x00010000 /* this task should be frozen for suspend */
-#define PF_IOTHREAD 0x00020000 /* this thread is needed for doing I/O to swap */
-#define PF_FROZEN 0x00040000 /* frozen for system suspend */
-#define PF_SYNC 0x00080000 /* performing fsync(), etc */
-#define PF_FSTRANS 0x00100000 /* inside a filesystem transaction */
-#define PF_KSWAPD 0x00200000 /* I am kswapd */
+#define PF_FLUSHER 0x00002000 /* responsible for disk writeback */
+#define PF_NOWARN 0x00004000 /* debug: don't warn if alloc fails */
+
+#define PF_FREEZE 0x00008000 /* this task should be frozen for suspend */
+#define PF_IOTHREAD 0x00010000 /* this thread is needed for doing I/O to swap */
+#define PF_FROZEN 0x00020000 /* frozen for system suspend */
+#define PF_SYNC 0x00040000 /* performing fsync(), etc */
+#define PF_FSTRANS 0x00080000 /* inside a filesystem transaction */
+#define PF_KSWAPD 0x00100000 /* I am kswapd */
/*
* Ptrace flags
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 4a53f5b8852a..8828b98b3029 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -75,6 +75,16 @@
#define SONYPI_EVENT_LID_OPENED 37
#define SONYPI_EVENT_BLUETOOTH_ON 38
#define SONYPI_EVENT_BLUETOOTH_OFF 39
+#define SONYPI_EVENT_HELP_PRESSED 40
+#define SONYPI_EVENT_FNKEY_ONLY 41
+#define SONYPI_EVENT_JOGDIAL_FAST_DOWN 42
+#define SONYPI_EVENT_JOGDIAL_FAST_UP 43
+#define SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED 44
+#define SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED 45
+#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN 46
+#define SONYPI_EVENT_JOGDIAL_VFAST_UP 47
+#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED 48
+#define SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED 49
/* get/set brightness */
#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 9ad879d9bea7..24464d66411a 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -48,43 +48,49 @@ struct svc_serv {
* This is use to determine the max number of pages nfsd is
* willing to return in a single READ operation.
*/
-#define RPCSVC_MAXPAYLOAD 16384u
+#define RPCSVC_MAXPAYLOAD (64*1024u)
/*
- * Buffer to store RPC requests or replies in.
- * Each server thread has one of these beasts.
+ * RPC Requsts and replies are stored in one or more pages.
+ * We maintain an array of pages for each server thread.
+ * Requests are copied into these pages as they arrive. Remaining
+ * pages are available to write the reply into.
*
- * Area points to the allocated memory chunk currently owned by the
- * buffer. Base points to the buffer containing the request, which is
- * different from area when directly reading from an sk_buff. buf is
- * the current read/write position while processing an RPC request.
+ * Currently pages are all re-used by the same server. Later we
+ * will use ->sendpage to transmit pages with reduced copying. In
+ * that case we will need to give away the page and allocate new ones.
+ * In preparation for this, we explicitly move pages off the recv
+ * list onto the transmit list, and back.
*
- * The array of iovecs can hold additional data that the server process
- * may not want to copy into the RPC reply buffer, but pass to the
- * network sendmsg routines directly. The prime candidate for this
- * will of course be NFS READ operations, but one might also want to
- * do something about READLINK and READDIR. It might be worthwhile
- * to implement some generic readdir cache in the VFS layer...
+ * We use xdr_buf for holding responses as it fits well with NFS
+ * read responses (that have a header, and some data pages, and possibly
+ * a tail) and means we can share some client side routines.
*
- * On the receiving end of the RPC server, the iovec may be used to hold
- * the list of IP fragments once we get to process fragmented UDP
- * datagrams directly.
+ * The xdr_buf.head iovec always points to the first page in the rq_*pages
+ * list. The xdr_buf.pages pointer points to the second page on that
+ * list. xdr_buf.tail points to the end of the first page.
+ * This assumes that the non-page part of an rpc reply will fit
+ * in a page - NFSd ensures this. lockd also has no trouble.
*/
-#define RPCSVC_MAXIOV ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 1)
-struct svc_buf {
- u32 * area; /* allocated memory */
- u32 * base; /* base of RPC datagram */
- int buflen; /* total length of buffer */
- u32 * buf; /* read/write pointer */
- int len; /* current end of buffer */
-
- /* iovec for zero-copy NFS READs */
- struct iovec iov[RPCSVC_MAXIOV];
- int nriov;
-};
-#define svc_getu32(argp, val) { (val) = *(argp)->buf++; (argp)->len--; }
-#define svc_putu32(resp, val) { *(resp)->buf++ = (val); (resp)->len++; }
+#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 1)
+
+static inline u32 svc_getu32(struct iovec *iov)
+{
+ u32 val, *vp;
+ vp = iov->iov_base;
+ val = *vp++;
+ iov->iov_base = (void*)vp;
+ iov->iov_len -= sizeof(u32);
+ return val;
+}
+static inline void svc_putu32(struct iovec *iov, u32 val)
+{
+ u32 *vp = iov->iov_base + iov->iov_len;
+ *vp = val;
+ iov->iov_len += sizeof(u32);
+}
+
/*
* The context of a single thread, including the request currently being
* processed.
@@ -102,9 +108,15 @@ struct svc_rqst {
struct svc_cred rq_cred; /* auth info */
struct sk_buff * rq_skbuff; /* fast recv inet buffer */
struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */
- struct svc_buf rq_defbuf; /* default buffer */
- struct svc_buf rq_argbuf; /* argument buffer */
- struct svc_buf rq_resbuf; /* result buffer */
+
+ struct xdr_buf rq_arg;
+ struct xdr_buf rq_res;
+ struct page * rq_argpages[RPCSVC_MAXPAGES];
+ struct page * rq_respages[RPCSVC_MAXPAGES];
+ short rq_argused; /* pages used for argument */
+ short rq_arghi; /* pages available in argument page list */
+ short rq_resused; /* pages used for result */
+
u32 rq_xid; /* transmission id */
u32 rq_prog; /* program number */
u32 rq_vers; /* program version */
@@ -136,6 +148,38 @@ struct svc_rqst {
wait_queue_head_t rq_wait; /* synchronization */
};
+/*
+ * Check buffer bounds after decoding arguments
+ */
+static inline int
+xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
+{
+ char *cp = (char *)p;
+ struct iovec *vec = &rqstp->rq_arg.head[0];
+ return cp - (char*)vec->iov_base <= vec->iov_len;
+}
+
+static inline int
+xdr_ressize_check(struct svc_rqst *rqstp, u32 *p)
+{
+ struct iovec *vec = &rqstp->rq_res.head[0];
+ char *cp = (char*)p;
+
+ vec->iov_len = cp - (char*)vec->iov_base;
+ rqstp->rq_res.len = vec->iov_len;
+
+ return vec->iov_len <= PAGE_SIZE;
+}
+
+static int inline take_page(struct svc_rqst *rqstp)
+{
+ if (rqstp->rq_arghi <= rqstp->rq_argused)
+ return -ENOMEM;
+ rqstp->rq_respages[rqstp->rq_resused++] =
+ rqstp->rq_argpages[--rqstp->rq_arghi];
+ return 0;
+}
+
struct svc_deferred_req {
struct svc_serv *serv;
u32 prot; /* protocol (UDP or TCP) */
diff --git a/include/linux/sys.h b/include/linux/sys.h
index dcd3256684cf..95b431dbebff 100644
--- a/include/linux/sys.h
+++ b/include/linux/sys.h
@@ -4,7 +4,7 @@
/*
* system call entry points ... but not all are defined
*/
-#define NR_syscalls 256
+#define NR_syscalls 260
/*
* These are system calls that will be removed at some time
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 6479902e1d20..7a46c9f0c308 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -11,19 +11,11 @@
struct driver_dir_entry;
struct attribute;
+struct kobject;
struct sysfs_ops {
- int (*open)(struct driver_dir_entry *);
- int (*close)(struct driver_dir_entry *);
- ssize_t (*show)(struct driver_dir_entry *, struct attribute *,char *, size_t, loff_t);
- ssize_t (*store)(struct driver_dir_entry *,struct attribute *,const char *, size_t, loff_t);
-};
-
-struct driver_dir_entry {
- char * name;
- struct dentry * dentry;
- mode_t mode;
- struct sysfs_ops * ops;
+ ssize_t (*show)(struct kobject *, struct attribute *,char *, size_t, loff_t);
+ ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t, loff_t);
};
struct attribute {
@@ -32,20 +24,21 @@ struct attribute {
};
extern int
-sysfs_create_dir(struct driver_dir_entry *, struct driver_dir_entry *);
+sysfs_create_dir(struct kobject *);
extern void
-sysfs_remove_dir(struct driver_dir_entry * entry);
+sysfs_remove_dir(struct kobject *);
extern int
-sysfs_create_file(struct attribute * attr,
- struct driver_dir_entry * parent);
+sysfs_create_file(struct kobject *, struct attribute *);
+
+extern void
+sysfs_remove_file(struct kobject *, struct attribute *);
extern int
-sysfs_create_symlink(struct driver_dir_entry * parent,
- char * name, char * target);
+sysfs_create_link(struct kobject * kobj, struct kobject * target, char * name);
extern void
-sysfs_remove_file(struct driver_dir_entry *, const char * name);
+sysfs_remove_link(struct kobject *, char * name);
#endif /* _SYSFS_H_ */
diff --git a/include/linux/timer.h b/include/linux/timer.h
index cfedb5e8bb07..d8ed753c8caa 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -44,6 +44,7 @@ static inline int timer_pending(const struct timer_list * timer)
}
extern void add_timer(struct timer_list * timer);
+extern void add_timer_on(struct timer_list *timer, int cpu);
extern int del_timer(struct timer_list * timer);
extern int mod_timer(struct timer_list *timer, unsigned long expires);