aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bitops.h124
-rw-r--r--include/linux/buffer_head.h26
-rw-r--r--include/linux/compat.h28
-rw-r--r--include/linux/efi.h20
-rw-r--r--include/linux/ext3_fs.h11
-rw-r--r--include/linux/fs.h24
-rw-r--r--include/linux/gameport.h4
-rw-r--r--include/linux/gigaset_dev.h32
-rw-r--r--include/linux/highmem.h12
-rw-r--r--include/linux/hpet.h36
-rw-r--r--include/linux/hrtimer.h41
-rw-r--r--include/linux/i2o.h4
-rw-r--r--include/linux/ipmi.h3
-rw-r--r--include/linux/ipmi_msgdefs.h1
-rw-r--r--include/linux/ipmi_smi.h47
-rw-r--r--include/linux/jbd.h2
-rw-r--r--include/linux/ktime.h20
-rw-r--r--include/linux/mempool.h38
-rw-r--r--include/linux/proc_fs.h5
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/serio.h6
-rw-r--r--include/linux/smp.h6
-rw-r--r--include/linux/stat.h2
-rw-r--r--include/linux/statfs.h10
-rw-r--r--include/linux/time.h18
-rw-r--r--include/linux/timer.h3
-rw-r--r--include/linux/timex.h2
-rw-r--r--include/linux/types.h4
28 files changed, 278 insertions, 252 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index f17525a963d1..5d1eabcde5d5 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -3,88 +3,11 @@
3#include <asm/types.h> 3#include <asm/types.h>
4 4
5/* 5/*
6 * ffs: find first bit set. This is defined the same way as
7 * the libc and compiler builtin ffs routines, therefore
8 * differs in spirit from the above ffz (man ffs).
9 */
10
11static inline int generic_ffs(int x)
12{
13 int r = 1;
14
15 if (!x)
16 return 0;
17 if (!(x & 0xffff)) {
18 x >>= 16;
19 r += 16;
20 }
21 if (!(x & 0xff)) {
22 x >>= 8;
23 r += 8;
24 }
25 if (!(x & 0xf)) {
26 x >>= 4;
27 r += 4;
28 }
29 if (!(x & 3)) {
30 x >>= 2;
31 r += 2;
32 }
33 if (!(x & 1)) {
34 x >>= 1;
35 r += 1;
36 }
37 return r;
38}
39
40/*
41 * fls: find last bit set.
42 */
43
44static __inline__ int generic_fls(int x)
45{
46 int r = 32;
47
48 if (!x)
49 return 0;
50 if (!(x & 0xffff0000u)) {
51 x <<= 16;
52 r -= 16;
53 }
54 if (!(x & 0xff000000u)) {
55 x <<= 8;
56 r -= 8;
57 }
58 if (!(x & 0xf0000000u)) {
59 x <<= 4;
60 r -= 4;
61 }
62 if (!(x & 0xc0000000u)) {
63 x <<= 2;
64 r -= 2;
65 }
66 if (!(x & 0x80000000u)) {
67 x <<= 1;
68 r -= 1;
69 }
70 return r;
71}
72
73/*
74 * Include this here because some architectures need generic_ffs/fls in 6 * Include this here because some architectures need generic_ffs/fls in
75 * scope 7 * scope
76 */ 8 */
77#include <asm/bitops.h> 9#include <asm/bitops.h>
78 10
79
80static inline int generic_fls64(__u64 x)
81{
82 __u32 h = x >> 32;
83 if (h)
84 return fls(h) + 32;
85 return fls(x);
86}
87
88static __inline__ int get_bitmask_order(unsigned int count) 11static __inline__ int get_bitmask_order(unsigned int count)
89{ 12{
90 int order; 13 int order;
@@ -103,54 +26,9 @@ static __inline__ int get_count_order(unsigned int count)
103 return order; 26 return order;
104} 27}
105 28
106/*
107 * hweightN: returns the hamming weight (i.e. the number
108 * of bits set) of a N-bit word
109 */
110
111static inline unsigned int generic_hweight32(unsigned int w)
112{
113 unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
114 res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
115 res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F);
116 res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF);
117 return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF);
118}
119
120static inline unsigned int generic_hweight16(unsigned int w)
121{
122 unsigned int res = (w & 0x5555) + ((w >> 1) & 0x5555);
123 res = (res & 0x3333) + ((res >> 2) & 0x3333);
124 res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F);
125 return (res & 0x00FF) + ((res >> 8) & 0x00FF);
126}
127
128static inline unsigned int generic_hweight8(unsigned int w)
129{
130 unsigned int res = (w & 0x55) + ((w >> 1) & 0x55);
131 res = (res & 0x33) + ((res >> 2) & 0x33);
132 return (res & 0x0F) + ((res >> 4) & 0x0F);
133}
134
135static inline unsigned long generic_hweight64(__u64 w)
136{
137#if BITS_PER_LONG < 64
138 return generic_hweight32((unsigned int)(w >> 32)) +
139 generic_hweight32((unsigned int)w);
140#else
141 u64 res;
142 res = (w & 0x5555555555555555ul) + ((w >> 1) & 0x5555555555555555ul);
143 res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul);
144 res = (res & 0x0F0F0F0F0F0F0F0Ful) + ((res >> 4) & 0x0F0F0F0F0F0F0F0Ful);
145 res = (res & 0x00FF00FF00FF00FFul) + ((res >> 8) & 0x00FF00FF00FF00FFul);
146 res = (res & 0x0000FFFF0000FFFFul) + ((res >> 16) & 0x0000FFFF0000FFFFul);
147 return (res & 0x00000000FFFFFFFFul) + ((res >> 32) & 0x00000000FFFFFFFFul);
148#endif
149}
150
151static inline unsigned long hweight_long(unsigned long w) 29static inline unsigned long hweight_long(unsigned long w)
152{ 30{
153 return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w); 31 return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
154} 32}
155 33
156/* 34/*
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 9f159baf153f..fb7e9b7ccbe3 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -46,25 +46,28 @@ struct address_space;
46typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); 46typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
47 47
48/* 48/*
49 * Keep related fields in common cachelines. The most commonly accessed 49 * Historically, a buffer_head was used to map a single block
50 * field (b_state) goes at the start so the compiler does not generate 50 * within a page, and of course as the unit of I/O through the
51 * indexed addressing for it. 51 * filesystem and block layers. Nowadays the basic I/O unit
52 * is the bio, and buffer_heads are used for extracting block
53 * mappings (via a get_block_t call), for tracking state within
54 * a page (via a page_mapping) and for wrapping bio submission
55 * for backward compatibility reasons (e.g. submit_bh).
52 */ 56 */
53struct buffer_head { 57struct buffer_head {
54 /* First cache line: */
55 unsigned long b_state; /* buffer state bitmap (see above) */ 58 unsigned long b_state; /* buffer state bitmap (see above) */
56 struct buffer_head *b_this_page;/* circular list of page's buffers */ 59 struct buffer_head *b_this_page;/* circular list of page's buffers */
57 struct page *b_page; /* the page this bh is mapped to */ 60 struct page *b_page; /* the page this bh is mapped to */
58 atomic_t b_count; /* users using this block */
59 u32 b_size; /* block size */
60 61
61 sector_t b_blocknr; /* block number */ 62 sector_t b_blocknr; /* start block number */
62 char *b_data; /* pointer to data block */ 63 size_t b_size; /* size of mapping */
64 char *b_data; /* pointer to data within the page */
63 65
64 struct block_device *b_bdev; 66 struct block_device *b_bdev;
65 bh_end_io_t *b_end_io; /* I/O completion */ 67 bh_end_io_t *b_end_io; /* I/O completion */
66 void *b_private; /* reserved for b_end_io */ 68 void *b_private; /* reserved for b_end_io */
67 struct list_head b_assoc_buffers; /* associated with another mapping */ 69 struct list_head b_assoc_buffers; /* associated with another mapping */
70 atomic_t b_count; /* users using this buffer_head */
68}; 71};
69 72
70/* 73/*
@@ -189,8 +192,8 @@ extern int buffer_heads_over_limit;
189 * address_spaces. 192 * address_spaces.
190 */ 193 */
191int try_to_release_page(struct page * page, gfp_t gfp_mask); 194int try_to_release_page(struct page * page, gfp_t gfp_mask);
192int block_invalidatepage(struct page *page, unsigned long offset); 195void block_invalidatepage(struct page *page, unsigned long offset);
193int do_invalidatepage(struct page *page, unsigned long offset); 196void do_invalidatepage(struct page *page, unsigned long offset);
194int block_write_full_page(struct page *page, get_block_t *get_block, 197int block_write_full_page(struct page *page, get_block_t *get_block,
195 struct writeback_control *wbc); 198 struct writeback_control *wbc);
196int block_read_full_page(struct page*, get_block_t*); 199int block_read_full_page(struct page*, get_block_t*);
@@ -200,7 +203,7 @@ int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*,
200int generic_cont_expand(struct inode *inode, loff_t size); 203int generic_cont_expand(struct inode *inode, loff_t size);
201int generic_cont_expand_simple(struct inode *inode, loff_t size); 204int generic_cont_expand_simple(struct inode *inode, loff_t size);
202int block_commit_write(struct page *page, unsigned from, unsigned to); 205int block_commit_write(struct page *page, unsigned from, unsigned to);
203int block_sync_page(struct page *); 206void block_sync_page(struct page *);
204sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 207sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
205int generic_commit_write(struct file *, struct page *, unsigned, unsigned); 208int generic_commit_write(struct file *, struct page *, unsigned, unsigned);
206int block_truncate_page(struct address_space *, loff_t, get_block_t *); 209int block_truncate_page(struct address_space *, loff_t, get_block_t *);
@@ -277,6 +280,7 @@ map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block)
277 set_buffer_mapped(bh); 280 set_buffer_mapped(bh);
278 bh->b_bdev = sb->s_bdev; 281 bh->b_bdev = sb->s_bdev;
279 bh->b_blocknr = block; 282 bh->b_blocknr = block;
283 bh->b_size = sb->s_blocksize;
280} 284}
281 285
282/* 286/*
diff --git a/include/linux/compat.h b/include/linux/compat.h
index c9ab2a26348c..24d659cdbafe 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -45,6 +45,32 @@ struct compat_tms {
45 compat_clock_t tms_cstime; 45 compat_clock_t tms_cstime;
46}; 46};
47 47
48struct compat_timex {
49 compat_uint_t modes;
50 compat_long_t offset;
51 compat_long_t freq;
52 compat_long_t maxerror;
53 compat_long_t esterror;
54 compat_int_t status;
55 compat_long_t constant;
56 compat_long_t precision;
57 compat_long_t tolerance;
58 struct compat_timeval time;
59 compat_long_t tick;
60 compat_long_t ppsfreq;
61 compat_long_t jitter;
62 compat_int_t shift;
63 compat_long_t stabil;
64 compat_long_t jitcnt;
65 compat_long_t calcnt;
66 compat_long_t errcnt;
67 compat_long_t stbcnt;
68
69 compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32;
70 compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32;
71 compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32;
72};
73
48#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) 74#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
49 75
50typedef struct { 76typedef struct {
@@ -181,5 +207,7 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs,
181 return lhs->tv_nsec - rhs->tv_nsec; 207 return lhs->tv_nsec - rhs->tv_nsec;
182} 208}
183 209
210asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
211
184#endif /* CONFIG_COMPAT */ 212#endif /* CONFIG_COMPAT */
185#endif /* _LINUX_COMPAT_H */ 213#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index c7c5dd316182..e203613d3aec 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -240,19 +240,21 @@ struct efi_memory_map {
240 unsigned long desc_size; 240 unsigned long desc_size;
241}; 241};
242 242
243#define EFI_INVALID_TABLE_ADDR (~0UL)
244
243/* 245/*
244 * All runtime access to EFI goes through this structure: 246 * All runtime access to EFI goes through this structure:
245 */ 247 */
246extern struct efi { 248extern struct efi {
247 efi_system_table_t *systab; /* EFI system table */ 249 efi_system_table_t *systab; /* EFI system table */
248 void *mps; /* MPS table */ 250 unsigned long mps; /* MPS table */
249 void *acpi; /* ACPI table (IA64 ext 0.71) */ 251 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */
250 void *acpi20; /* ACPI table (ACPI 2.0) */ 252 unsigned long acpi20; /* ACPI table (ACPI 2.0) */
251 void *smbios; /* SM BIOS table */ 253 unsigned long smbios; /* SM BIOS table */
252 void *sal_systab; /* SAL system table */ 254 unsigned long sal_systab; /* SAL system table */
253 void *boot_info; /* boot info table */ 255 unsigned long boot_info; /* boot info table */
254 void *hcdp; /* HCDP table */ 256 unsigned long hcdp; /* HCDP table */
255 void *uga; /* UGA table */ 257 unsigned long uga; /* UGA table */
256 efi_get_time_t *get_time; 258 efi_get_time_t *get_time;
257 efi_set_time_t *set_time; 259 efi_set_time_t *set_time;
258 efi_get_wakeup_time_t *get_wakeup_time; 260 efi_get_wakeup_time_t *get_wakeup_time;
@@ -292,6 +294,8 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos
292extern u64 efi_get_iobase (void); 294extern u64 efi_get_iobase (void);
293extern u32 efi_mem_type (unsigned long phys_addr); 295extern u32 efi_mem_type (unsigned long phys_addr);
294extern u64 efi_mem_attributes (unsigned long phys_addr); 296extern u64 efi_mem_attributes (unsigned long phys_addr);
297extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size,
298 u64 attr);
295extern int __init efi_uart_console_only (void); 299extern int __init efi_uart_console_only (void);
296extern void efi_initialize_iomem_resources(struct resource *code_resource, 300extern void efi_initialize_iomem_resources(struct resource *code_resource,
297 struct resource *data_resource); 301 struct resource *data_resource);
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index e7239f2f97a1..8bb4f842cded 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -36,7 +36,8 @@ struct statfs;
36 * Define EXT3_RESERVATION to reserve data blocks for expanding files 36 * Define EXT3_RESERVATION to reserve data blocks for expanding files
37 */ 37 */
38#define EXT3_DEFAULT_RESERVE_BLOCKS 8 38#define EXT3_DEFAULT_RESERVE_BLOCKS 8
39#define EXT3_MAX_RESERVE_BLOCKS 1024 39/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
40#define EXT3_MAX_RESERVE_BLOCKS 1027
40#define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0 41#define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0
41/* 42/*
42 * Always enable hashed directories 43 * Always enable hashed directories
@@ -732,6 +733,8 @@ struct dir_private_info {
732extern int ext3_bg_has_super(struct super_block *sb, int group); 733extern int ext3_bg_has_super(struct super_block *sb, int group);
733extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group); 734extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
734extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *); 735extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *);
736extern int ext3_new_blocks (handle_t *, struct inode *, unsigned long,
737 unsigned long *, int *);
735extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long, 738extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long,
736 unsigned long); 739 unsigned long);
737extern void ext3_free_blocks_sb (handle_t *, struct super_block *, 740extern void ext3_free_blocks_sb (handle_t *, struct super_block *,
@@ -775,9 +778,9 @@ extern unsigned long ext3_count_free (struct buffer_head *, unsigned);
775int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); 778int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int);
776struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); 779struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
777struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); 780struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
778int ext3_get_block_handle(handle_t *handle, struct inode *inode, 781int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
779 sector_t iblock, struct buffer_head *bh_result, int create, 782 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
780 int extend_disksize); 783 int create, int extend_disksize);
781 784
782extern void ext3_read_inode (struct inode *); 785extern void ext3_read_inode (struct inode *);
783extern int ext3_write_inode (struct inode *, int); 786extern int ext3_write_inode (struct inode *, int);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5adf32b90f36..9d9674946956 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -252,9 +252,6 @@ extern void __init files_init(unsigned long);
252struct buffer_head; 252struct buffer_head;
253typedef int (get_block_t)(struct inode *inode, sector_t iblock, 253typedef int (get_block_t)(struct inode *inode, sector_t iblock,
254 struct buffer_head *bh_result, int create); 254 struct buffer_head *bh_result, int create);
255typedef int (get_blocks_t)(struct inode *inode, sector_t iblock,
256 unsigned long max_blocks,
257 struct buffer_head *bh_result, int create);
258typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, 255typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
259 ssize_t bytes, void *private); 256 ssize_t bytes, void *private);
260 257
@@ -350,7 +347,7 @@ struct writeback_control;
350struct address_space_operations { 347struct address_space_operations {
351 int (*writepage)(struct page *page, struct writeback_control *wbc); 348 int (*writepage)(struct page *page, struct writeback_control *wbc);
352 int (*readpage)(struct file *, struct page *); 349 int (*readpage)(struct file *, struct page *);
353 int (*sync_page)(struct page *); 350 void (*sync_page)(struct page *);
354 351
355 /* Write back some dirty pages from this mapping. */ 352 /* Write back some dirty pages from this mapping. */
356 int (*writepages)(struct address_space *, struct writeback_control *); 353 int (*writepages)(struct address_space *, struct writeback_control *);
@@ -369,7 +366,7 @@ struct address_space_operations {
369 int (*commit_write)(struct file *, struct page *, unsigned, unsigned); 366 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
370 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ 367 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
371 sector_t (*bmap)(struct address_space *, sector_t); 368 sector_t (*bmap)(struct address_space *, sector_t);
372 int (*invalidatepage) (struct page *, unsigned long); 369 void (*invalidatepage) (struct page *, unsigned long);
373 int (*releasepage) (struct page *, gfp_t); 370 int (*releasepage) (struct page *, gfp_t);
374 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 371 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
375 loff_t offset, unsigned long nr_segs); 372 loff_t offset, unsigned long nr_segs);
@@ -490,7 +487,7 @@ struct inode {
490 unsigned int i_blkbits; 487 unsigned int i_blkbits;
491 unsigned long i_blksize; 488 unsigned long i_blksize;
492 unsigned long i_version; 489 unsigned long i_version;
493 unsigned long i_blocks; 490 blkcnt_t i_blocks;
494 unsigned short i_bytes; 491 unsigned short i_bytes;
495 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 492 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
496 struct mutex i_mutex; 493 struct mutex i_mutex;
@@ -763,6 +760,7 @@ extern void locks_copy_lock(struct file_lock *, struct file_lock *);
763extern void locks_remove_posix(struct file *, fl_owner_t); 760extern void locks_remove_posix(struct file *, fl_owner_t);
764extern void locks_remove_flock(struct file *); 761extern void locks_remove_flock(struct file *);
765extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *); 762extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *);
763extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *);
766extern int posix_lock_file(struct file *, struct file_lock *); 764extern int posix_lock_file(struct file *, struct file_lock *);
767extern int posix_lock_file_wait(struct file *, struct file_lock *); 765extern int posix_lock_file_wait(struct file *, struct file_lock *);
768extern int posix_unblock_lock(struct file *, struct file_lock *); 766extern int posix_unblock_lock(struct file *, struct file_lock *);
@@ -1644,7 +1642,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1644 1642
1645ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 1643ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1646 struct block_device *bdev, const struct iovec *iov, loff_t offset, 1644 struct block_device *bdev, const struct iovec *iov, loff_t offset,
1647 unsigned long nr_segs, get_blocks_t get_blocks, dio_iodone_t end_io, 1645 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
1648 int lock_type); 1646 int lock_type);
1649 1647
1650enum { 1648enum {
@@ -1655,29 +1653,29 @@ enum {
1655 1653
1656static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 1654static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
1657 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1655 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1658 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1656 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1659 dio_iodone_t end_io) 1657 dio_iodone_t end_io)
1660{ 1658{
1661 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1659 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1662 nr_segs, get_blocks, end_io, DIO_LOCKING); 1660 nr_segs, get_block, end_io, DIO_LOCKING);
1663} 1661}
1664 1662
1665static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, 1663static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb,
1666 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1664 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1667 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1665 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1668 dio_iodone_t end_io) 1666 dio_iodone_t end_io)
1669{ 1667{
1670 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1668 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1671 nr_segs, get_blocks, end_io, DIO_NO_LOCKING); 1669 nr_segs, get_block, end_io, DIO_NO_LOCKING);
1672} 1670}
1673 1671
1674static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, 1672static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb,
1675 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 1673 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
1676 loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, 1674 loff_t offset, unsigned long nr_segs, get_block_t get_block,
1677 dio_iodone_t end_io) 1675 dio_iodone_t end_io)
1678{ 1676{
1679 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1677 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1680 nr_segs, get_blocks, end_io, DIO_OWN_LOCKING); 1678 nr_segs, get_block, end_io, DIO_OWN_LOCKING);
1681} 1679}
1682 1680
1683extern struct file_operations generic_ro_fops; 1681extern struct file_operations generic_ro_fops;
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 2401dea2b867..9c8e6da2393b 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -119,7 +119,7 @@ static inline void gameport_set_name(struct gameport *gameport, const char *name
119} 119}
120 120
121/* 121/*
122 * Use the following fucntions to manipulate gameport's per-port 122 * Use the following functions to manipulate gameport's per-port
123 * driver-specific data. 123 * driver-specific data.
124 */ 124 */
125static inline void *gameport_get_drvdata(struct gameport *gameport) 125static inline void *gameport_get_drvdata(struct gameport *gameport)
@@ -133,7 +133,7 @@ static inline void gameport_set_drvdata(struct gameport *gameport, void *data)
133} 133}
134 134
135/* 135/*
136 * Use the following fucntions to pin gameport's driver in process context 136 * Use the following functions to pin gameport's driver in process context
137 */ 137 */
138static inline int gameport_pin_driver(struct gameport *gameport) 138static inline int gameport_pin_driver(struct gameport *gameport)
139{ 139{
diff --git a/include/linux/gigaset_dev.h b/include/linux/gigaset_dev.h
new file mode 100644
index 000000000000..70ad09c8ad1e
--- /dev/null
+++ b/include/linux/gigaset_dev.h
@@ -0,0 +1,32 @@
1/*
2 * interface to user space for the gigaset driver
3 *
4 * Copyright (c) 2004 by Hansjoerg Lipp <hjlipp@web.de>
5 *
6 * =====================================================================
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 * =====================================================================
12 * Version: $Id: gigaset_dev.h,v 1.4.4.4 2005/11/21 22:28:09 hjlipp Exp $
13 * =====================================================================
14 */
15
16#ifndef GIGASET_INTERFACE_H
17#define GIGASET_INTERFACE_H
18
19#include <linux/ioctl.h>
20
21#define GIGASET_IOCTL 0x47
22
23#define GIGVER_DRIVER 0
24#define GIGVER_COMPAT 1
25#define GIGVER_FWBASE 2
26
27#define GIGASET_REDIR _IOWR (GIGASET_IOCTL, 0, int)
28#define GIGASET_CONFIG _IOWR (GIGASET_IOCTL, 1, int)
29#define GIGASET_BRKCHARS _IOW (GIGASET_IOCTL, 2, unsigned char[6]) //FIXME [6] okay?
30#define GIGASET_VERSION _IOWR (GIGASET_IOCTL, 3, unsigned[4])
31
32#endif
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 6bece9280eb7..892c4ea1b425 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -7,6 +7,18 @@
7 7
8#include <asm/cacheflush.h> 8#include <asm/cacheflush.h>
9 9
10#ifndef ARCH_HAS_FLUSH_ANON_PAGE
11static inline void flush_anon_page(struct page *page, unsigned long vmaddr)
12{
13}
14#endif
15
16#ifndef ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
17static inline void flush_kernel_dcache_page(struct page *page)
18{
19}
20#endif
21
10#ifdef CONFIG_HIGHMEM 22#ifdef CONFIG_HIGHMEM
11 23
12#include <asm/highmem.h> 24#include <asm/highmem.h>
diff --git a/include/linux/hpet.h b/include/linux/hpet.h
index 27238194b212..707f7cb9e795 100644
--- a/include/linux/hpet.h
+++ b/include/linux/hpet.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5 5
6#ifdef __KERNEL__
7
6/* 8/*
7 * Offsets into HPET Registers 9 * Offsets into HPET Registers
8 */ 10 */
@@ -85,22 +87,6 @@ struct hpet {
85#define Tn_FSB_INT_ADDR_SHIFT (32UL) 87#define Tn_FSB_INT_ADDR_SHIFT (32UL)
86#define Tn_FSB_INT_VAL_MASK (0x00000000ffffffffULL) 88#define Tn_FSB_INT_VAL_MASK (0x00000000ffffffffULL)
87 89
88struct hpet_info {
89 unsigned long hi_ireqfreq; /* Hz */
90 unsigned long hi_flags; /* information */
91 unsigned short hi_hpet;
92 unsigned short hi_timer;
93};
94
95#define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */
96
97#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */
98#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */
99#define HPET_INFO _IOR('h', 0x03, struct hpet_info)
100#define HPET_EPI _IO('h', 0x04) /* enable periodic */
101#define HPET_DPI _IO('h', 0x05) /* disable periodic */
102#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */
103
104/* 90/*
105 * exported interfaces 91 * exported interfaces
106 */ 92 */
@@ -133,4 +119,22 @@ int hpet_register(struct hpet_task *, int);
133int hpet_unregister(struct hpet_task *); 119int hpet_unregister(struct hpet_task *);
134int hpet_control(struct hpet_task *, unsigned int, unsigned long); 120int hpet_control(struct hpet_task *, unsigned int, unsigned long);
135 121
122#endif /* __KERNEL__ */
123
124struct hpet_info {
125 unsigned long hi_ireqfreq; /* Hz */
126 unsigned long hi_flags; /* information */
127 unsigned short hi_hpet;
128 unsigned short hi_timer;
129};
130
131#define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */
132
133#define HPET_IE_ON _IO('h', 0x01) /* interrupt on */
134#define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */
135#define HPET_INFO _IOR('h', 0x03, struct hpet_info)
136#define HPET_EPI _IO('h', 0x04) /* enable periodic */
137#define HPET_DPI _IO('h', 0x05) /* disable periodic */
138#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */
139
136#endif /* !__HPET__ */ 140#endif /* !__HPET__ */
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 6401c31d6add..93830158348e 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -34,15 +34,7 @@ enum hrtimer_restart {
34 HRTIMER_RESTART, 34 HRTIMER_RESTART,
35}; 35};
36 36
37/* 37#define HRTIMER_INACTIVE ((void *)1UL)
38 * Timer states:
39 */
40enum hrtimer_state {
41 HRTIMER_INACTIVE, /* Timer is inactive */
42 HRTIMER_EXPIRED, /* Timer is expired */
43 HRTIMER_RUNNING, /* Timer is running the callback function */
44 HRTIMER_PENDING, /* Timer is pending */
45};
46 38
47struct hrtimer_base; 39struct hrtimer_base;
48 40
@@ -53,9 +45,7 @@ struct hrtimer_base;
53 * @expires: the absolute expiry time in the hrtimers internal 45 * @expires: the absolute expiry time in the hrtimers internal
54 * representation. The time is related to the clock on 46 * representation. The time is related to the clock on
55 * which the timer is based. 47 * which the timer is based.
56 * @state: state of the timer
57 * @function: timer expiry callback function 48 * @function: timer expiry callback function
58 * @data: argument for the callback function
59 * @base: pointer to the timer base (per cpu and per clock) 49 * @base: pointer to the timer base (per cpu and per clock)
60 * 50 *
61 * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE() 51 * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE()
@@ -63,23 +53,23 @@ struct hrtimer_base;
63struct hrtimer { 53struct hrtimer {
64 struct rb_node node; 54 struct rb_node node;
65 ktime_t expires; 55 ktime_t expires;
66 enum hrtimer_state state; 56 int (*function)(struct hrtimer *);
67 int (*function)(void *);
68 void *data;
69 struct hrtimer_base *base; 57 struct hrtimer_base *base;
70}; 58};
71 59
72/** 60/**
73 * struct hrtimer_base - the timer base for a specific clock 61 * struct hrtimer_base - the timer base for a specific clock
74 * 62 *
75 * @index: clock type index for per_cpu support when moving a timer 63 * @index: clock type index for per_cpu support when moving a timer
76 * to a base on another cpu. 64 * to a base on another cpu.
77 * @lock: lock protecting the base and associated timers 65 * @lock: lock protecting the base and associated timers
78 * @active: red black tree root node for the active timers 66 * @active: red black tree root node for the active timers
79 * @first: pointer to the timer node which expires first 67 * @first: pointer to the timer node which expires first
80 * @resolution: the resolution of the clock, in nanoseconds 68 * @resolution: the resolution of the clock, in nanoseconds
81 * @get_time: function to retrieve the current time of the clock 69 * @get_time: function to retrieve the current time of the clock
82 * @curr_timer: the timer which is executing a callback right now 70 * @get_sofirq_time: function to retrieve the current time from the softirq
71 * @curr_timer: the timer which is executing a callback right now
72 * @softirq_time: the time when running the hrtimer queue in the softirq
83 */ 73 */
84struct hrtimer_base { 74struct hrtimer_base {
85 clockid_t index; 75 clockid_t index;
@@ -88,7 +78,9 @@ struct hrtimer_base {
88 struct rb_node *first; 78 struct rb_node *first;
89 ktime_t resolution; 79 ktime_t resolution;
90 ktime_t (*get_time)(void); 80 ktime_t (*get_time)(void);
81 ktime_t (*get_softirq_time)(void);
91 struct hrtimer *curr_timer; 82 struct hrtimer *curr_timer;
83 ktime_t softirq_time;
92}; 84};
93 85
94/* 86/*
@@ -122,11 +114,12 @@ extern ktime_t hrtimer_get_next_event(void);
122 114
123static inline int hrtimer_active(const struct hrtimer *timer) 115static inline int hrtimer_active(const struct hrtimer *timer)
124{ 116{
125 return timer->state == HRTIMER_PENDING; 117 return timer->node.rb_parent != HRTIMER_INACTIVE;
126} 118}
127 119
128/* Forward a hrtimer so it expires after now: */ 120/* Forward a hrtimer so it expires after now: */
129extern unsigned long hrtimer_forward(struct hrtimer *timer, ktime_t interval); 121extern unsigned long
122hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
130 123
131/* Precise sleep: */ 124/* Precise sleep: */
132extern long hrtimer_nanosleep(struct timespec *rqtp, 125extern long hrtimer_nanosleep(struct timespec *rqtp,
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 5a9d8c599171..dd7d627bf66f 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -950,9 +950,7 @@ static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
950 if (!pool->slab) 950 if (!pool->slab)
951 goto free_name; 951 goto free_name;
952 952
953 pool->mempool = 953 pool->mempool = mempool_create_slab_pool(min_nr, pool->slab);
954 mempool_create(min_nr, mempool_alloc_slab, mempool_free_slab,
955 pool->slab);
956 if (!pool->mempool) 954 if (!pool->mempool)
957 goto free_slab; 955 goto free_slab;
958 956
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index d6276e60b3bf..0a84b56935c2 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -36,6 +36,7 @@
36 36
37#include <linux/ipmi_msgdefs.h> 37#include <linux/ipmi_msgdefs.h>
38#include <linux/compiler.h> 38#include <linux/compiler.h>
39#include <linux/device.h>
39 40
40/* 41/*
41 * This file describes an interface to an IPMI driver. You have to 42 * This file describes an interface to an IPMI driver. You have to
@@ -397,7 +398,7 @@ struct ipmi_smi_watcher
397 the watcher list. So you can add and remove users from the 398 the watcher list. So you can add and remove users from the
398 IPMI interface, send messages, etc., but you cannot add 399 IPMI interface, send messages, etc., but you cannot add
399 or remove SMI watchers or SMI interfaces. */ 400 or remove SMI watchers or SMI interfaces. */
400 void (*new_smi)(int if_num); 401 void (*new_smi)(int if_num, struct device *dev);
401 void (*smi_gone)(int if_num); 402 void (*smi_gone)(int if_num);
402}; 403};
403 404
diff --git a/include/linux/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h
index 03bc64dc2ec1..22f5e2afda4f 100644
--- a/include/linux/ipmi_msgdefs.h
+++ b/include/linux/ipmi_msgdefs.h
@@ -47,6 +47,7 @@
47#define IPMI_NETFN_APP_RESPONSE 0x07 47#define IPMI_NETFN_APP_RESPONSE 0x07
48#define IPMI_GET_DEVICE_ID_CMD 0x01 48#define IPMI_GET_DEVICE_ID_CMD 0x01
49#define IPMI_CLEAR_MSG_FLAGS_CMD 0x30 49#define IPMI_CLEAR_MSG_FLAGS_CMD 0x30
50#define IPMI_GET_DEVICE_GUID_CMD 0x08
50#define IPMI_GET_MSG_FLAGS_CMD 0x31 51#define IPMI_GET_MSG_FLAGS_CMD 0x31
51#define IPMI_SEND_MSG_CMD 0x34 52#define IPMI_SEND_MSG_CMD 0x34
52#define IPMI_GET_MSG_CMD 0x33 53#define IPMI_GET_MSG_CMD 0x33
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index e36ee157ad67..53571288a9fc 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -37,6 +37,9 @@
37#include <linux/ipmi_msgdefs.h> 37#include <linux/ipmi_msgdefs.h>
38#include <linux/proc_fs.h> 38#include <linux/proc_fs.h>
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/device.h>
41#include <linux/platform_device.h>
42#include <linux/ipmi_smi.h>
40 43
41/* This files describes the interface for IPMI system management interface 44/* This files describes the interface for IPMI system management interface
42 drivers to bind into the IPMI message handler. */ 45 drivers to bind into the IPMI message handler. */
@@ -113,12 +116,52 @@ struct ipmi_smi_handlers
113 void (*dec_usecount)(void *send_info); 116 void (*dec_usecount)(void *send_info);
114}; 117};
115 118
119struct ipmi_device_id {
120 unsigned char device_id;
121 unsigned char device_revision;
122 unsigned char firmware_revision_1;
123 unsigned char firmware_revision_2;
124 unsigned char ipmi_version;
125 unsigned char additional_device_support;
126 unsigned int manufacturer_id;
127 unsigned int product_id;
128 unsigned char aux_firmware_revision[4];
129 unsigned int aux_firmware_revision_set : 1;
130};
131
132#define ipmi_version_major(v) ((v)->ipmi_version & 0xf)
133#define ipmi_version_minor(v) ((v)->ipmi_version >> 4)
134
135/* Take a pointer to a raw data buffer and a length and extract device
136 id information from it. The first byte of data must point to the
137 byte from the get device id response after the completion code.
138 The caller is responsible for making sure the length is at least
139 11 and the command completed without error. */
140static inline void ipmi_demangle_device_id(unsigned char *data,
141 unsigned int data_len,
142 struct ipmi_device_id *id)
143{
144 id->device_id = data[0];
145 id->device_revision = data[1];
146 id->firmware_revision_1 = data[2];
147 id->firmware_revision_2 = data[3];
148 id->ipmi_version = data[4];
149 id->additional_device_support = data[5];
150 id->manufacturer_id = data[6] | (data[7] << 8) | (data[8] << 16);
151 id->product_id = data[9] | (data[10] << 8);
152 if (data_len >= 15) {
153 memcpy(id->aux_firmware_revision, data+11, 4);
154 id->aux_firmware_revision_set = 1;
155 } else
156 id->aux_firmware_revision_set = 0;
157}
158
116/* Add a low-level interface to the IPMI driver. Note that if the 159/* Add a low-level interface to the IPMI driver. Note that if the
117 interface doesn't know its slave address, it should pass in zero. */ 160 interface doesn't know its slave address, it should pass in zero. */
118int ipmi_register_smi(struct ipmi_smi_handlers *handlers, 161int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
119 void *send_info, 162 void *send_info,
120 unsigned char version_major, 163 struct ipmi_device_id *device_id,
121 unsigned char version_minor, 164 struct device *dev,
122 unsigned char slave_addr, 165 unsigned char slave_addr,
123 ipmi_smi_t *intf); 166 ipmi_smi_t *intf);
124 167
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 4fc7dffd66ef..6a425e370cb3 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -895,7 +895,7 @@ extern int journal_dirty_metadata (handle_t *, struct buffer_head *);
895extern void journal_release_buffer (handle_t *, struct buffer_head *); 895extern void journal_release_buffer (handle_t *, struct buffer_head *);
896extern int journal_forget (handle_t *, struct buffer_head *); 896extern int journal_forget (handle_t *, struct buffer_head *);
897extern void journal_sync_buffer (struct buffer_head *); 897extern void journal_sync_buffer (struct buffer_head *);
898extern int journal_invalidatepage(journal_t *, 898extern void journal_invalidatepage(journal_t *,
899 struct page *, unsigned long); 899 struct page *, unsigned long);
900extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); 900extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t);
901extern int journal_stop(handle_t *); 901extern int journal_stop(handle_t *);
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index f3dec45ef874..62bc57580707 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -64,9 +64,6 @@ typedef union {
64 64
65#if (BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR) 65#if (BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)
66 66
67/* Define a ktime_t variable and initialize it to zero: */
68#define DEFINE_KTIME(kt) ktime_t kt = { .tv64 = 0 }
69
70/** 67/**
71 * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value 68 * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value
72 * 69 *
@@ -113,9 +110,6 @@ static inline ktime_t timeval_to_ktime(struct timeval tv)
113/* Map the ktime_t to timeval conversion to ns_to_timeval function */ 110/* Map the ktime_t to timeval conversion to ns_to_timeval function */
114#define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) 111#define ktime_to_timeval(kt) ns_to_timeval((kt).tv64)
115 112
116/* Map the ktime_t to clock_t conversion to the inline in jiffies.h: */
117#define ktime_to_clock_t(kt) nsec_to_clock_t((kt).tv64)
118
119/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ 113/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */
120#define ktime_to_ns(kt) ((kt).tv64) 114#define ktime_to_ns(kt) ((kt).tv64)
121 115
@@ -136,9 +130,6 @@ static inline ktime_t timeval_to_ktime(struct timeval tv)
136 * tv.sec < 0 and 0 >= tv.nsec < NSEC_PER_SEC 130 * tv.sec < 0 and 0 >= tv.nsec < NSEC_PER_SEC
137 */ 131 */
138 132
139/* Define a ktime_t variable and initialize it to zero: */
140#define DEFINE_KTIME(kt) ktime_t kt = { .tv64 = 0 }
141
142/* Set a ktime_t variable to a value in sec/nsec representation: */ 133/* Set a ktime_t variable to a value in sec/nsec representation: */
143static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) 134static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
144{ 135{
@@ -255,17 +246,6 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt)
255} 246}
256 247
257/** 248/**
258 * ktime_to_clock_t - convert a ktime_t variable to clock_t format
259 * @kt: the ktime_t variable to convert
260 *
261 * Returns a clock_t variable with the converted value
262 */
263static inline clock_t ktime_to_clock_t(const ktime_t kt)
264{
265 return nsec_to_clock_t( (u64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec);
266}
267
268/**
269 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds 249 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds
270 * @kt: the ktime_t variable to convert 250 * @kt: the ktime_t variable to convert
271 * 251 *
diff --git a/include/linux/mempool.h b/include/linux/mempool.h
index f2427d7394b0..9be484d11283 100644
--- a/include/linux/mempool.h
+++ b/include/linux/mempool.h
@@ -6,6 +6,8 @@
6 6
7#include <linux/wait.h> 7#include <linux/wait.h>
8 8
9struct kmem_cache;
10
9typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data); 11typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data);
10typedef void (mempool_free_t)(void *element, void *pool_data); 12typedef void (mempool_free_t)(void *element, void *pool_data);
11 13
@@ -37,5 +39,41 @@ extern void mempool_free(void *element, mempool_t *pool);
37 */ 39 */
38void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); 40void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data);
39void mempool_free_slab(void *element, void *pool_data); 41void mempool_free_slab(void *element, void *pool_data);
42static inline mempool_t *
43mempool_create_slab_pool(int min_nr, struct kmem_cache *kc)
44{
45 return mempool_create(min_nr, mempool_alloc_slab, mempool_free_slab,
46 (void *) kc);
47}
48
49/*
50 * 2 mempool_alloc_t's and a mempool_free_t to kmalloc/kzalloc and kfree
51 * the amount of memory specified by pool_data
52 */
53void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data);
54void *mempool_kzalloc(gfp_t gfp_mask, void *pool_data);
55void mempool_kfree(void *element, void *pool_data);
56static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size)
57{
58 return mempool_create(min_nr, mempool_kmalloc, mempool_kfree,
59 (void *) size);
60}
61static inline mempool_t *mempool_create_kzalloc_pool(int min_nr, size_t size)
62{
63 return mempool_create(min_nr, mempool_kzalloc, mempool_kfree,
64 (void *) size);
65}
66
67/*
68 * A mempool_alloc_t and mempool_free_t for a simple page allocator that
69 * allocates pages of the order specified by pool_data
70 */
71void *mempool_alloc_pages(gfp_t gfp_mask, void *pool_data);
72void mempool_free_pages(void *element, void *pool_data);
73static inline mempool_t *mempool_create_page_pool(int min_nr, int order)
74{
75 return mempool_create(min_nr, mempool_alloc_pages, mempool_free_pages,
76 (void *)(long)order);
77}
40 78
41#endif /* _LINUX_MEMPOOL_H */ 79#endif /* _LINUX_MEMPOOL_H */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index aa6322d45198..cb224cf653b1 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -4,6 +4,7 @@
4#include <linux/config.h> 4#include <linux/config.h>
5#include <linux/slab.h> 5#include <linux/slab.h>
6#include <linux/fs.h> 6#include <linux/fs.h>
7#include <linux/spinlock.h>
7#include <asm/atomic.h> 8#include <asm/atomic.h>
8 9
9/* 10/*
@@ -55,7 +56,7 @@ struct proc_dir_entry {
55 nlink_t nlink; 56 nlink_t nlink;
56 uid_t uid; 57 uid_t uid;
57 gid_t gid; 58 gid_t gid;
58 unsigned long size; 59 loff_t size;
59 struct inode_operations * proc_iops; 60 struct inode_operations * proc_iops;
60 struct file_operations * proc_fops; 61 struct file_operations * proc_fops;
61 get_info_t *get_info; 62 get_info_t *get_info;
@@ -92,6 +93,8 @@ extern struct proc_dir_entry *proc_bus;
92extern struct proc_dir_entry *proc_root_driver; 93extern struct proc_dir_entry *proc_root_driver;
93extern struct proc_dir_entry *proc_root_kcore; 94extern struct proc_dir_entry *proc_root_kcore;
94 95
96extern spinlock_t proc_subdir_lock;
97
95extern void proc_root_init(void); 98extern void proc_root_init(void);
96extern void proc_misc_init(void); 99extern void proc_misc_init(void);
97 100
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e0054c1b9a09..036d14d2bf90 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -402,6 +402,7 @@ struct signal_struct {
402 402
403 /* ITIMER_REAL timer for the process */ 403 /* ITIMER_REAL timer for the process */
404 struct hrtimer real_timer; 404 struct hrtimer real_timer;
405 struct task_struct *tsk;
405 ktime_t it_real_incr; 406 ktime_t it_real_incr;
406 407
407 /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ 408 /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */
diff --git a/include/linux/serio.h b/include/linux/serio.h
index aa4d6493a034..690aabca8ed0 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -119,7 +119,7 @@ static inline void serio_cleanup(struct serio *serio)
119} 119}
120 120
121/* 121/*
122 * Use the following fucntions to manipulate serio's per-port 122 * Use the following functions to manipulate serio's per-port
123 * driver-specific data. 123 * driver-specific data.
124 */ 124 */
125static inline void *serio_get_drvdata(struct serio *serio) 125static inline void *serio_get_drvdata(struct serio *serio)
@@ -133,7 +133,7 @@ static inline void serio_set_drvdata(struct serio *serio, void *data)
133} 133}
134 134
135/* 135/*
136 * Use the following fucntions to protect critical sections in 136 * Use the following functions to protect critical sections in
137 * driver code from port's interrupt handler 137 * driver code from port's interrupt handler
138 */ 138 */
139static inline void serio_pause_rx(struct serio *serio) 139static inline void serio_pause_rx(struct serio *serio)
@@ -147,7 +147,7 @@ static inline void serio_continue_rx(struct serio *serio)
147} 147}
148 148
149/* 149/*
150 * Use the following fucntions to pin serio's driver in process context 150 * Use the following functions to pin serio's driver in process context
151 */ 151 */
152static inline int serio_pin_driver(struct serio *serio) 152static inline int serio_pin_driver(struct serio *serio)
153{ 153{
diff --git a/include/linux/smp.h b/include/linux/smp.h
index d699a16b0cb2..e2fa3ab4afc5 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -82,7 +82,11 @@ void smp_prepare_boot_cpu(void);
82 */ 82 */
83#define raw_smp_processor_id() 0 83#define raw_smp_processor_id() 0
84#define hard_smp_processor_id() 0 84#define hard_smp_processor_id() 0
85#define smp_call_function(func,info,retry,wait) ({ 0; }) 85static inline int up_smp_call_function(void)
86{
87 return 0;
88}
89#define smp_call_function(func,info,retry,wait) (up_smp_call_function())
86#define on_each_cpu(func,info,retry,wait) \ 90#define on_each_cpu(func,info,retry,wait) \
87 ({ \ 91 ({ \
88 local_irq_disable(); \ 92 local_irq_disable(); \
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 8ff2a122dfef..8669291352db 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -69,7 +69,7 @@ struct kstat {
69 struct timespec mtime; 69 struct timespec mtime;
70 struct timespec ctime; 70 struct timespec ctime;
71 unsigned long blksize; 71 unsigned long blksize;
72 unsigned long blocks; 72 unsigned long long blocks;
73}; 73};
74 74
75#endif 75#endif
diff --git a/include/linux/statfs.h b/include/linux/statfs.h
index ad83a2bdb821..b34cc829f98d 100644
--- a/include/linux/statfs.h
+++ b/include/linux/statfs.h
@@ -8,11 +8,11 @@
8struct kstatfs { 8struct kstatfs {
9 long f_type; 9 long f_type;
10 long f_bsize; 10 long f_bsize;
11 sector_t f_blocks; 11 u64 f_blocks;
12 sector_t f_bfree; 12 u64 f_bfree;
13 sector_t f_bavail; 13 u64 f_bavail;
14 sector_t f_files; 14 u64 f_files;
15 sector_t f_ffree; 15 u64 f_ffree;
16 __kernel_fsid_t f_fsid; 16 __kernel_fsid_t f_fsid;
17 long f_namelen; 17 long f_namelen;
18 long f_frsize; 18 long f_frsize;
diff --git a/include/linux/time.h b/include/linux/time.h
index bf0e785e2e03..0cd696cee998 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -73,12 +73,6 @@ extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
73#define timespec_valid(ts) \ 73#define timespec_valid(ts) \
74 (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) 74 (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC))
75 75
76/*
77 * 64-bit nanosec type. Large enough to span 292+ years in nanosecond
78 * resolution. Ought to be enough for a while.
79 */
80typedef s64 nsec_t;
81
82extern struct timespec xtime; 76extern struct timespec xtime;
83extern struct timespec wall_to_monotonic; 77extern struct timespec wall_to_monotonic;
84extern seqlock_t xtime_lock; 78extern seqlock_t xtime_lock;
@@ -114,9 +108,9 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
114 * Returns the scalar nanosecond representation of the timespec 108 * Returns the scalar nanosecond representation of the timespec
115 * parameter. 109 * parameter.
116 */ 110 */
117static inline nsec_t timespec_to_ns(const struct timespec *ts) 111static inline s64 timespec_to_ns(const struct timespec *ts)
118{ 112{
119 return ((nsec_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; 113 return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
120} 114}
121 115
122/** 116/**
@@ -126,9 +120,9 @@ static inline nsec_t timespec_to_ns(const struct timespec *ts)
126 * Returns the scalar nanosecond representation of the timeval 120 * Returns the scalar nanosecond representation of the timeval
127 * parameter. 121 * parameter.
128 */ 122 */
129static inline nsec_t timeval_to_ns(const struct timeval *tv) 123static inline s64 timeval_to_ns(const struct timeval *tv)
130{ 124{
131 return ((nsec_t) tv->tv_sec * NSEC_PER_SEC) + 125 return ((s64) tv->tv_sec * NSEC_PER_SEC) +
132 tv->tv_usec * NSEC_PER_USEC; 126 tv->tv_usec * NSEC_PER_USEC;
133} 127}
134 128
@@ -138,7 +132,7 @@ static inline nsec_t timeval_to_ns(const struct timeval *tv)
138 * 132 *
139 * Returns the timespec representation of the nsec parameter. 133 * Returns the timespec representation of the nsec parameter.
140 */ 134 */
141extern struct timespec ns_to_timespec(const nsec_t nsec); 135extern struct timespec ns_to_timespec(const s64 nsec);
142 136
143/** 137/**
144 * ns_to_timeval - Convert nanoseconds to timeval 138 * ns_to_timeval - Convert nanoseconds to timeval
@@ -146,7 +140,7 @@ extern struct timespec ns_to_timespec(const nsec_t nsec);
146 * 140 *
147 * Returns the timeval representation of the nsec parameter. 141 * Returns the timeval representation of the nsec parameter.
148 */ 142 */
149extern struct timeval ns_to_timeval(const nsec_t nsec); 143extern struct timeval ns_to_timeval(const s64 nsec);
150 144
151#endif /* __KERNEL__ */ 145#endif /* __KERNEL__ */
152 146
diff --git a/include/linux/timer.h b/include/linux/timer.h
index ee5a09e806e8..b5caabca553c 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -96,6 +96,7 @@ static inline void add_timer(struct timer_list *timer)
96 96
97extern void init_timers(void); 97extern void init_timers(void);
98extern void run_local_timers(void); 98extern void run_local_timers(void);
99extern int it_real_fn(void *); 99struct hrtimer;
100extern int it_real_fn(struct hrtimer *);
100 101
101#endif 102#endif
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 82dc9ae79d37..03914b7e41b1 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -307,6 +307,8 @@ time_interpolator_reset(void)
307/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ 307/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
308extern u64 current_tick_length(void); 308extern u64 current_tick_length(void);
309 309
310extern int do_adjtimex(struct timex *);
311
310#endif /* KERNEL */ 312#endif /* KERNEL */
311 313
312#endif /* LINUX_TIMEX_H */ 314#endif /* LINUX_TIMEX_H */
diff --git a/include/linux/types.h b/include/linux/types.h
index 54ae2d59e71b..1046c7ad86d9 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -137,6 +137,10 @@ typedef __s64 int64_t;
137typedef unsigned long sector_t; 137typedef unsigned long sector_t;
138#endif 138#endif
139 139
140#ifndef HAVE_BLKCNT_T
141typedef unsigned long blkcnt_t;
142#endif
143
140/* 144/*
141 * The type of an index into the pagecache. Use a #define so asm/types.h 145 * The type of an index into the pagecache. Use a #define so asm/types.h
142 * can override it. 146 * can override it.