aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2009-04-21 23:02:09 -0400
committerPaul Mackerras <paulus@samba.org>2009-04-21 23:02:09 -0400
commit5bd3ef84d73c2ea7b4babbad060909753c4828d4 (patch)
treefdf2bafb48ae1ed03175f6c77a7548a181e69ee9 /include/linux
parent0658c16056660886ea2f35c4f038be70a94b1532 (diff)
parent6d25b688ecc488753af3c9e6f6a9a575b863cf37 (diff)
Merge branch 'merge' of git://git.secretlab.ca/git/linux-2.6 into merge
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ata.h41
-rw-r--r--include/linux/backing-dev.h12
-rw-r--r--include/linux/bio.h19
-rw-r--r--include/linux/blkdev.h57
-rw-r--r--include/linux/capability.h23
-rw-r--r--include/linux/compiler.h7
-rw-r--r--include/linux/debug_locks.h8
-rw-r--r--include/linux/device-mapper.h1
-rw-r--r--include/linux/dma-mapping.h2
-rw-r--r--include/linux/dmar.h11
-rw-r--r--include/linux/elevator.h1
-rw-r--r--include/linux/fb.h8
-rw-r--r--include/linux/fdtable.h4
-rw-r--r--include/linux/fiemap.h2
-rw-r--r--include/linux/fs.h46
-rw-r--r--include/linux/fsl_devices.h4
-rw-r--r--include/linux/ftrace.h37
-rw-r--r--include/linux/hardirq.h2
-rw-r--r--include/linux/hrtimer.h5
-rw-r--r--include/linux/i2c-algo-sgi.h26
-rw-r--r--include/linux/i2c-id.h38
-rw-r--r--include/linux/i2c.h6
-rw-r--r--include/linux/i2c/s6000.h10
-rw-r--r--include/linux/ide.h151
-rw-r--r--include/linux/init_task.h15
-rw-r--r--include/linux/intel-iommu.h13
-rw-r--r--include/linux/interrupt.h76
-rw-r--r--include/linux/ipc_namespace.h65
-rw-r--r--include/linux/irq.h19
-rw-r--r--include/linux/irqreturn.h2
-rw-r--r--include/linux/key.h1
-rw-r--r--include/linux/kmod.h2
-rw-r--r--include/linux/kprobes.h52
-rw-r--r--include/linux/leds-bd2802.h26
-rw-r--r--include/linux/leds.h4
-rw-r--r--include/linux/leds_pwm.h21
-rw-r--r--include/linux/lockd/xdr.h12
-rw-r--r--include/linux/lockd/xdr4.h10
-rw-r--r--include/linux/mfd/pcf50633/core.h2
-rw-r--r--include/linux/mfd/pcf50633/mbc.h1
-rw-r--r--include/linux/mg_disk.h206
-rw-r--r--include/linux/mtd/mtd.h21
-rw-r--r--include/linux/mtd/nand.h4
-rw-r--r--include/linux/mtd/partitions.h12
-rw-r--r--include/linux/nfs.h1
-rw-r--r--include/linux/nfs4.h138
-rw-r--r--include/linux/nfsd/cache.h8
-rw-r--r--include/linux/nfsd/nfsd.h225
-rw-r--r--include/linux/nfsd/nfsfh.h7
-rw-r--r--include/linux/nfsd/state.h84
-rw-r--r--include/linux/nfsd/stats.h9
-rw-r--r--include/linux/nfsd/xdr4.h129
-rw-r--r--include/linux/nilfs2_fs.h801
-rw-r--r--include/linux/parport_pc.h11
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/linux/pci_ids.h28
-rw-r--r--include/linux/pda_power.h2
-rw-r--r--include/linux/percpu.h52
-rw-r--r--include/linux/rcuclassic.h16
-rw-r--r--include/linux/rcupdate.h1
-rw-r--r--include/linux/rcupreempt.h53
-rw-r--r--include/linux/rcutree.h27
-rw-r--r--include/linux/rotary_encoder.h13
-rw-r--r--include/linux/sched.h26
-rw-r--r--include/linux/security.h24
-rw-r--r--include/linux/serial_core.h5
-rw-r--r--include/linux/serial_max3100.h52
-rw-r--r--include/linux/sht15.h24
-rw-r--r--include/linux/slab_def.h10
-rw-r--r--include/linux/slub_def.h12
-rw-r--r--include/linux/spi/ad7879.h35
-rw-r--r--include/linux/spi/spi.h6
-rw-r--r--include/linux/stringify.h4
-rw-r--r--include/linux/sunrpc/svc.h16
-rw-r--r--include/linux/sunrpc/xdr.h42
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--include/linux/tty_driver.h3
-rw-r--r--include/linux/usb/serial.h7
-rw-r--r--include/linux/videodev2.h5
-rw-r--r--include/linux/writeback.h2
80 files changed, 2404 insertions, 566 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 6617c9f8f2ca..cb79b7a208e1 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -29,6 +29,8 @@
29#ifndef __LINUX_ATA_H__ 29#ifndef __LINUX_ATA_H__
30#define __LINUX_ATA_H__ 30#define __LINUX_ATA_H__
31 31
32#include <linux/kernel.h>
33#include <linux/string.h>
32#include <linux/types.h> 34#include <linux/types.h>
33#include <asm/byteorder.h> 35#include <asm/byteorder.h>
34 36
@@ -91,6 +93,7 @@ enum {
91 ATA_ID_CFA_POWER = 160, 93 ATA_ID_CFA_POWER = 160,
92 ATA_ID_CFA_KEY_MGMT = 162, 94 ATA_ID_CFA_KEY_MGMT = 162,
93 ATA_ID_CFA_MODES = 163, 95 ATA_ID_CFA_MODES = 163,
96 ATA_ID_DATA_SET_MGMT = 169,
94 ATA_ID_ROT_SPEED = 217, 97 ATA_ID_ROT_SPEED = 217,
95 ATA_ID_PIO4 = (1 << 1), 98 ATA_ID_PIO4 = (1 << 1),
96 99
@@ -248,6 +251,7 @@ enum {
248 ATA_CMD_SMART = 0xB0, 251 ATA_CMD_SMART = 0xB0,
249 ATA_CMD_MEDIA_LOCK = 0xDE, 252 ATA_CMD_MEDIA_LOCK = 0xDE,
250 ATA_CMD_MEDIA_UNLOCK = 0xDF, 253 ATA_CMD_MEDIA_UNLOCK = 0xDF,
254 ATA_CMD_DSM = 0x06,
251 /* marked obsolete in the ATA/ATAPI-7 spec */ 255 /* marked obsolete in the ATA/ATAPI-7 spec */
252 ATA_CMD_RESTORE = 0x10, 256 ATA_CMD_RESTORE = 0x10,
253 257
@@ -321,6 +325,9 @@ enum {
321 ATA_SMART_READ_VALUES = 0xD0, 325 ATA_SMART_READ_VALUES = 0xD0,
322 ATA_SMART_READ_THRESHOLDS = 0xD1, 326 ATA_SMART_READ_THRESHOLDS = 0xD1,
323 327
328 /* feature values for Data Set Management */
329 ATA_DSM_TRIM = 0x01,
330
324 /* password used in LBA Mid / LBA High for executing SMART commands */ 331 /* password used in LBA Mid / LBA High for executing SMART commands */
325 ATA_SMART_LBAM_PASS = 0x4F, 332 ATA_SMART_LBAM_PASS = 0x4F,
326 ATA_SMART_LBAH_PASS = 0xC2, 333 ATA_SMART_LBAH_PASS = 0xC2,
@@ -723,6 +730,14 @@ static inline int ata_id_has_unload(const u16 *id)
723 return 0; 730 return 0;
724} 731}
725 732
733static inline int ata_id_has_trim(const u16 *id)
734{
735 if (ata_id_major_version(id) >= 7 &&
736 (id[ATA_ID_DATA_SET_MGMT] & 1))
737 return 1;
738 return 0;
739}
740
726static inline int ata_id_current_chs_valid(const u16 *id) 741static inline int ata_id_current_chs_valid(const u16 *id)
727{ 742{
728 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 743 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
@@ -863,6 +878,32 @@ static inline void ata_id_to_hd_driveid(u16 *id)
863#endif 878#endif
864} 879}
865 880
881/*
882 * Write up to 'max' LBA Range Entries to the buffer that will cover the
883 * extent from sector to sector + count. This is used for TRIM and for
884 * ADD LBA(S) TO NV CACHE PINNED SET.
885 */
886static inline unsigned ata_set_lba_range_entries(void *_buffer, unsigned max,
887 u64 sector, unsigned long count)
888{
889 __le64 *buffer = _buffer;
890 unsigned i = 0;
891
892 while (i < max) {
893 u64 entry = sector |
894 ((u64)(count > 0xffff ? 0xffff : count) << 48);
895 buffer[i++] = __cpu_to_le64(entry);
896 if (count <= 0xffff)
897 break;
898 count -= 0xffff;
899 sector += 0xffff;
900 }
901
902 max = ALIGN(i * 8, 512);
903 memset(buffer + i, 0, max - i * 8);
904 return max;
905}
906
866static inline int is_multi_taskfile(struct ata_taskfile *tf) 907static inline int is_multi_taskfile(struct ata_taskfile *tf)
867{ 908{
868 return (tf->command == ATA_CMD_READ_MULTI) || 909 return (tf->command == ATA_CMD_READ_MULTI) ||
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index bee52abb8a4d..0ec2c594868e 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -24,8 +24,8 @@ struct dentry;
24 */ 24 */
25enum bdi_state { 25enum bdi_state {
26 BDI_pdflush, /* A pdflush thread is working this device */ 26 BDI_pdflush, /* A pdflush thread is working this device */
27 BDI_write_congested, /* The write queue is getting full */ 27 BDI_async_congested, /* The async (write) queue is getting full */
28 BDI_read_congested, /* The read queue is getting full */ 28 BDI_sync_congested, /* The sync queue is getting full */
29 BDI_unused, /* Available bits start here */ 29 BDI_unused, /* Available bits start here */
30}; 30};
31 31
@@ -215,18 +215,18 @@ static inline int bdi_congested(struct backing_dev_info *bdi, int bdi_bits)
215 215
216static inline int bdi_read_congested(struct backing_dev_info *bdi) 216static inline int bdi_read_congested(struct backing_dev_info *bdi)
217{ 217{
218 return bdi_congested(bdi, 1 << BDI_read_congested); 218 return bdi_congested(bdi, 1 << BDI_sync_congested);
219} 219}
220 220
221static inline int bdi_write_congested(struct backing_dev_info *bdi) 221static inline int bdi_write_congested(struct backing_dev_info *bdi)
222{ 222{
223 return bdi_congested(bdi, 1 << BDI_write_congested); 223 return bdi_congested(bdi, 1 << BDI_async_congested);
224} 224}
225 225
226static inline int bdi_rw_congested(struct backing_dev_info *bdi) 226static inline int bdi_rw_congested(struct backing_dev_info *bdi)
227{ 227{
228 return bdi_congested(bdi, (1 << BDI_read_congested)| 228 return bdi_congested(bdi, (1 << BDI_sync_congested) |
229 (1 << BDI_write_congested)); 229 (1 << BDI_async_congested));
230} 230}
231 231
232void clear_bdi_congested(struct backing_dev_info *bdi, int rw); 232void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index b05b1d4d17d2..b900d2c67d29 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -145,20 +145,21 @@ struct bio {
145 * bit 2 -- barrier 145 * bit 2 -- barrier
146 * Insert a serialization point in the IO queue, forcing previously 146 * Insert a serialization point in the IO queue, forcing previously
147 * submitted IO to be completed before this one is issued. 147 * submitted IO to be completed before this one is issued.
148 * bit 3 -- synchronous I/O hint: the block layer will unplug immediately 148 * bit 3 -- synchronous I/O hint.
149 * Note that this does NOT indicate that the IO itself is sync, just 149 * bit 4 -- Unplug the device immediately after submitting this bio.
150 * that the block layer will not postpone issue of this IO by plugging. 150 * bit 5 -- metadata request
151 * bit 4 -- metadata request
152 * Used for tracing to differentiate metadata and data IO. May also 151 * Used for tracing to differentiate metadata and data IO. May also
153 * get some preferential treatment in the IO scheduler 152 * get some preferential treatment in the IO scheduler
154 * bit 5 -- discard sectors 153 * bit 6 -- discard sectors
155 * Informs the lower level device that this range of sectors is no longer 154 * Informs the lower level device that this range of sectors is no longer
156 * used by the file system and may thus be freed by the device. Used 155 * used by the file system and may thus be freed by the device. Used
157 * for flash based storage. 156 * for flash based storage.
158 * bit 6 -- fail fast device errors 157 * bit 7 -- fail fast device errors
159 * bit 7 -- fail fast transport errors 158 * bit 8 -- fail fast transport errors
160 * bit 8 -- fail fast driver errors 159 * bit 9 -- fail fast driver errors
161 * Don't want driver retries for any fast fail whatever the reason. 160 * Don't want driver retries for any fast fail whatever the reason.
161 * bit 10 -- Tell the IO scheduler not to wait for more requests after this
162 one has been submitted, even if it is a SYNC request.
162 */ 163 */
163#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ 164#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
164#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ 165#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
@@ -170,6 +171,7 @@ struct bio {
170#define BIO_RW_FAILFAST_DEV 7 171#define BIO_RW_FAILFAST_DEV 7
171#define BIO_RW_FAILFAST_TRANSPORT 8 172#define BIO_RW_FAILFAST_TRANSPORT 8
172#define BIO_RW_FAILFAST_DRIVER 9 173#define BIO_RW_FAILFAST_DRIVER 9
174#define BIO_RW_NOIDLE 10
173 175
174#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag))) 176#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag)))
175 177
@@ -188,6 +190,7 @@ struct bio {
188#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD) 190#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD)
189#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META) 191#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META)
190#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD) 192#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD)
193#define bio_noidle(bio) bio_rw_flagged(bio, BIO_RW_NOIDLE)
191 194
192/* 195/*
193 * upper 16 bits of bi_rw define the io priority of this bio 196 * upper 16 bits of bi_rw define the io priority of this bio
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 465d6babc847..ba54c834a590 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -38,6 +38,10 @@ struct request;
38typedef void (rq_end_io_fn)(struct request *, int); 38typedef void (rq_end_io_fn)(struct request *, int);
39 39
40struct request_list { 40struct request_list {
41 /*
42 * count[], starved[], and wait[] are indexed by
43 * BLK_RW_SYNC/BLK_RW_ASYNC
44 */
41 int count[2]; 45 int count[2];
42 int starved[2]; 46 int starved[2];
43 int elvpriv; 47 int elvpriv;
@@ -66,6 +70,11 @@ enum rq_cmd_type_bits {
66 REQ_TYPE_ATA_PC, 70 REQ_TYPE_ATA_PC,
67}; 71};
68 72
73enum {
74 BLK_RW_ASYNC = 0,
75 BLK_RW_SYNC = 1,
76};
77
69/* 78/*
70 * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being 79 * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
71 * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a 80 * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
@@ -103,12 +112,12 @@ enum rq_flag_bits {
103 __REQ_QUIET, /* don't worry about errors */ 112 __REQ_QUIET, /* don't worry about errors */
104 __REQ_PREEMPT, /* set for "ide_preempt" requests */ 113 __REQ_PREEMPT, /* set for "ide_preempt" requests */
105 __REQ_ORDERED_COLOR, /* is before or after barrier */ 114 __REQ_ORDERED_COLOR, /* is before or after barrier */
106 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ 115 __REQ_RW_SYNC, /* request is sync (sync write or read) */
107 __REQ_ALLOCED, /* request came from our alloc pool */ 116 __REQ_ALLOCED, /* request came from our alloc pool */
108 __REQ_RW_META, /* metadata io request */ 117 __REQ_RW_META, /* metadata io request */
109 __REQ_COPY_USER, /* contains copies of user pages */ 118 __REQ_COPY_USER, /* contains copies of user pages */
110 __REQ_INTEGRITY, /* integrity metadata has been remapped */ 119 __REQ_INTEGRITY, /* integrity metadata has been remapped */
111 __REQ_UNPLUG, /* unplug queue on submission */ 120 __REQ_NOIDLE, /* Don't anticipate more IO after this one */
112 __REQ_NR_BITS, /* stops here */ 121 __REQ_NR_BITS, /* stops here */
113}; 122};
114 123
@@ -135,7 +144,7 @@ enum rq_flag_bits {
135#define REQ_RW_META (1 << __REQ_RW_META) 144#define REQ_RW_META (1 << __REQ_RW_META)
136#define REQ_COPY_USER (1 << __REQ_COPY_USER) 145#define REQ_COPY_USER (1 << __REQ_COPY_USER)
137#define REQ_INTEGRITY (1 << __REQ_INTEGRITY) 146#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
138#define REQ_UNPLUG (1 << __REQ_UNPLUG) 147#define REQ_NOIDLE (1 << __REQ_NOIDLE)
139 148
140#define BLK_MAX_CDB 16 149#define BLK_MAX_CDB 16
141 150
@@ -438,8 +447,8 @@ struct request_queue
438#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 447#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
439#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 448#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
440#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ 449#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */
441#define QUEUE_FLAG_READFULL 3 /* read queue has been filled */ 450#define QUEUE_FLAG_SYNCFULL 3 /* read queue has been filled */
442#define QUEUE_FLAG_WRITEFULL 4 /* write queue has been filled */ 451#define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */
443#define QUEUE_FLAG_DEAD 5 /* queue being torn down */ 452#define QUEUE_FLAG_DEAD 5 /* queue being torn down */
444#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ 453#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
445#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 454#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
@@ -611,32 +620,42 @@ enum {
611#define rq_data_dir(rq) ((rq)->cmd_flags & 1) 620#define rq_data_dir(rq) ((rq)->cmd_flags & 1)
612 621
613/* 622/*
614 * We regard a request as sync, if it's a READ or a SYNC write. 623 * We regard a request as sync, if either a read or a sync write
615 */ 624 */
616#define rq_is_sync(rq) (rq_data_dir((rq)) == READ || (rq)->cmd_flags & REQ_RW_SYNC) 625static inline bool rw_is_sync(unsigned int rw_flags)
626{
627 return !(rw_flags & REQ_RW) || (rw_flags & REQ_RW_SYNC);
628}
629
630static inline bool rq_is_sync(struct request *rq)
631{
632 return rw_is_sync(rq->cmd_flags);
633}
634
617#define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META) 635#define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META)
636#define rq_noidle(rq) ((rq)->cmd_flags & REQ_NOIDLE)
618 637
619static inline int blk_queue_full(struct request_queue *q, int rw) 638static inline int blk_queue_full(struct request_queue *q, int sync)
620{ 639{
621 if (rw == READ) 640 if (sync)
622 return test_bit(QUEUE_FLAG_READFULL, &q->queue_flags); 641 return test_bit(QUEUE_FLAG_SYNCFULL, &q->queue_flags);
623 return test_bit(QUEUE_FLAG_WRITEFULL, &q->queue_flags); 642 return test_bit(QUEUE_FLAG_ASYNCFULL, &q->queue_flags);
624} 643}
625 644
626static inline void blk_set_queue_full(struct request_queue *q, int rw) 645static inline void blk_set_queue_full(struct request_queue *q, int sync)
627{ 646{
628 if (rw == READ) 647 if (sync)
629 queue_flag_set(QUEUE_FLAG_READFULL, q); 648 queue_flag_set(QUEUE_FLAG_SYNCFULL, q);
630 else 649 else
631 queue_flag_set(QUEUE_FLAG_WRITEFULL, q); 650 queue_flag_set(QUEUE_FLAG_ASYNCFULL, q);
632} 651}
633 652
634static inline void blk_clear_queue_full(struct request_queue *q, int rw) 653static inline void blk_clear_queue_full(struct request_queue *q, int sync)
635{ 654{
636 if (rw == READ) 655 if (sync)
637 queue_flag_clear(QUEUE_FLAG_READFULL, q); 656 queue_flag_clear(QUEUE_FLAG_SYNCFULL, q);
638 else 657 else
639 queue_flag_clear(QUEUE_FLAG_WRITEFULL, q); 658 queue_flag_clear(QUEUE_FLAG_ASYNCFULL, q);
640} 659}
641 660
642 661
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 4864a43b2b45..c3021105edc0 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -377,7 +377,21 @@ struct cpu_vfs_cap_data {
377#define CAP_FOR_EACH_U32(__capi) \ 377#define CAP_FOR_EACH_U32(__capi) \
378 for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi) 378 for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi)
379 379
380/*
381 * CAP_FS_MASK and CAP_NFSD_MASKS:
382 *
383 * The fs mask is all the privileges that fsuid==0 historically meant.
384 * At one time in the past, that included CAP_MKNOD and CAP_LINUX_IMMUTABLE.
385 *
386 * It has never meant setting security.* and trusted.* xattrs.
387 *
388 * We could also define fsmask as follows:
389 * 1. CAP_FS_MASK is the privilege to bypass all fs-related DAC permissions
390 * 2. The security.* and trusted.* xattrs are fs-related MAC permissions
391 */
392
380# define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \ 393# define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \
394 | CAP_TO_MASK(CAP_MKNOD) \
381 | CAP_TO_MASK(CAP_DAC_OVERRIDE) \ 395 | CAP_TO_MASK(CAP_DAC_OVERRIDE) \
382 | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \ 396 | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \
383 | CAP_TO_MASK(CAP_FOWNER) \ 397 | CAP_TO_MASK(CAP_FOWNER) \
@@ -392,11 +406,12 @@ struct cpu_vfs_cap_data {
392# define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) 406# define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }})
393# define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) 407# define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }})
394# define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}) 408# define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }})
395# define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } }) 409# define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \
410 | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \
411 CAP_FS_MASK_B1 } })
396# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ 412# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \
397 | CAP_TO_MASK(CAP_SYS_RESOURCE) \ 413 | CAP_TO_MASK(CAP_SYS_RESOURCE), \
398 | CAP_TO_MASK(CAP_MKNOD), \ 414 CAP_FS_MASK_B1 } })
399 CAP_FS_MASK_B1 } })
400 415
401#endif /* _KERNEL_CAPABILITY_U32S != 2 */ 416#endif /* _KERNEL_CAPABILITY_U32S != 2 */
402 417
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 6faa7e549de4..37bcb50a4d7c 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -76,7 +76,8 @@ struct ftrace_branch_data {
76 * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code 76 * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code
77 * to disable branch tracing on a per file basis. 77 * to disable branch tracing on a per file basis.
78 */ 78 */
79#if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING) 79#if defined(CONFIG_TRACE_BRANCH_PROFILING) \
80 && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)
80void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); 81void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
81 82
82#define likely_notrace(x) __builtin_expect(!!(x), 1) 83#define likely_notrace(x) __builtin_expect(!!(x), 1)
@@ -114,7 +115,9 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
114 * "Define 'is'", Bill Clinton 115 * "Define 'is'", Bill Clinton
115 * "Define 'if'", Steven Rostedt 116 * "Define 'if'", Steven Rostedt
116 */ 117 */
117#define if(cond) if (__builtin_constant_p((cond)) ? !!(cond) : \ 118#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
119#define __trace_if(cond) \
120 if (__builtin_constant_p((cond)) ? !!(cond) : \
118 ({ \ 121 ({ \
119 int ______r; \ 122 int ______r; \
120 static struct ftrace_branch_data \ 123 static struct ftrace_branch_data \
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 096476f1fb35..29b3ce3f2a1d 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -2,12 +2,20 @@
2#define __LINUX_DEBUG_LOCKING_H 2#define __LINUX_DEBUG_LOCKING_H
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <asm/atomic.h>
6#include <asm/system.h>
5 7
6struct task_struct; 8struct task_struct;
7 9
8extern int debug_locks; 10extern int debug_locks;
9extern int debug_locks_silent; 11extern int debug_locks_silent;
10 12
13
14static inline int __debug_locks_off(void)
15{
16 return xchg(&debug_locks, 0);
17}
18
11/* 19/*
12 * Generic 'turn off all lock debugging' function: 20 * Generic 'turn off all lock debugging' function:
13 */ 21 */
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 66ec05a57955..ded2d7c42668 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -116,7 +116,6 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d);
116/* 116/*
117 * Target features 117 * Target features
118 */ 118 */
119#define DM_TARGET_SUPPORTS_BARRIERS 0x00000001
120 119
121struct target_type { 120struct target_type {
122 uint64_t features; 121 uint64_t features;
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index d7d090d21031..8083b6a36a38 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -115,7 +115,7 @@ static inline u64 dma_get_mask(struct device *dev)
115{ 115{
116 if (dev && dev->dma_mask && *dev->dma_mask) 116 if (dev && dev->dma_mask && *dev->dma_mask)
117 return *dev->dma_mask; 117 return *dev->dma_mask;
118 return DMA_32BIT_MASK; 118 return DMA_BIT_MASK(32);
119} 119}
120 120
121extern u64 dma_get_required_mask(struct device *dev); 121extern u64 dma_get_required_mask(struct device *dev);
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 2f3427468956..e397dc342cda 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -34,6 +34,7 @@ struct dmar_drhd_unit {
34 u64 reg_base_addr; /* register base address*/ 34 u64 reg_base_addr; /* register base address*/
35 struct pci_dev **devices; /* target device array */ 35 struct pci_dev **devices; /* target device array */
36 int devices_cnt; /* target device count */ 36 int devices_cnt; /* target device count */
37 u16 segment; /* PCI domain */
37 u8 ignored:1; /* ignore drhd */ 38 u8 ignored:1; /* ignore drhd */
38 u8 include_all:1; 39 u8 include_all:1;
39 struct intel_iommu *iommu; 40 struct intel_iommu *iommu;
@@ -44,6 +45,14 @@ extern struct list_head dmar_drhd_units;
44#define for_each_drhd_unit(drhd) \ 45#define for_each_drhd_unit(drhd) \
45 list_for_each_entry(drhd, &dmar_drhd_units, list) 46 list_for_each_entry(drhd, &dmar_drhd_units, list)
46 47
48#define for_each_active_iommu(i, drhd) \
49 list_for_each_entry(drhd, &dmar_drhd_units, list) \
50 if (i=drhd->iommu, drhd->ignored) {} else
51
52#define for_each_iommu(i, drhd) \
53 list_for_each_entry(drhd, &dmar_drhd_units, list) \
54 if (i=drhd->iommu, 0) {} else
55
47extern int dmar_table_init(void); 56extern int dmar_table_init(void);
48extern int dmar_dev_scope_init(void); 57extern int dmar_dev_scope_init(void);
49 58
@@ -100,6 +109,8 @@ struct irte {
100#ifdef CONFIG_INTR_REMAP 109#ifdef CONFIG_INTR_REMAP
101extern int intr_remapping_enabled; 110extern int intr_remapping_enabled;
102extern int enable_intr_remapping(int); 111extern int enable_intr_remapping(int);
112extern void disable_intr_remapping(void);
113extern int reenable_intr_remapping(int);
103 114
104extern int get_irte(int irq, struct irte *entry); 115extern int get_irte(int irq, struct irte *entry);
105extern int modify_irte(int irq, struct irte *irte_modified); 116extern int modify_irte(int irq, struct irte *irte_modified);
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 7a204256b155..c59b769f62b0 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -116,6 +116,7 @@ extern void elv_abort_queue(struct request_queue *);
116extern void elv_completed_request(struct request_queue *, struct request *); 116extern void elv_completed_request(struct request_queue *, struct request *);
117extern int elv_set_request(struct request_queue *, struct request *, gfp_t); 117extern int elv_set_request(struct request_queue *, struct request *, gfp_t);
118extern void elv_put_request(struct request_queue *, struct request *); 118extern void elv_put_request(struct request_queue *, struct request *);
119extern void elv_drain_elevator(struct request_queue *);
119 120
120/* 121/*
121 * io scheduler registration 122 * io scheduler registration
diff --git a/include/linux/fb.h b/include/linux/fb.h
index f563c5013932..330c4b1bfcaa 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -173,8 +173,12 @@ struct fb_fix_screeninfo {
173/* Interpretation of offset for color fields: All offsets are from the right, 173/* Interpretation of offset for color fields: All offsets are from the right,
174 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you 174 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
175 * can use the offset as right argument to <<). A pixel afterwards is a bit 175 * can use the offset as right argument to <<). A pixel afterwards is a bit
176 * stream and is written to video memory as that unmodified. This implies 176 * stream and is written to video memory as that unmodified.
177 * big-endian byte order if bits_per_pixel is greater than 8. 177 *
178 * For pseudocolor: offset and length should be the same for all color
179 * components. Offset specifies the position of the least significant bit
180 * of the pallette index in a pixel value. Length indicates the number
181 * of available palette entries (i.e. # of entries = 1 << length).
178 */ 182 */
179struct fb_bitfield { 183struct fb_bitfield {
180 __u32 offset; /* beginning of bitfield */ 184 __u32 offset; /* beginning of bitfield */
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 09d6c5bbdddd..a2ec74bc4812 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -5,12 +5,14 @@
5#ifndef __LINUX_FDTABLE_H 5#ifndef __LINUX_FDTABLE_H
6#define __LINUX_FDTABLE_H 6#define __LINUX_FDTABLE_H
7 7
8#include <asm/atomic.h>
9#include <linux/posix_types.h> 8#include <linux/posix_types.h>
10#include <linux/compiler.h> 9#include <linux/compiler.h>
11#include <linux/spinlock.h> 10#include <linux/spinlock.h>
12#include <linux/rcupdate.h> 11#include <linux/rcupdate.h>
13#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/init.h>
14
15#include <asm/atomic.h>
14 16
15/* 17/*
16 * The default fd array needs to be at least BITS_PER_LONG, 18 * The default fd array needs to be at least BITS_PER_LONG,
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h
index 671decbd2aeb..934e22d65801 100644
--- a/include/linux/fiemap.h
+++ b/include/linux/fiemap.h
@@ -11,6 +11,8 @@
11#ifndef _LINUX_FIEMAP_H 11#ifndef _LINUX_FIEMAP_H
12#define _LINUX_FIEMAP_H 12#define _LINUX_FIEMAP_H
13 13
14#include <linux/types.h>
15
14struct fiemap_extent { 16struct fiemap_extent {
15 __u64 fe_logical; /* logical offset in bytes for the start of 17 __u64 fe_logical; /* logical offset in bytes for the start of
16 * the extent from the beginning of the file */ 18 * the extent from the beginning of the file */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a09e17c8f5fd..562d2855cf30 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -95,8 +95,12 @@ struct inodes_stat_t {
95#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ 95#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
96#define READ_SYNC (READ | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG)) 96#define READ_SYNC (READ | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
97#define READ_META (READ | (1 << BIO_RW_META)) 97#define READ_META (READ | (1 << BIO_RW_META))
98#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG)) 98#define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
99#define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG)) 99#define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
100#define WRITE_ODIRECT (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
101#define SWRITE_SYNC_PLUG \
102 (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
103#define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
100#define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) 104#define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER))
101#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) 105#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD)
102#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) 106#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER))
@@ -1695,6 +1699,9 @@ struct file_system_type {
1695 struct lock_class_key i_alloc_sem_key; 1699 struct lock_class_key i_alloc_sem_key;
1696}; 1700};
1697 1701
1702extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data,
1703 int (*fill_super)(struct super_block *, void *, int),
1704 struct vfsmount *mnt);
1698extern int get_sb_bdev(struct file_system_type *fs_type, 1705extern int get_sb_bdev(struct file_system_type *fs_type,
1699 int flags, const char *dev_name, void *data, 1706 int flags, const char *dev_name, void *data,
1700 int (*fill_super)(struct super_block *, void *, int), 1707 int (*fill_super)(struct super_block *, void *, int),
@@ -2337,19 +2344,7 @@ ssize_t simple_transaction_read(struct file *file, char __user *buf,
2337 size_t size, loff_t *pos); 2344 size_t size, loff_t *pos);
2338int simple_transaction_release(struct inode *inode, struct file *file); 2345int simple_transaction_release(struct inode *inode, struct file *file);
2339 2346
2340static inline void simple_transaction_set(struct file *file, size_t n) 2347void simple_transaction_set(struct file *file, size_t n);
2341{
2342 struct simple_transaction_argresp *ar = file->private_data;
2343
2344 BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
2345
2346 /*
2347 * The barrier ensures that ar->size will really remain zero until
2348 * ar->data is ready for reading.
2349 */
2350 smp_mb();
2351 ar->size = n;
2352}
2353 2348
2354/* 2349/*
2355 * simple attribute files 2350 * simple attribute files
@@ -2396,27 +2391,6 @@ ssize_t simple_attr_read(struct file *file, char __user *buf,
2396ssize_t simple_attr_write(struct file *file, const char __user *buf, 2391ssize_t simple_attr_write(struct file *file, const char __user *buf,
2397 size_t len, loff_t *ppos); 2392 size_t len, loff_t *ppos);
2398 2393
2399
2400#ifdef CONFIG_SECURITY
2401static inline char *alloc_secdata(void)
2402{
2403 return (char *)get_zeroed_page(GFP_KERNEL);
2404}
2405
2406static inline void free_secdata(void *secdata)
2407{
2408 free_page((unsigned long)secdata);
2409}
2410#else
2411static inline char *alloc_secdata(void)
2412{
2413 return (char *)1;
2414}
2415
2416static inline void free_secdata(void *secdata)
2417{ }
2418#endif /* CONFIG_SECURITY */
2419
2420struct ctl_table; 2394struct ctl_table;
2421int proc_nr_files(struct ctl_table *table, int write, struct file *filp, 2395int proc_nr_files(struct ctl_table *table, int write, struct file *filp,
2422 void __user *buffer, size_t *lenp, loff_t *ppos); 2396 void __user *buffer, size_t *lenp, loff_t *ppos);
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 43fc95d822d5..244677cc082b 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -79,6 +79,10 @@ struct fsl_spi_platform_data {
79 u16 max_chipselect; 79 u16 max_chipselect;
80 void (*cs_control)(struct spi_device *spi, bool on); 80 void (*cs_control)(struct spi_device *spi, bool on);
81 u32 sysclk; 81 u32 sysclk;
82
83 /* Legacy hooks, used by mpc52xx_psc_spi driver. */
84 void (*activate_cs)(u8 cs, u8 polarity);
85 void (*deactivate_cs)(u8 cs, u8 polarity);
82}; 86};
83 87
84struct mpc8xx_pcmcia_ops { 88struct mpc8xx_pcmcia_ops {
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 015a3d22cf74..8a0c2f221e6b 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -356,6 +356,9 @@ struct ftrace_graph_ret {
356 356
357#ifdef CONFIG_FUNCTION_GRAPH_TRACER 357#ifdef CONFIG_FUNCTION_GRAPH_TRACER
358 358
359/* for init task */
360#define INIT_FTRACE_GRAPH .ret_stack = NULL,
361
359/* 362/*
360 * Stack of return addresses for functions 363 * Stack of return addresses for functions
361 * of a thread. 364 * of a thread.
@@ -430,10 +433,11 @@ static inline void unpause_graph_tracing(void)
430{ 433{
431 atomic_dec(&current->tracing_graph_pause); 434 atomic_dec(&current->tracing_graph_pause);
432} 435}
433#else 436#else /* !CONFIG_FUNCTION_GRAPH_TRACER */
434 437
435#define __notrace_funcgraph 438#define __notrace_funcgraph
436#define __irq_entry 439#define __irq_entry
440#define INIT_FTRACE_GRAPH
437 441
438static inline void ftrace_graph_init_task(struct task_struct *t) { } 442static inline void ftrace_graph_init_task(struct task_struct *t) { }
439static inline void ftrace_graph_exit_task(struct task_struct *t) { } 443static inline void ftrace_graph_exit_task(struct task_struct *t) { }
@@ -445,7 +449,7 @@ static inline int task_curr_ret_stack(struct task_struct *tsk)
445 449
446static inline void pause_graph_tracing(void) { } 450static inline void pause_graph_tracing(void) { }
447static inline void unpause_graph_tracing(void) { } 451static inline void unpause_graph_tracing(void) { }
448#endif 452#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
449 453
450#ifdef CONFIG_TRACING 454#ifdef CONFIG_TRACING
451#include <linux/sched.h> 455#include <linux/sched.h>
@@ -507,33 +511,4 @@ static inline void trace_hw_branch_oops(void) {}
507 511
508#endif /* CONFIG_HW_BRANCH_TRACER */ 512#endif /* CONFIG_HW_BRANCH_TRACER */
509 513
510/*
511 * A syscall entry in the ftrace syscalls array.
512 *
513 * @name: name of the syscall
514 * @nb_args: number of parameters it takes
515 * @types: list of types as strings
516 * @args: list of args as strings (args[i] matches types[i])
517 */
518struct syscall_metadata {
519 const char *name;
520 int nb_args;
521 const char **types;
522 const char **args;
523};
524
525#ifdef CONFIG_FTRACE_SYSCALLS
526extern void arch_init_ftrace_syscalls(void);
527extern struct syscall_metadata *syscall_nr_to_meta(int nr);
528extern void start_ftrace_syscalls(void);
529extern void stop_ftrace_syscalls(void);
530extern void ftrace_syscall_enter(struct pt_regs *regs);
531extern void ftrace_syscall_exit(struct pt_regs *regs);
532#else
533static inline void start_ftrace_syscalls(void) { }
534static inline void stop_ftrace_syscalls(void) { }
535static inline void ftrace_syscall_enter(struct pt_regs *regs) { }
536static inline void ftrace_syscall_exit(struct pt_regs *regs) { }
537#endif
538
539#endif /* _LINUX_FTRACE_H */ 514#endif /* _LINUX_FTRACE_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index faa1cf848bcd..45257475623c 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -116,7 +116,7 @@
116# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET 116# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
117#endif 117#endif
118 118
119#ifdef CONFIG_SMP 119#if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS)
120extern void synchronize_irq(unsigned int irq); 120extern void synchronize_irq(unsigned int irq);
121#else 121#else
122# define synchronize_irq(irq) barrier() 122# define synchronize_irq(irq) barrier()
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index bd37078c2d7d..0d2f7c8a33d6 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -336,6 +336,11 @@ extern int hrtimer_start(struct hrtimer *timer, ktime_t tim,
336 const enum hrtimer_mode mode); 336 const enum hrtimer_mode mode);
337extern int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, 337extern int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
338 unsigned long range_ns, const enum hrtimer_mode mode); 338 unsigned long range_ns, const enum hrtimer_mode mode);
339extern int
340__hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
341 unsigned long delta_ns,
342 const enum hrtimer_mode mode, int wakeup);
343
339extern int hrtimer_cancel(struct hrtimer *timer); 344extern int hrtimer_cancel(struct hrtimer *timer);
340extern int hrtimer_try_to_cancel(struct hrtimer *timer); 345extern int hrtimer_try_to_cancel(struct hrtimer *timer);
341 346
diff --git a/include/linux/i2c-algo-sgi.h b/include/linux/i2c-algo-sgi.h
deleted file mode 100644
index 3b7715024e69..000000000000
--- a/include/linux/i2c-algo-sgi.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License version 2 as published by the Free Software Foundation.
4 *
5 * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
6 */
7
8#ifndef I2C_ALGO_SGI_H
9#define I2C_ALGO_SGI_H 1
10
11#include <linux/i2c.h>
12
13struct i2c_algo_sgi_data {
14 void *data; /* private data for lowlevel routines */
15 unsigned (*getctrl)(void *data);
16 void (*setctrl)(void *data, unsigned val);
17 unsigned (*rdata)(void *data);
18 void (*wdata)(void *data, unsigned val);
19
20 int xfer_timeout;
21 int ack_timeout;
22};
23
24int i2c_sgi_add_bus(struct i2c_adapter *);
25
26#endif /* I2C_ALGO_SGI_H */
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index f27604af8378..c9087de5c6c6 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -33,47 +33,10 @@
33 33
34#define I2C_DRIVERID_MSP3400 1 34#define I2C_DRIVERID_MSP3400 1
35#define I2C_DRIVERID_TUNER 2 35#define I2C_DRIVERID_TUNER 2
36#define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */
37#define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */
38#define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */
39#define I2C_DRIVERID_SAA7111A 8 /* video input processor */
40#define I2C_DRIVERID_SAA7185B 13 /* video encoder */
41#define I2C_DRIVERID_SAA7110 22 /* video decoder */
42#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */
43#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ 36#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */
44#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ 37#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */
45#define I2C_DRIVERID_TDA9875 32 /* TV sound decoder chip */
46#define I2C_DRIVERID_BT819 40 /* video decoder */
47#define I2C_DRIVERID_BT856 41 /* video encoder */
48#define I2C_DRIVERID_VPX3220 42 /* video decoder+vbi/vtxt */
49#define I2C_DRIVERID_ADV7175 48 /* ADV 7175/7176 video encoder */
50#define I2C_DRIVERID_SAA7114 49 /* video decoder */
51#define I2C_DRIVERID_ADV7170 54 /* video encoder */
52#define I2C_DRIVERID_SAA7191 57 /* video decoder */
53#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
54#define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */
55#define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */
56#define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */
57#define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */
58#define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */
59#define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */
60#define I2C_DRIVERID_SAA7127 72 /* saa7127 video encoder */
61#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ 38#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */
62#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ 39#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */
63#define I2C_DRIVERID_TVP5150 76 /* TVP5150 video decoder */
64#define I2C_DRIVERID_WM8739 77 /* wm8739 audio processor */
65#define I2C_DRIVERID_UPD64083 78 /* upd64083 video processor */
66#define I2C_DRIVERID_UPD64031A 79 /* upd64031a video processor */
67#define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */
68#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */
69#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
70#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
71#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */
72#define I2C_DRIVERID_M52790 95 /* Mitsubishi M52790SP/FP AV switch */
73#define I2C_DRIVERID_CS5345 96 /* cs5345 audio processor */
74#define I2C_DRIVERID_AU8522 97 /* Auvitek au8522 */
75
76#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */
77 40
78/* 41/*
79 * ---- Adapter types ---------------------------------------------------- 42 * ---- Adapter types ----------------------------------------------------
@@ -88,6 +51,7 @@
88#define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ 51#define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */
89#define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ 52#define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */
90#define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */ 53#define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */
54#define I2C_HW_B_CX231XX 0x010024 /* Conexant CX231XX USB based cards */
91#define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ 55#define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */
92 56
93/* --- SGI adapters */ 57/* --- SGI adapters */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index c86c3b07604c..ad2580596033 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -274,7 +274,7 @@ struct i2c_board_info {
274 * are provided using conventional syntax. 274 * are provided using conventional syntax.
275 */ 275 */
276#define I2C_BOARD_INFO(dev_type, dev_addr) \ 276#define I2C_BOARD_INFO(dev_type, dev_addr) \
277 .type = (dev_type), .addr = (dev_addr) 277 .type = dev_type, .addr = (dev_addr)
278 278
279 279
280/* Add-on boards should register/unregister their devices; e.g. a board 280/* Add-on boards should register/unregister their devices; e.g. a board
@@ -353,8 +353,8 @@ struct i2c_adapter {
353 void *algo_data; 353 void *algo_data;
354 354
355 /* --- administration stuff. */ 355 /* --- administration stuff. */
356 int (*client_register)(struct i2c_client *); 356 int (*client_register)(struct i2c_client *) __deprecated;
357 int (*client_unregister)(struct i2c_client *); 357 int (*client_unregister)(struct i2c_client *) __deprecated;
358 358
359 /* data fields that are valid for all devices */ 359 /* data fields that are valid for all devices */
360 u8 level; /* nesting level for lockdep */ 360 u8 level; /* nesting level for lockdep */
diff --git a/include/linux/i2c/s6000.h b/include/linux/i2c/s6000.h
new file mode 100644
index 000000000000..d9b34bfdae76
--- /dev/null
+++ b/include/linux/i2c/s6000.h
@@ -0,0 +1,10 @@
1#ifndef __LINUX_I2C_S6000_H
2#define __LINUX_I2C_S6000_H
3
4struct s6_i2c_platform_data {
5 const char *clock; /* the clock to use */
6 int bus_num; /* the bus number to register */
7};
8
9#endif
10
diff --git a/include/linux/ide.h b/include/linux/ide.h
index a5d26f66ef78..ff65fffb078f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -240,65 +240,38 @@ typedef enum {
240} ide_startstop_t; 240} ide_startstop_t;
241 241
242enum { 242enum {
243 IDE_VALID_ERROR = (1 << 1),
244 IDE_VALID_FEATURE = IDE_VALID_ERROR,
245 IDE_VALID_NSECT = (1 << 2),
246 IDE_VALID_LBAL = (1 << 3),
247 IDE_VALID_LBAM = (1 << 4),
248 IDE_VALID_LBAH = (1 << 5),
249 IDE_VALID_DEVICE = (1 << 6),
250 IDE_VALID_LBA = IDE_VALID_LBAL |
251 IDE_VALID_LBAM |
252 IDE_VALID_LBAH,
253 IDE_VALID_OUT_TF = IDE_VALID_FEATURE |
254 IDE_VALID_NSECT |
255 IDE_VALID_LBA,
256 IDE_VALID_IN_TF = IDE_VALID_NSECT |
257 IDE_VALID_LBA,
258 IDE_VALID_OUT_HOB = IDE_VALID_OUT_TF,
259 IDE_VALID_IN_HOB = IDE_VALID_ERROR |
260 IDE_VALID_NSECT |
261 IDE_VALID_LBA,
262};
263
264enum {
243 IDE_TFLAG_LBA48 = (1 << 0), 265 IDE_TFLAG_LBA48 = (1 << 0),
244 IDE_TFLAG_OUT_HOB_FEATURE = (1 << 1), 266 IDE_TFLAG_WRITE = (1 << 1),
245 IDE_TFLAG_OUT_HOB_NSECT = (1 << 2), 267 IDE_TFLAG_CUSTOM_HANDLER = (1 << 2),
246 IDE_TFLAG_OUT_HOB_LBAL = (1 << 3), 268 IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 3),
247 IDE_TFLAG_OUT_HOB_LBAM = (1 << 4),
248 IDE_TFLAG_OUT_HOB_LBAH = (1 << 5),
249 IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE |
250 IDE_TFLAG_OUT_HOB_NSECT |
251 IDE_TFLAG_OUT_HOB_LBAL |
252 IDE_TFLAG_OUT_HOB_LBAM |
253 IDE_TFLAG_OUT_HOB_LBAH,
254 IDE_TFLAG_OUT_FEATURE = (1 << 6),
255 IDE_TFLAG_OUT_NSECT = (1 << 7),
256 IDE_TFLAG_OUT_LBAL = (1 << 8),
257 IDE_TFLAG_OUT_LBAM = (1 << 9),
258 IDE_TFLAG_OUT_LBAH = (1 << 10),
259 IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE |
260 IDE_TFLAG_OUT_NSECT |
261 IDE_TFLAG_OUT_LBAL |
262 IDE_TFLAG_OUT_LBAM |
263 IDE_TFLAG_OUT_LBAH,
264 IDE_TFLAG_OUT_DEVICE = (1 << 11),
265 IDE_TFLAG_WRITE = (1 << 12),
266 IDE_TFLAG_CUSTOM_HANDLER = (1 << 13),
267 IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 14),
268 IDE_TFLAG_IN_HOB_ERROR = (1 << 15),
269 IDE_TFLAG_IN_HOB_NSECT = (1 << 16),
270 IDE_TFLAG_IN_HOB_LBAL = (1 << 17),
271 IDE_TFLAG_IN_HOB_LBAM = (1 << 18),
272 IDE_TFLAG_IN_HOB_LBAH = (1 << 19),
273 IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL |
274 IDE_TFLAG_IN_HOB_LBAM |
275 IDE_TFLAG_IN_HOB_LBAH,
276 IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_ERROR |
277 IDE_TFLAG_IN_HOB_NSECT |
278 IDE_TFLAG_IN_HOB_LBA,
279 IDE_TFLAG_IN_ERROR = (1 << 20),
280 IDE_TFLAG_IN_NSECT = (1 << 21),
281 IDE_TFLAG_IN_LBAL = (1 << 22),
282 IDE_TFLAG_IN_LBAM = (1 << 23),
283 IDE_TFLAG_IN_LBAH = (1 << 24),
284 IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL |
285 IDE_TFLAG_IN_LBAM |
286 IDE_TFLAG_IN_LBAH,
287 IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT |
288 IDE_TFLAG_IN_LBA,
289 IDE_TFLAG_IN_DEVICE = (1 << 25),
290 IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB |
291 IDE_TFLAG_IN_HOB,
292 IDE_TFLAG_TF = IDE_TFLAG_OUT_TF |
293 IDE_TFLAG_IN_TF,
294 IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE |
295 IDE_TFLAG_IN_DEVICE,
296 /* force 16-bit I/O operations */ 269 /* force 16-bit I/O operations */
297 IDE_TFLAG_IO_16BIT = (1 << 26), 270 IDE_TFLAG_IO_16BIT = (1 << 4),
298 /* struct ide_cmd was allocated using kmalloc() */ 271 /* struct ide_cmd was allocated using kmalloc() */
299 IDE_TFLAG_DYN = (1 << 27), 272 IDE_TFLAG_DYN = (1 << 5),
300 IDE_TFLAG_FS = (1 << 28), 273 IDE_TFLAG_FS = (1 << 6),
301 IDE_TFLAG_MULTI_PIO = (1 << 29), 274 IDE_TFLAG_MULTI_PIO = (1 << 7),
302}; 275};
303 276
304enum { 277enum {
@@ -309,45 +282,34 @@ enum {
309}; 282};
310 283
311struct ide_taskfile { 284struct ide_taskfile {
312 u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */ 285 u8 data; /* 0: data byte (for TASKFILE ioctl) */
313 /* 1-5: additional data to support LBA48 */ 286 union { /* 1: */
314 union { 287 u8 error; /* read: error */
315 u8 hob_error; /* read: error */ 288 u8 feature; /* write: feature */
316 u8 hob_feature; /* write: feature */
317 };
318
319 u8 hob_nsect;
320 u8 hob_lbal;
321 u8 hob_lbam;
322 u8 hob_lbah;
323
324 u8 data; /* 6: low data byte (for TASKFILE IOCTL) */
325
326 union { /*  7: */
327 u8 error; /* read: error */
328 u8 feature; /* write: feature */
329 }; 289 };
330 290 u8 nsect; /* 2: number of sectors */
331 u8 nsect; /* 8: number of sectors */ 291 u8 lbal; /* 3: LBA low */
332 u8 lbal; /* 9: LBA low */ 292 u8 lbam; /* 4: LBA mid */
333 u8 lbam; /* 10: LBA mid */ 293 u8 lbah; /* 5: LBA high */
334 u8 lbah; /* 11: LBA high */ 294 u8 device; /* 6: device select */
335 295 union { /* 7: */
336 u8 device; /* 12: device select */ 296 u8 status; /* read: status */
337
338 union { /* 13: */
339 u8 status; /*  read: status  */
340 u8 command; /* write: command */ 297 u8 command; /* write: command */
341 }; 298 };
342}; 299};
343 300
344struct ide_cmd { 301struct ide_cmd {
345 union { 302 struct ide_taskfile tf;
346 struct ide_taskfile tf; 303 struct ide_taskfile hob;
347 u8 tf_array[14]; 304 struct {
348 }; 305 struct {
306 u8 tf;
307 u8 hob;
308 } out, in;
309 } valid;
310
311 u8 tf_flags;
349 u8 ftf_flags; /* for TASKFILE ioctl */ 312 u8 ftf_flags; /* for TASKFILE ioctl */
350 u32 tf_flags;
351 int protocol; 313 int protocol;
352 314
353 int sg_nents; /* number of sg entries */ 315 int sg_nents; /* number of sg entries */
@@ -662,8 +624,8 @@ struct ide_tp_ops {
662 void (*write_devctl)(struct hwif_s *, u8); 624 void (*write_devctl)(struct hwif_s *, u8);
663 625
664 void (*dev_select)(ide_drive_t *); 626 void (*dev_select)(ide_drive_t *);
665 void (*tf_load)(ide_drive_t *, struct ide_cmd *); 627 void (*tf_load)(ide_drive_t *, struct ide_taskfile *, u8);
666 void (*tf_read)(ide_drive_t *, struct ide_cmd *); 628 void (*tf_read)(ide_drive_t *, struct ide_taskfile *, u8);
667 629
668 void (*input_data)(ide_drive_t *, struct ide_cmd *, 630 void (*input_data)(ide_drive_t *, struct ide_cmd *,
669 void *, unsigned int); 631 void *, unsigned int);
@@ -1162,7 +1124,8 @@ extern int ide_devset_execute(ide_drive_t *drive,
1162void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8); 1124void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8);
1163int ide_complete_rq(ide_drive_t *, int, unsigned int); 1125int ide_complete_rq(ide_drive_t *, int, unsigned int);
1164 1126
1165void ide_tf_dump(const char *, struct ide_taskfile *); 1127void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd);
1128void ide_tf_dump(const char *, struct ide_cmd *);
1166 1129
1167void ide_exec_command(ide_hwif_t *, u8); 1130void ide_exec_command(ide_hwif_t *, u8);
1168u8 ide_read_status(ide_hwif_t *); 1131u8 ide_read_status(ide_hwif_t *);
@@ -1170,8 +1133,8 @@ u8 ide_read_altstatus(ide_hwif_t *);
1170void ide_write_devctl(ide_hwif_t *, u8); 1133void ide_write_devctl(ide_hwif_t *, u8);
1171 1134
1172void ide_dev_select(ide_drive_t *); 1135void ide_dev_select(ide_drive_t *);
1173void ide_tf_load(ide_drive_t *, struct ide_cmd *); 1136void ide_tf_load(ide_drive_t *, struct ide_taskfile *, u8);
1174void ide_tf_read(ide_drive_t *, struct ide_cmd *); 1137void ide_tf_read(ide_drive_t *, struct ide_taskfile *, u8);
1175 1138
1176void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1139void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int);
1177void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1140void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int);
@@ -1529,7 +1492,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data)
1529 1492
1530extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1493extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1531 1494
1532u64 ide_get_lba_addr(struct ide_taskfile *, int); 1495u64 ide_get_lba_addr(struct ide_cmd *, int);
1533u8 ide_dump_status(ide_drive_t *, const char *, u8); 1496u8 ide_dump_status(ide_drive_t *, const char *, u8);
1534 1497
1535struct ide_timing { 1498struct ide_timing {
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index af1de95e711e..d87247d2641f 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -5,6 +5,7 @@
5#include <linux/irqflags.h> 5#include <linux/irqflags.h>
6#include <linux/utsname.h> 6#include <linux/utsname.h>
7#include <linux/lockdep.h> 7#include <linux/lockdep.h>
8#include <linux/ftrace.h>
8#include <linux/ipc.h> 9#include <linux/ipc.h>
9#include <linux/pid_namespace.h> 10#include <linux/pid_namespace.h>
10#include <linux/user_namespace.h> 11#include <linux/user_namespace.h>
@@ -14,19 +15,6 @@
14extern struct files_struct init_files; 15extern struct files_struct init_files;
15extern struct fs_struct init_fs; 16extern struct fs_struct init_fs;
16 17
17#define INIT_KIOCTX(name, which_mm) \
18{ \
19 .users = ATOMIC_INIT(1), \
20 .dead = 0, \
21 .mm = &which_mm, \
22 .user_id = 0, \
23 .next = NULL, \
24 .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \
25 .ctx_lock = __SPIN_LOCK_UNLOCKED(name.ctx_lock), \
26 .reqs_active = 0U, \
27 .max_reqs = ~0U, \
28}
29
30#define INIT_MM(name) \ 18#define INIT_MM(name) \
31{ \ 19{ \
32 .mm_rb = RB_ROOT, \ 20 .mm_rb = RB_ROOT, \
@@ -185,6 +173,7 @@ extern struct cred init_cred;
185 INIT_IDS \ 173 INIT_IDS \
186 INIT_TRACE_IRQFLAGS \ 174 INIT_TRACE_IRQFLAGS \
187 INIT_LOCKDEP \ 175 INIT_LOCKDEP \
176 INIT_FTRACE_GRAPH \
188} 177}
189 178
190 179
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 77214ead1a36..aa8c53171233 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -164,6 +164,7 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
164#define DMA_GCMD_QIE (((u32)1) << 26) 164#define DMA_GCMD_QIE (((u32)1) << 26)
165#define DMA_GCMD_SIRTP (((u32)1) << 24) 165#define DMA_GCMD_SIRTP (((u32)1) << 24)
166#define DMA_GCMD_IRE (((u32) 1) << 25) 166#define DMA_GCMD_IRE (((u32) 1) << 25)
167#define DMA_GCMD_CFI (((u32) 1) << 23)
167 168
168/* GSTS_REG */ 169/* GSTS_REG */
169#define DMA_GSTS_TES (((u32)1) << 31) 170#define DMA_GSTS_TES (((u32)1) << 31)
@@ -174,6 +175,7 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
174#define DMA_GSTS_QIES (((u32)1) << 26) 175#define DMA_GSTS_QIES (((u32)1) << 26)
175#define DMA_GSTS_IRTPS (((u32)1) << 24) 176#define DMA_GSTS_IRTPS (((u32)1) << 24)
176#define DMA_GSTS_IRES (((u32)1) << 25) 177#define DMA_GSTS_IRES (((u32)1) << 25)
178#define DMA_GSTS_CFIS (((u32)1) << 23)
177 179
178/* CCMD_REG */ 180/* CCMD_REG */
179#define DMA_CCMD_ICC (((u64)1) << 63) 181#define DMA_CCMD_ICC (((u64)1) << 63)
@@ -284,6 +286,14 @@ struct iommu_flush {
284 unsigned int size_order, u64 type, int non_present_entry_flush); 286 unsigned int size_order, u64 type, int non_present_entry_flush);
285}; 287};
286 288
289enum {
290 SR_DMAR_FECTL_REG,
291 SR_DMAR_FEDATA_REG,
292 SR_DMAR_FEADDR_REG,
293 SR_DMAR_FEUADDR_REG,
294 MAX_SR_DMAR_REGS
295};
296
287struct intel_iommu { 297struct intel_iommu {
288 void __iomem *reg; /* Pointer to hardware regs, virtual addr */ 298 void __iomem *reg; /* Pointer to hardware regs, virtual addr */
289 u64 cap; 299 u64 cap;
@@ -304,6 +314,8 @@ struct intel_iommu {
304 struct iommu_flush flush; 314 struct iommu_flush flush;
305#endif 315#endif
306 struct q_inval *qi; /* Queued invalidation info */ 316 struct q_inval *qi; /* Queued invalidation info */
317 u32 *iommu_state; /* Store iommu states between suspend and resume.*/
318
307#ifdef CONFIG_INTR_REMAP 319#ifdef CONFIG_INTR_REMAP
308 struct ir_table *ir_table; /* Interrupt remapping info */ 320 struct ir_table *ir_table; /* Interrupt remapping info */
309#endif 321#endif
@@ -322,6 +334,7 @@ extern int alloc_iommu(struct dmar_drhd_unit *drhd);
322extern void free_iommu(struct intel_iommu *iommu); 334extern void free_iommu(struct intel_iommu *iommu);
323extern int dmar_enable_qi(struct intel_iommu *iommu); 335extern int dmar_enable_qi(struct intel_iommu *iommu);
324extern void dmar_disable_qi(struct intel_iommu *iommu); 336extern void dmar_disable_qi(struct intel_iommu *iommu);
337extern int dmar_reenable_qi(struct intel_iommu *iommu);
325extern void qi_global_iec(struct intel_iommu *iommu); 338extern void qi_global_iec(struct intel_iommu *iommu);
326 339
327extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, 340extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index ce2c07d99fc3..91bb76f44f14 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -59,6 +59,18 @@
59#define IRQF_NOBALANCING 0x00000800 59#define IRQF_NOBALANCING 0x00000800
60#define IRQF_IRQPOLL 0x00001000 60#define IRQF_IRQPOLL 0x00001000
61 61
62/*
63 * Bits used by threaded handlers:
64 * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run
65 * IRQTF_DIED - handler thread died
66 * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
67 */
68enum {
69 IRQTF_RUNTHREAD,
70 IRQTF_DIED,
71 IRQTF_WARNED,
72};
73
62typedef irqreturn_t (*irq_handler_t)(int, void *); 74typedef irqreturn_t (*irq_handler_t)(int, void *);
63 75
64/** 76/**
@@ -71,6 +83,9 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
71 * @next: pointer to the next irqaction for shared interrupts 83 * @next: pointer to the next irqaction for shared interrupts
72 * @irq: interrupt number 84 * @irq: interrupt number
73 * @dir: pointer to the proc/irq/NN/name entry 85 * @dir: pointer to the proc/irq/NN/name entry
86 * @thread_fn: interupt handler function for threaded interrupts
87 * @thread: thread pointer for threaded interrupts
88 * @thread_flags: flags related to @thread
74 */ 89 */
75struct irqaction { 90struct irqaction {
76 irq_handler_t handler; 91 irq_handler_t handler;
@@ -81,18 +96,68 @@ struct irqaction {
81 struct irqaction *next; 96 struct irqaction *next;
82 int irq; 97 int irq;
83 struct proc_dir_entry *dir; 98 struct proc_dir_entry *dir;
99 irq_handler_t thread_fn;
100 struct task_struct *thread;
101 unsigned long thread_flags;
84}; 102};
85 103
86extern irqreturn_t no_action(int cpl, void *dev_id); 104extern irqreturn_t no_action(int cpl, void *dev_id);
87extern int __must_check request_irq(unsigned int, irq_handler_t handler, 105
88 unsigned long, const char *, void *); 106#ifdef CONFIG_GENERIC_HARDIRQS
107extern int __must_check
108request_threaded_irq(unsigned int irq, irq_handler_t handler,
109 irq_handler_t thread_fn,
110 unsigned long flags, const char *name, void *dev);
111
112static inline int __must_check
113request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
114 const char *name, void *dev)
115{
116 return request_threaded_irq(irq, handler, NULL, flags, name, dev);
117}
118
119extern void exit_irq_thread(void);
120#else
121
122extern int __must_check
123request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
124 const char *name, void *dev);
125
126/*
127 * Special function to avoid ifdeffery in kernel/irq/devres.c which
128 * gets magically built by GENERIC_HARDIRQS=n architectures (sparc,
129 * m68k). I really love these $@%#!* obvious Makefile references:
130 * ../../../kernel/irq/devres.o
131 */
132static inline int __must_check
133request_threaded_irq(unsigned int irq, irq_handler_t handler,
134 irq_handler_t thread_fn,
135 unsigned long flags, const char *name, void *dev)
136{
137 return request_irq(irq, handler, flags, name, dev);
138}
139
140static inline void exit_irq_thread(void) { }
141#endif
142
89extern void free_irq(unsigned int, void *); 143extern void free_irq(unsigned int, void *);
90 144
91struct device; 145struct device;
92 146
93extern int __must_check devm_request_irq(struct device *dev, unsigned int irq, 147extern int __must_check
94 irq_handler_t handler, unsigned long irqflags, 148devm_request_threaded_irq(struct device *dev, unsigned int irq,
95 const char *devname, void *dev_id); 149 irq_handler_t handler, irq_handler_t thread_fn,
150 unsigned long irqflags, const char *devname,
151 void *dev_id);
152
153static inline int __must_check
154devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler,
155 unsigned long irqflags, const char *devname, void *dev_id)
156{
157 return devm_request_threaded_irq(dev, irq, handler, NULL, irqflags,
158 devname, dev_id);
159}
160
96extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id); 161extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
97 162
98/* 163/*
@@ -299,6 +364,7 @@ extern void softirq_init(void);
299#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0) 364#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)
300extern void raise_softirq_irqoff(unsigned int nr); 365extern void raise_softirq_irqoff(unsigned int nr);
301extern void raise_softirq(unsigned int nr); 366extern void raise_softirq(unsigned int nr);
367extern void wakeup_softirqd(void);
302 368
303/* This is the worklist that queues up per-cpu softirq work. 369/* This is the worklist that queues up per-cpu softirq work.
304 * 370 *
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index ea330f9e7100..3bf40e246a80 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -25,7 +25,7 @@ struct ipc_ids {
25}; 25};
26 26
27struct ipc_namespace { 27struct ipc_namespace {
28 struct kref kref; 28 atomic_t count;
29 struct ipc_ids ids[3]; 29 struct ipc_ids ids[3];
30 30
31 int sem_ctls[4]; 31 int sem_ctls[4];
@@ -44,25 +44,57 @@ struct ipc_namespace {
44 int shm_tot; 44 int shm_tot;
45 45
46 struct notifier_block ipcns_nb; 46 struct notifier_block ipcns_nb;
47
48 /* The kern_mount of the mqueuefs sb. We take a ref on it */
49 struct vfsmount *mq_mnt;
50
51 /* # queues in this ns, protected by mq_lock */
52 unsigned int mq_queues_count;
53
54 /* next fields are set through sysctl */
55 unsigned int mq_queues_max; /* initialized to DFLT_QUEUESMAX */
56 unsigned int mq_msg_max; /* initialized to DFLT_MSGMAX */
57 unsigned int mq_msgsize_max; /* initialized to DFLT_MSGSIZEMAX */
58
47}; 59};
48 60
49extern struct ipc_namespace init_ipc_ns; 61extern struct ipc_namespace init_ipc_ns;
50extern atomic_t nr_ipc_ns; 62extern atomic_t nr_ipc_ns;
51 63
52#ifdef CONFIG_SYSVIPC 64extern spinlock_t mq_lock;
65#if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC)
53#define INIT_IPC_NS(ns) .ns = &init_ipc_ns, 66#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
67#else
68#define INIT_IPC_NS(ns)
69#endif
54 70
71#ifdef CONFIG_SYSVIPC
55extern int register_ipcns_notifier(struct ipc_namespace *); 72extern int register_ipcns_notifier(struct ipc_namespace *);
56extern int cond_register_ipcns_notifier(struct ipc_namespace *); 73extern int cond_register_ipcns_notifier(struct ipc_namespace *);
57extern void unregister_ipcns_notifier(struct ipc_namespace *); 74extern void unregister_ipcns_notifier(struct ipc_namespace *);
58extern int ipcns_notify(unsigned long); 75extern int ipcns_notify(unsigned long);
59
60#else /* CONFIG_SYSVIPC */ 76#else /* CONFIG_SYSVIPC */
61#define INIT_IPC_NS(ns) 77static inline int register_ipcns_notifier(struct ipc_namespace *ns)
78{ return 0; }
79static inline int cond_register_ipcns_notifier(struct ipc_namespace *ns)
80{ return 0; }
81static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { }
82static inline int ipcns_notify(unsigned long l) { return 0; }
62#endif /* CONFIG_SYSVIPC */ 83#endif /* CONFIG_SYSVIPC */
63 84
64#if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS) 85#ifdef CONFIG_POSIX_MQUEUE
65extern void free_ipc_ns(struct kref *kref); 86extern int mq_init_ns(struct ipc_namespace *ns);
87/* default values */
88#define DFLT_QUEUESMAX 256 /* max number of message queues */
89#define DFLT_MSGMAX 10 /* max number of messages in each queue */
90#define HARD_MSGMAX (131072/sizeof(void *))
91#define DFLT_MSGSIZEMAX 8192 /* max message size */
92#else
93static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; }
94#endif
95
96#if defined(CONFIG_IPC_NS)
97extern void free_ipc_ns(struct ipc_namespace *ns);
66extern struct ipc_namespace *copy_ipcs(unsigned long flags, 98extern struct ipc_namespace *copy_ipcs(unsigned long flags,
67 struct ipc_namespace *ns); 99 struct ipc_namespace *ns);
68extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, 100extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
@@ -72,14 +104,11 @@ extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
72static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) 104static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
73{ 105{
74 if (ns) 106 if (ns)
75 kref_get(&ns->kref); 107 atomic_inc(&ns->count);
76 return ns; 108 return ns;
77} 109}
78 110
79static inline void put_ipc_ns(struct ipc_namespace *ns) 111extern void put_ipc_ns(struct ipc_namespace *ns);
80{
81 kref_put(&ns->kref, free_ipc_ns);
82}
83#else 112#else
84static inline struct ipc_namespace *copy_ipcs(unsigned long flags, 113static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
85 struct ipc_namespace *ns) 114 struct ipc_namespace *ns)
@@ -99,4 +128,18 @@ static inline void put_ipc_ns(struct ipc_namespace *ns)
99{ 128{
100} 129}
101#endif 130#endif
131
132#ifdef CONFIG_POSIX_MQUEUE_SYSCTL
133
134struct ctl_table_header;
135extern struct ctl_table_header *mq_register_sysctl_table(void);
136
137#else /* CONFIG_POSIX_MQUEUE_SYSCTL */
138
139static inline struct ctl_table_header *mq_register_sysctl_table(void)
140{
141 return NULL;
142}
143
144#endif /* CONFIG_POSIX_MQUEUE_SYSCTL */
102#endif 145#endif
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 974890b3c52f..b7cbeed972e4 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -22,6 +22,7 @@
22#include <linux/irqnr.h> 22#include <linux/irqnr.h>
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/topology.h> 24#include <linux/topology.h>
25#include <linux/wait.h>
25 26
26#include <asm/irq.h> 27#include <asm/irq.h>
27#include <asm/ptrace.h> 28#include <asm/ptrace.h>
@@ -158,6 +159,8 @@ struct irq_2_iommu;
158 * @affinity: IRQ affinity on SMP 159 * @affinity: IRQ affinity on SMP
159 * @cpu: cpu index useful for balancing 160 * @cpu: cpu index useful for balancing
160 * @pending_mask: pending rebalanced interrupts 161 * @pending_mask: pending rebalanced interrupts
162 * @threads_active: number of irqaction threads currently running
163 * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers
161 * @dir: /proc/irq/ procfs entry 164 * @dir: /proc/irq/ procfs entry
162 * @name: flow handler name for /proc/interrupts output 165 * @name: flow handler name for /proc/interrupts output
163 */ 166 */
@@ -189,6 +192,8 @@ struct irq_desc {
189 cpumask_var_t pending_mask; 192 cpumask_var_t pending_mask;
190#endif 193#endif
191#endif 194#endif
195 atomic_t threads_active;
196 wait_queue_head_t wait_for_threads;
192#ifdef CONFIG_PROC_FS 197#ifdef CONFIG_PROC_FS
193 struct proc_dir_entry *dir; 198 struct proc_dir_entry *dir;
194#endif 199#endif
@@ -482,6 +487,16 @@ static inline void init_copy_desc_masks(struct irq_desc *old_desc,
482#endif 487#endif
483} 488}
484 489
490static inline void free_desc_masks(struct irq_desc *old_desc,
491 struct irq_desc *new_desc)
492{
493 free_cpumask_var(old_desc->affinity);
494
495#ifdef CONFIG_GENERIC_PENDING_IRQ
496 free_cpumask_var(old_desc->pending_mask);
497#endif
498}
499
485#else /* !CONFIG_SMP */ 500#else /* !CONFIG_SMP */
486 501
487static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, 502static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
@@ -495,6 +510,10 @@ static inline void init_copy_desc_masks(struct irq_desc *old_desc,
495{ 510{
496} 511}
497 512
513static inline void free_desc_masks(struct irq_desc *old_desc,
514 struct irq_desc *new_desc)
515{
516}
498#endif /* CONFIG_SMP */ 517#endif /* CONFIG_SMP */
499 518
500#endif /* _LINUX_IRQ_H */ 519#endif /* _LINUX_IRQ_H */
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h
index c5584ca5b8c9..819acaaac3f5 100644
--- a/include/linux/irqreturn.h
+++ b/include/linux/irqreturn.h
@@ -5,10 +5,12 @@
5 * enum irqreturn 5 * enum irqreturn
6 * @IRQ_NONE interrupt was not from this device 6 * @IRQ_NONE interrupt was not from this device
7 * @IRQ_HANDLED interrupt was handled by this device 7 * @IRQ_HANDLED interrupt was handled by this device
8 * @IRQ_WAKE_THREAD handler requests to wake the handler thread
8 */ 9 */
9enum irqreturn { 10enum irqreturn {
10 IRQ_NONE, 11 IRQ_NONE,
11 IRQ_HANDLED, 12 IRQ_HANDLED,
13 IRQ_WAKE_THREAD,
12}; 14};
13 15
14typedef enum irqreturn irqreturn_t; 16typedef enum irqreturn irqreturn_t;
diff --git a/include/linux/key.h b/include/linux/key.h
index 21d32a142c00..e544f466d69a 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -20,6 +20,7 @@
20#include <linux/rbtree.h> 20#include <linux/rbtree.h>
21#include <linux/rcupdate.h> 21#include <linux/rcupdate.h>
22#include <linux/sysctl.h> 22#include <linux/sysctl.h>
23#include <linux/rwsem.h>
23#include <asm/atomic.h> 24#include <asm/atomic.h>
24 25
25#ifdef __KERNEL__ 26#ifdef __KERNEL__
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index d5fa565086d1..384ca8bbf1ac 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -34,7 +34,7 @@ extern int __request_module(bool wait, const char *name, ...) \
34#define request_module(mod...) __request_module(true, mod) 34#define request_module(mod...) __request_module(true, mod)
35#define request_module_nowait(mod...) __request_module(false, mod) 35#define request_module_nowait(mod...) __request_module(false, mod)
36#define try_then_request_module(x, mod...) \ 36#define try_then_request_module(x, mod...) \
37 ((x) ?: (__request_module(false, mod), (x))) 37 ((x) ?: (__request_module(true, mod), (x)))
38#else 38#else
39static inline int request_module(const char *name, ...) { return -ENOSYS; } 39static inline int request_module(const char *name, ...) { return -ENOSYS; }
40static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; } 40static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; }
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 2ec6cc14a114..bcd9c07848be 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -94,12 +94,16 @@ struct kprobe {
94 /* Called after addr is executed, unless... */ 94 /* Called after addr is executed, unless... */
95 kprobe_post_handler_t post_handler; 95 kprobe_post_handler_t post_handler;
96 96
97 /* ... called if executing addr causes a fault (eg. page fault). 97 /*
98 * Return 1 if it handled fault, otherwise kernel will see it. */ 98 * ... called if executing addr causes a fault (eg. page fault).
99 * Return 1 if it handled fault, otherwise kernel will see it.
100 */
99 kprobe_fault_handler_t fault_handler; 101 kprobe_fault_handler_t fault_handler;
100 102
101 /* ... called if breakpoint trap occurs in probe handler. 103 /*
102 * Return 1 if it handled break, otherwise kernel will see it. */ 104 * ... called if breakpoint trap occurs in probe handler.
105 * Return 1 if it handled break, otherwise kernel will see it.
106 */
103 kprobe_break_handler_t break_handler; 107 kprobe_break_handler_t break_handler;
104 108
105 /* Saved opcode (which has been replaced with breakpoint) */ 109 /* Saved opcode (which has been replaced with breakpoint) */
@@ -108,18 +112,28 @@ struct kprobe {
108 /* copy of the original instruction */ 112 /* copy of the original instruction */
109 struct arch_specific_insn ainsn; 113 struct arch_specific_insn ainsn;
110 114
111 /* Indicates various status flags. Protected by kprobe_mutex. */ 115 /*
116 * Indicates various status flags.
117 * Protected by kprobe_mutex after this kprobe is registered.
118 */
112 u32 flags; 119 u32 flags;
113}; 120};
114 121
115/* Kprobe status flags */ 122/* Kprobe status flags */
116#define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */ 123#define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */
124#define KPROBE_FLAG_DISABLED 2 /* probe is temporarily disabled */
117 125
126/* Has this kprobe gone ? */
118static inline int kprobe_gone(struct kprobe *p) 127static inline int kprobe_gone(struct kprobe *p)
119{ 128{
120 return p->flags & KPROBE_FLAG_GONE; 129 return p->flags & KPROBE_FLAG_GONE;
121} 130}
122 131
132/* Is this kprobe disabled ? */
133static inline int kprobe_disabled(struct kprobe *p)
134{
135 return p->flags & (KPROBE_FLAG_DISABLED | KPROBE_FLAG_GONE);
136}
123/* 137/*
124 * Special probe type that uses setjmp-longjmp type tricks to resume 138 * Special probe type that uses setjmp-longjmp type tricks to resume
125 * execution at a specified entry with a matching prototype corresponding 139 * execution at a specified entry with a matching prototype corresponding
@@ -279,6 +293,9 @@ void unregister_kretprobes(struct kretprobe **rps, int num);
279void kprobe_flush_task(struct task_struct *tk); 293void kprobe_flush_task(struct task_struct *tk);
280void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); 294void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
281 295
296int disable_kprobe(struct kprobe *kp);
297int enable_kprobe(struct kprobe *kp);
298
282#else /* !CONFIG_KPROBES: */ 299#else /* !CONFIG_KPROBES: */
283 300
284static inline int kprobes_built_in(void) 301static inline int kprobes_built_in(void)
@@ -345,5 +362,30 @@ static inline void unregister_kretprobes(struct kretprobe **rps, int num)
345static inline void kprobe_flush_task(struct task_struct *tk) 362static inline void kprobe_flush_task(struct task_struct *tk)
346{ 363{
347} 364}
365static inline int disable_kprobe(struct kprobe *kp)
366{
367 return -ENOSYS;
368}
369static inline int enable_kprobe(struct kprobe *kp)
370{
371 return -ENOSYS;
372}
348#endif /* CONFIG_KPROBES */ 373#endif /* CONFIG_KPROBES */
374static inline int disable_kretprobe(struct kretprobe *rp)
375{
376 return disable_kprobe(&rp->kp);
377}
378static inline int enable_kretprobe(struct kretprobe *rp)
379{
380 return enable_kprobe(&rp->kp);
381}
382static inline int disable_jprobe(struct jprobe *jp)
383{
384 return disable_kprobe(&jp->kp);
385}
386static inline int enable_jprobe(struct jprobe *jp)
387{
388 return enable_kprobe(&jp->kp);
389}
390
349#endif /* _LINUX_KPROBES_H */ 391#endif /* _LINUX_KPROBES_H */
diff --git a/include/linux/leds-bd2802.h b/include/linux/leds-bd2802.h
new file mode 100644
index 000000000000..42f854a1a199
--- /dev/null
+++ b/include/linux/leds-bd2802.h
@@ -0,0 +1,26 @@
1/*
2 * leds-bd2802.h - RGB LED Driver
3 *
4 * Copyright (C) 2009 Samsung Electronics
5 * Kim Kyuwon <q1.kim@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Datasheet: http://www.rohm.com/products/databook/driver/pdf/bd2802gu-e.pdf
12 *
13 */
14#ifndef _LEDS_BD2802_H_
15#define _LEDS_BD2802_H_
16
17struct bd2802_led_platform_data{
18 int reset_gpio;
19 u8 rgb_time;
20};
21
22#define RGB_TIME(slopedown, slopeup, waveform) \
23 ((slopedown) << 6 | (slopeup) << 4 | (waveform))
24
25#endif /* _LEDS_BD2802_H_ */
26
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 24489da701e3..376fe07732ea 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -30,6 +30,7 @@ enum led_brightness {
30struct led_classdev { 30struct led_classdev {
31 const char *name; 31 const char *name;
32 int brightness; 32 int brightness;
33 int max_brightness;
33 int flags; 34 int flags;
34 35
35 /* Lower 16 bits reflect status */ 36 /* Lower 16 bits reflect status */
@@ -140,7 +141,8 @@ struct gpio_led {
140 const char *name; 141 const char *name;
141 const char *default_trigger; 142 const char *default_trigger;
142 unsigned gpio; 143 unsigned gpio;
143 u8 active_low; 144 u8 active_low : 1;
145 u8 retain_state_suspended : 1;
144}; 146};
145 147
146struct gpio_led_platform_data { 148struct gpio_led_platform_data {
diff --git a/include/linux/leds_pwm.h b/include/linux/leds_pwm.h
new file mode 100644
index 000000000000..33a071167489
--- /dev/null
+++ b/include/linux/leds_pwm.h
@@ -0,0 +1,21 @@
1/*
2 * PWM LED driver data - see drivers/leds/leds-pwm.c
3 */
4#ifndef __LINUX_LEDS_PWM_H
5#define __LINUX_LEDS_PWM_H
6
7struct led_pwm {
8 const char *name;
9 const char *default_trigger;
10 unsigned pwm_id;
11 u8 active_low;
12 unsigned max_brightness;
13 unsigned pwm_period_ns;
14};
15
16struct led_pwm_platform_data {
17 int num_leds;
18 struct led_pwm *leds;
19};
20
21#endif
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h
index 7dc5b6cb44cd..d39ed1cc5fbf 100644
--- a/include/linux/lockd/xdr.h
+++ b/include/linux/lockd/xdr.h
@@ -25,13 +25,13 @@ struct svc_rqst;
25#define NLM_MAXCOOKIELEN 32 25#define NLM_MAXCOOKIELEN 32
26#define NLM_MAXSTRLEN 1024 26#define NLM_MAXSTRLEN 1024
27 27
28#define nlm_granted __constant_htonl(NLM_LCK_GRANTED) 28#define nlm_granted cpu_to_be32(NLM_LCK_GRANTED)
29#define nlm_lck_denied __constant_htonl(NLM_LCK_DENIED) 29#define nlm_lck_denied cpu_to_be32(NLM_LCK_DENIED)
30#define nlm_lck_denied_nolocks __constant_htonl(NLM_LCK_DENIED_NOLOCKS) 30#define nlm_lck_denied_nolocks cpu_to_be32(NLM_LCK_DENIED_NOLOCKS)
31#define nlm_lck_blocked __constant_htonl(NLM_LCK_BLOCKED) 31#define nlm_lck_blocked cpu_to_be32(NLM_LCK_BLOCKED)
32#define nlm_lck_denied_grace_period __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD) 32#define nlm_lck_denied_grace_period cpu_to_be32(NLM_LCK_DENIED_GRACE_PERIOD)
33 33
34#define nlm_drop_reply __constant_htonl(30000) 34#define nlm_drop_reply cpu_to_be32(30000)
35 35
36/* Lock info passed via NLM */ 36/* Lock info passed via NLM */
37struct nlm_lock { 37struct nlm_lock {
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h
index 12bfe09de2b1..7353821341ed 100644
--- a/include/linux/lockd/xdr4.h
+++ b/include/linux/lockd/xdr4.h
@@ -15,11 +15,11 @@
15#include <linux/lockd/xdr.h> 15#include <linux/lockd/xdr.h>
16 16
17/* error codes new to NLMv4 */ 17/* error codes new to NLMv4 */
18#define nlm4_deadlock __constant_htonl(NLM_DEADLCK) 18#define nlm4_deadlock cpu_to_be32(NLM_DEADLCK)
19#define nlm4_rofs __constant_htonl(NLM_ROFS) 19#define nlm4_rofs cpu_to_be32(NLM_ROFS)
20#define nlm4_stale_fh __constant_htonl(NLM_STALE_FH) 20#define nlm4_stale_fh cpu_to_be32(NLM_STALE_FH)
21#define nlm4_fbig __constant_htonl(NLM_FBIG) 21#define nlm4_fbig cpu_to_be32(NLM_FBIG)
22#define nlm4_failed __constant_htonl(NLM_FAILED) 22#define nlm4_failed cpu_to_be32(NLM_FAILED)
23 23
24 24
25 25
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index 4455b212d75a..c8f51c3c0a72 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -29,6 +29,8 @@ struct pcf50633_platform_data {
29 char **batteries; 29 char **batteries;
30 int num_batteries; 30 int num_batteries;
31 31
32 int charging_restart_interval;
33
32 /* Callbacks */ 34 /* Callbacks */
33 void (*probe_done)(struct pcf50633 *); 35 void (*probe_done)(struct pcf50633 *);
34 void (*mbc_event_callback)(struct pcf50633 *, int); 36 void (*mbc_event_callback)(struct pcf50633 *, int);
diff --git a/include/linux/mfd/pcf50633/mbc.h b/include/linux/mfd/pcf50633/mbc.h
index 6e17619b773a..4119579acf2c 100644
--- a/include/linux/mfd/pcf50633/mbc.h
+++ b/include/linux/mfd/pcf50633/mbc.h
@@ -128,7 +128,6 @@ enum pcf50633_reg_mbcs3 {
128int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma); 128int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma);
129 129
130int pcf50633_mbc_get_status(struct pcf50633 *); 130int pcf50633_mbc_get_status(struct pcf50633 *);
131void pcf50633_mbc_set_status(struct pcf50633 *, int what, int status);
132 131
133#endif 132#endif
134 133
diff --git a/include/linux/mg_disk.h b/include/linux/mg_disk.h
new file mode 100644
index 000000000000..1f76b1ebf627
--- /dev/null
+++ b/include/linux/mg_disk.h
@@ -0,0 +1,206 @@
1/*
2 * include/linux/mg_disk.c
3 *
4 * Support for the mGine m[g]flash IO mode.
5 * Based on legacy hd.c
6 *
7 * (c) 2008 mGine Co.,LTD
8 * (c) 2008 unsik Kim <donari75@gmail.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef __MG_DISK_H__
16#define __MG_DISK_H__
17
18#include <linux/blkdev.h>
19#include <linux/ata.h>
20
21/* name for block device */
22#define MG_DISK_NAME "mgd"
23/* name for platform device */
24#define MG_DEV_NAME "mg_disk"
25
26#define MG_DISK_MAJ 0
27#define MG_DISK_MAX_PART 16
28#define MG_SECTOR_SIZE 512
29#define MG_MAX_SECTS 256
30
31/* Register offsets */
32#define MG_BUFF_OFFSET 0x8000
33#define MG_STORAGE_BUFFER_SIZE 0x200
34#define MG_REG_OFFSET 0xC000
35#define MG_REG_FEATURE (MG_REG_OFFSET + 2) /* write case */
36#define MG_REG_ERROR (MG_REG_OFFSET + 2) /* read case */
37#define MG_REG_SECT_CNT (MG_REG_OFFSET + 4)
38#define MG_REG_SECT_NUM (MG_REG_OFFSET + 6)
39#define MG_REG_CYL_LOW (MG_REG_OFFSET + 8)
40#define MG_REG_CYL_HIGH (MG_REG_OFFSET + 0xA)
41#define MG_REG_DRV_HEAD (MG_REG_OFFSET + 0xC)
42#define MG_REG_COMMAND (MG_REG_OFFSET + 0xE) /* write case */
43#define MG_REG_STATUS (MG_REG_OFFSET + 0xE) /* read case */
44#define MG_REG_DRV_CTRL (MG_REG_OFFSET + 0x10)
45#define MG_REG_BURST_CTRL (MG_REG_OFFSET + 0x12)
46
47/* "Drive Select/Head Register" bit values */
48#define MG_REG_HEAD_MUST_BE_ON 0xA0 /* These 2 bits are always on */
49#define MG_REG_HEAD_DRIVE_MASTER (0x00 | MG_REG_HEAD_MUST_BE_ON)
50#define MG_REG_HEAD_DRIVE_SLAVE (0x10 | MG_REG_HEAD_MUST_BE_ON)
51#define MG_REG_HEAD_LBA_MODE (0x40 | MG_REG_HEAD_MUST_BE_ON)
52
53
54/* "Device Control Register" bit values */
55#define MG_REG_CTRL_INTR_ENABLE 0x0
56#define MG_REG_CTRL_INTR_DISABLE (0x1<<1)
57#define MG_REG_CTRL_RESET (0x1<<2)
58#define MG_REG_CTRL_INTR_POLA_ACTIVE_HIGH 0x0
59#define MG_REG_CTRL_INTR_POLA_ACTIVE_LOW (0x1<<4)
60#define MG_REG_CTRL_DPD_POLA_ACTIVE_LOW 0x0
61#define MG_REG_CTRL_DPD_POLA_ACTIVE_HIGH (0x1<<5)
62#define MG_REG_CTRL_DPD_DISABLE 0x0
63#define MG_REG_CTRL_DPD_ENABLE (0x1<<6)
64
65/* Status register bit */
66/* error bit in status register */
67#define MG_REG_STATUS_BIT_ERROR 0x01
68/* corrected error in status register */
69#define MG_REG_STATUS_BIT_CORRECTED_ERROR 0x04
70/* data request bit in status register */
71#define MG_REG_STATUS_BIT_DATA_REQ 0x08
72/* DSC - Drive Seek Complete */
73#define MG_REG_STATUS_BIT_SEEK_DONE 0x10
74/* DWF - Drive Write Fault */
75#define MG_REG_STATUS_BIT_WRITE_FAULT 0x20
76#define MG_REG_STATUS_BIT_READY 0x40
77#define MG_REG_STATUS_BIT_BUSY 0x80
78
79/* handy status */
80#define MG_STAT_READY (MG_REG_STATUS_BIT_READY | MG_REG_STATUS_BIT_SEEK_DONE)
81#define MG_READY_OK(s) (((s) & (MG_STAT_READY | \
82 (MG_REG_STATUS_BIT_BUSY | \
83 MG_REG_STATUS_BIT_WRITE_FAULT | \
84 MG_REG_STATUS_BIT_ERROR))) == MG_STAT_READY)
85
86/* Error register */
87#define MG_REG_ERR_AMNF 0x01
88#define MG_REG_ERR_ABRT 0x04
89#define MG_REG_ERR_IDNF 0x10
90#define MG_REG_ERR_UNC 0x40
91#define MG_REG_ERR_BBK 0x80
92
93/* error code for others */
94#define MG_ERR_NONE 0
95#define MG_ERR_TIMEOUT 0x100
96#define MG_ERR_INIT_STAT 0x101
97#define MG_ERR_TRANSLATION 0x102
98#define MG_ERR_CTRL_RST 0x103
99#define MG_ERR_INV_STAT 0x104
100#define MG_ERR_RSTOUT 0x105
101
102#define MG_MAX_ERRORS 6 /* Max read/write errors */
103
104/* command */
105#define MG_CMD_RD 0x20
106#define MG_CMD_WR 0x30
107#define MG_CMD_SLEEP 0x99
108#define MG_CMD_WAKEUP 0xC3
109#define MG_CMD_ID 0xEC
110#define MG_CMD_WR_CONF 0x3C
111#define MG_CMD_RD_CONF 0x40
112
113/* operation mode */
114#define MG_OP_CASCADE (1 << 0)
115#define MG_OP_CASCADE_SYNC_RD (1 << 1)
116#define MG_OP_CASCADE_SYNC_WR (1 << 2)
117#define MG_OP_INTERLEAVE (1 << 3)
118
119/* synchronous */
120#define MG_BURST_LAT_4 (3 << 4)
121#define MG_BURST_LAT_5 (4 << 4)
122#define MG_BURST_LAT_6 (5 << 4)
123#define MG_BURST_LAT_7 (6 << 4)
124#define MG_BURST_LAT_8 (7 << 4)
125#define MG_BURST_LEN_4 (1 << 1)
126#define MG_BURST_LEN_8 (2 << 1)
127#define MG_BURST_LEN_16 (3 << 1)
128#define MG_BURST_LEN_32 (4 << 1)
129#define MG_BURST_LEN_CONT (0 << 1)
130
131/* timeout value (unit: ms) */
132#define MG_TMAX_CONF_TO_CMD 1
133#define MG_TMAX_WAIT_RD_DRQ 10
134#define MG_TMAX_WAIT_WR_DRQ 500
135#define MG_TMAX_RST_TO_BUSY 10
136#define MG_TMAX_HDRST_TO_RDY 500
137#define MG_TMAX_SWRST_TO_RDY 500
138#define MG_TMAX_RSTOUT 3000
139
140/* device attribution */
141/* use mflash as boot device */
142#define MG_BOOT_DEV (1 << 0)
143/* use mflash as storage device */
144#define MG_STORAGE_DEV (1 << 1)
145/* same as MG_STORAGE_DEV, but bootloader already done reset sequence */
146#define MG_STORAGE_DEV_SKIP_RST (1 << 2)
147
148#define MG_DEV_MASK (MG_BOOT_DEV | MG_STORAGE_DEV | MG_STORAGE_DEV_SKIP_RST)
149
150/* names of GPIO resource */
151#define MG_RST_PIN "mg_rst"
152/* except MG_BOOT_DEV, reset-out pin should be assigned */
153#define MG_RSTOUT_PIN "mg_rstout"
154
155/* private driver data */
156struct mg_drv_data {
157 /* disk resource */
158 u32 use_polling;
159
160 /* device attribution */
161 u32 dev_attr;
162
163 /* internally used */
164 struct mg_host *host;
165};
166
167/* main structure for mflash driver */
168struct mg_host {
169 struct device *dev;
170
171 struct request_queue *breq;
172 spinlock_t lock;
173 struct gendisk *gd;
174
175 struct timer_list timer;
176 void (*mg_do_intr) (struct mg_host *);
177
178 u16 id[ATA_ID_WORDS];
179
180 u16 cyls;
181 u16 heads;
182 u16 sectors;
183 u32 n_sectors;
184 u32 nres_sectors;
185
186 void __iomem *dev_base;
187 unsigned int irq;
188 unsigned int rst;
189 unsigned int rstout;
190
191 u32 major;
192 u32 error;
193};
194
195/*
196 * Debugging macro and defines
197 */
198#undef DO_MG_DEBUG
199#ifdef DO_MG_DEBUG
200# define MG_DBG(fmt, args...) \
201 printk(KERN_DEBUG "%s:%d "fmt, __func__, __LINE__, ##args)
202#else /* CONFIG_MG_DEBUG */
203# define MG_DBG(fmt, args...) do { } while (0)
204#endif /* CONFIG_MG_DEBUG */
205
206#endif
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 3aa5d77c2cdb..5675b63a0631 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -11,6 +11,7 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <linux/notifier.h> 13#include <linux/notifier.h>
14#include <linux/device.h>
14 15
15#include <linux/mtd/compatmac.h> 16#include <linux/mtd/compatmac.h>
16#include <mtd/mtd-abi.h> 17#include <mtd/mtd-abi.h>
@@ -162,6 +163,20 @@ struct mtd_info {
162 /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ 163 /* We probably shouldn't allow XIP if the unpoint isn't a NULL */
163 void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len); 164 void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len);
164 165
166 /* Allow NOMMU mmap() to directly map the device (if not NULL)
167 * - return the address to which the offset maps
168 * - return -ENOSYS to indicate refusal to do the mapping
169 */
170 unsigned long (*get_unmapped_area) (struct mtd_info *mtd,
171 unsigned long len,
172 unsigned long offset,
173 unsigned long flags);
174
175 /* Backing device capabilities for this device
176 * - provides mmap capabilities
177 */
178 struct backing_dev_info *backing_dev_info;
179
165 180
166 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 181 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
167 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); 182 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
@@ -223,6 +238,7 @@ struct mtd_info {
223 void *priv; 238 void *priv;
224 239
225 struct module *owner; 240 struct module *owner;
241 struct device dev;
226 int usecount; 242 int usecount;
227 243
228 /* If the driver is something smart, like UBI, it may need to maintain 244 /* If the driver is something smart, like UBI, it may need to maintain
@@ -233,6 +249,11 @@ struct mtd_info {
233 void (*put_device) (struct mtd_info *mtd); 249 void (*put_device) (struct mtd_info *mtd);
234}; 250};
235 251
252static inline struct mtd_info *dev_to_mtd(struct device *dev)
253{
254 return dev ? container_of(dev, struct mtd_info, dev) : NULL;
255}
256
236static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) 257static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd)
237{ 258{
238 if (mtd->erasesize_shift) 259 if (mtd->erasesize_shift)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index db5b63da2a7e..7efb9be34662 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -43,8 +43,8 @@ extern void nand_wait_ready(struct mtd_info *mtd);
43 * is supported now. If you add a chip with bigger oobsize/page 43 * is supported now. If you add a chip with bigger oobsize/page
44 * adjust this accordingly. 44 * adjust this accordingly.
45 */ 45 */
46#define NAND_MAX_OOBSIZE 64 46#define NAND_MAX_OOBSIZE 128
47#define NAND_MAX_PAGESIZE 2048 47#define NAND_MAX_PAGESIZE 4096
48 48
49/* 49/*
50 * Constants for hardware specific CLE/ALE/NCE function 50 * Constants for hardware specific CLE/ALE/NCE function
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index a45dd831b3f8..7535a74083b9 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -76,4 +76,16 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
76 struct device_node *node, 76 struct device_node *node,
77 struct mtd_partition **pparts); 77 struct mtd_partition **pparts);
78 78
79#ifdef CONFIG_MTD_PARTITIONS
80static inline int mtd_has_partitions(void) { return 1; }
81#else
82static inline int mtd_has_partitions(void) { return 0; }
83#endif
84
85#ifdef CONFIG_MTD_CMDLINE_PARTS
86static inline int mtd_has_cmdlinepart(void) { return 1; }
87#else
88static inline int mtd_has_cmdlinepart(void) { return 0; }
89#endif
90
79#endif 91#endif
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index 54af92c1c70b..214d499718f7 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -109,7 +109,6 @@
109 NFSERR_FILE_OPEN = 10046, /* v4 */ 109 NFSERR_FILE_OPEN = 10046, /* v4 */
110 NFSERR_ADMIN_REVOKED = 10047, /* v4 */ 110 NFSERR_ADMIN_REVOKED = 10047, /* v4 */
111 NFSERR_CB_PATH_DOWN = 10048, /* v4 */ 111 NFSERR_CB_PATH_DOWN = 10048, /* v4 */
112 NFSERR_REPLAY_ME = 10049 /* v4 */
113}; 112};
114 113
115/* NFSv2 file types - beware, these are not the same in NFSv3 */ 114/* NFSv2 file types - beware, these are not the same in NFSv3 */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index b912311a56b1..e3f0cbcbd0db 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -21,6 +21,7 @@
21#define NFS4_FHSIZE 128 21#define NFS4_FHSIZE 128
22#define NFS4_MAXPATHLEN PATH_MAX 22#define NFS4_MAXPATHLEN PATH_MAX
23#define NFS4_MAXNAMLEN NAME_MAX 23#define NFS4_MAXNAMLEN NAME_MAX
24#define NFS4_MAX_SESSIONID_LEN 16
24 25
25#define NFS4_ACCESS_READ 0x0001 26#define NFS4_ACCESS_READ 0x0001
26#define NFS4_ACCESS_LOOKUP 0x0002 27#define NFS4_ACCESS_LOOKUP 0x0002
@@ -38,6 +39,7 @@
38#define NFS4_OPEN_RESULT_CONFIRM 0x0002 39#define NFS4_OPEN_RESULT_CONFIRM 0x0002
39#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004 40#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
40 41
42#define NFS4_SHARE_ACCESS_MASK 0x000F
41#define NFS4_SHARE_ACCESS_READ 0x0001 43#define NFS4_SHARE_ACCESS_READ 0x0001
42#define NFS4_SHARE_ACCESS_WRITE 0x0002 44#define NFS4_SHARE_ACCESS_WRITE 0x0002
43#define NFS4_SHARE_ACCESS_BOTH 0x0003 45#define NFS4_SHARE_ACCESS_BOTH 0x0003
@@ -45,6 +47,19 @@
45#define NFS4_SHARE_DENY_WRITE 0x0002 47#define NFS4_SHARE_DENY_WRITE 0x0002
46#define NFS4_SHARE_DENY_BOTH 0x0003 48#define NFS4_SHARE_DENY_BOTH 0x0003
47 49
50/* nfs41 */
51#define NFS4_SHARE_WANT_MASK 0xFF00
52#define NFS4_SHARE_WANT_NO_PREFERENCE 0x0000
53#define NFS4_SHARE_WANT_READ_DELEG 0x0100
54#define NFS4_SHARE_WANT_WRITE_DELEG 0x0200
55#define NFS4_SHARE_WANT_ANY_DELEG 0x0300
56#define NFS4_SHARE_WANT_NO_DELEG 0x0400
57#define NFS4_SHARE_WANT_CANCEL 0x0500
58
59#define NFS4_SHARE_WHEN_MASK 0xF0000
60#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
61#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000
62
48#define NFS4_SET_TO_SERVER_TIME 0 63#define NFS4_SET_TO_SERVER_TIME 0
49#define NFS4_SET_TO_CLIENT_TIME 1 64#define NFS4_SET_TO_CLIENT_TIME 1
50 65
@@ -88,6 +103,31 @@
88#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0 103#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0
89#define NFS4_ACE_MASK_ALL 0x001F01FF 104#define NFS4_ACE_MASK_ALL 0x001F01FF
90 105
106#define EXCHGID4_FLAG_SUPP_MOVED_REFER 0x00000001
107#define EXCHGID4_FLAG_SUPP_MOVED_MIGR 0x00000002
108#define EXCHGID4_FLAG_USE_NON_PNFS 0x00010000
109#define EXCHGID4_FLAG_USE_PNFS_MDS 0x00020000
110#define EXCHGID4_FLAG_USE_PNFS_DS 0x00040000
111#define EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000
112#define EXCHGID4_FLAG_CONFIRMED_R 0x80000000
113/*
114 * Since the validity of these bits depends on whether
115 * they're set in the argument or response, have separate
116 * invalid flag masks for arg (_A) and resp (_R).
117 */
118#define EXCHGID4_FLAG_MASK_A 0x40070003
119#define EXCHGID4_FLAG_MASK_R 0x80070003
120
121#define SEQ4_STATUS_CB_PATH_DOWN 0x00000001
122#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002
123#define SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED 0x00000004
124#define SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED 0x00000008
125#define SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 0x00000010
126#define SEQ4_STATUS_ADMIN_STATE_REVOKED 0x00000020
127#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040
128#define SEQ4_STATUS_LEASE_MOVED 0x00000080
129#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100
130
91#define NFS4_MAX_UINT64 (~(u64)0) 131#define NFS4_MAX_UINT64 (~(u64)0)
92 132
93enum nfs4_acl_whotype { 133enum nfs4_acl_whotype {
@@ -154,6 +194,28 @@ enum nfs_opnum4 {
154 OP_VERIFY = 37, 194 OP_VERIFY = 37,
155 OP_WRITE = 38, 195 OP_WRITE = 38,
156 OP_RELEASE_LOCKOWNER = 39, 196 OP_RELEASE_LOCKOWNER = 39,
197
198 /* nfs41 */
199 OP_BACKCHANNEL_CTL = 40,
200 OP_BIND_CONN_TO_SESSION = 41,
201 OP_EXCHANGE_ID = 42,
202 OP_CREATE_SESSION = 43,
203 OP_DESTROY_SESSION = 44,
204 OP_FREE_STATEID = 45,
205 OP_GET_DIR_DELEGATION = 46,
206 OP_GETDEVICEINFO = 47,
207 OP_GETDEVICELIST = 48,
208 OP_LAYOUTCOMMIT = 49,
209 OP_LAYOUTGET = 50,
210 OP_LAYOUTRETURN = 51,
211 OP_SECINFO_NO_NAME = 52,
212 OP_SEQUENCE = 53,
213 OP_SET_SSV = 54,
214 OP_TEST_STATEID = 55,
215 OP_WANT_DELEGATION = 56,
216 OP_DESTROY_CLIENTID = 57,
217 OP_RECLAIM_COMPLETE = 58,
218
157 OP_ILLEGAL = 10044, 219 OP_ILLEGAL = 10044,
158}; 220};
159 221
@@ -230,7 +292,48 @@ enum nfsstat4 {
230 NFS4ERR_DEADLOCK = 10045, 292 NFS4ERR_DEADLOCK = 10045,
231 NFS4ERR_FILE_OPEN = 10046, 293 NFS4ERR_FILE_OPEN = 10046,
232 NFS4ERR_ADMIN_REVOKED = 10047, 294 NFS4ERR_ADMIN_REVOKED = 10047,
233 NFS4ERR_CB_PATH_DOWN = 10048 295 NFS4ERR_CB_PATH_DOWN = 10048,
296
297 /* nfs41 */
298 NFS4ERR_BADIOMODE = 10049,
299 NFS4ERR_BADLAYOUT = 10050,
300 NFS4ERR_BAD_SESSION_DIGEST = 10051,
301 NFS4ERR_BADSESSION = 10052,
302 NFS4ERR_BADSLOT = 10053,
303 NFS4ERR_COMPLETE_ALREADY = 10054,
304 NFS4ERR_CONN_NOT_BOUND_TO_SESSION = 10055,
305 NFS4ERR_DELEG_ALREADY_WANTED = 10056,
306 NFS4ERR_BACK_CHAN_BUSY = 10057, /* backchan reqs outstanding */
307 NFS4ERR_LAYOUTTRYLATER = 10058,
308 NFS4ERR_LAYOUTUNAVAILABLE = 10059,
309 NFS4ERR_NOMATCHING_LAYOUT = 10060,
310 NFS4ERR_RECALLCONFLICT = 10061,
311 NFS4ERR_UNKNOWN_LAYOUTTYPE = 10062,
312 NFS4ERR_SEQ_MISORDERED = 10063, /* unexpected seq.id in req */
313 NFS4ERR_SEQUENCE_POS = 10064, /* [CB_]SEQ. op not 1st op */
314 NFS4ERR_REQ_TOO_BIG = 10065, /* request too big */
315 NFS4ERR_REP_TOO_BIG = 10066, /* reply too big */
316 NFS4ERR_REP_TOO_BIG_TO_CACHE = 10067, /* rep. not all cached */
317 NFS4ERR_RETRY_UNCACHED_REP = 10068, /* retry & rep. uncached */
318 NFS4ERR_UNSAFE_COMPOUND = 10069, /* retry/recovery too hard */
319 NFS4ERR_TOO_MANY_OPS = 10070, /* too many ops in [CB_]COMP */
320 NFS4ERR_OP_NOT_IN_SESSION = 10071, /* op needs [CB_]SEQ. op */
321 NFS4ERR_HASH_ALG_UNSUPP = 10072, /* hash alg. not supp. */
322 /* Error 10073 is unused. */
323 NFS4ERR_CLIENTID_BUSY = 10074, /* clientid has state */
324 NFS4ERR_PNFS_IO_HOLE = 10075, /* IO to _SPARSE file hole */
325 NFS4ERR_SEQ_FALSE_RETRY = 10076, /* retry not origional */
326 NFS4ERR_BAD_HIGH_SLOT = 10077, /* sequence arg bad */
327 NFS4ERR_DEADSESSION = 10078, /* persistent session dead */
328 NFS4ERR_ENCR_ALG_UNSUPP = 10079, /* SSV alg mismatch */
329 NFS4ERR_PNFS_NO_LAYOUT = 10080, /* direct I/O with no layout */
330 NFS4ERR_NOT_ONLY_OP = 10081, /* bad compound */
331 NFS4ERR_WRONG_CRED = 10082, /* permissions:state change */
332 NFS4ERR_WRONG_TYPE = 10083, /* current operation mismatch */
333 NFS4ERR_DIRDELEG_UNAVAIL = 10084, /* no directory delegation */
334 NFS4ERR_REJECT_DELEG = 10085, /* on callback */
335 NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */
336 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */
234}; 337};
235 338
236/* 339/*
@@ -265,7 +368,13 @@ enum opentype4 {
265enum createmode4 { 368enum createmode4 {
266 NFS4_CREATE_UNCHECKED = 0, 369 NFS4_CREATE_UNCHECKED = 0,
267 NFS4_CREATE_GUARDED = 1, 370 NFS4_CREATE_GUARDED = 1,
268 NFS4_CREATE_EXCLUSIVE = 2 371 NFS4_CREATE_EXCLUSIVE = 2,
372 /*
373 * New to NFSv4.1. If session is persistent,
374 * GUARDED4 MUST be used. Otherwise, use
375 * EXCLUSIVE4_1 instead of EXCLUSIVE4.
376 */
377 NFS4_CREATE_EXCLUSIVE4_1 = 3
269}; 378};
270 379
271enum limit_by4 { 380enum limit_by4 {
@@ -301,6 +410,8 @@ enum lock_type4 {
301#define FATTR4_WORD0_UNIQUE_HANDLES (1UL << 9) 410#define FATTR4_WORD0_UNIQUE_HANDLES (1UL << 9)
302#define FATTR4_WORD0_LEASE_TIME (1UL << 10) 411#define FATTR4_WORD0_LEASE_TIME (1UL << 10)
303#define FATTR4_WORD0_RDATTR_ERROR (1UL << 11) 412#define FATTR4_WORD0_RDATTR_ERROR (1UL << 11)
413/* Mandatory in NFSv4.1 */
414#define FATTR4_WORD2_SUPPATTR_EXCLCREAT (1UL << 11)
304 415
305/* Recommended Attributes */ 416/* Recommended Attributes */
306#define FATTR4_WORD0_ACL (1UL << 12) 417#define FATTR4_WORD0_ACL (1UL << 12)
@@ -391,6 +502,29 @@ enum {
391 NFSPROC4_CLNT_GETACL, 502 NFSPROC4_CLNT_GETACL,
392 NFSPROC4_CLNT_SETACL, 503 NFSPROC4_CLNT_SETACL,
393 NFSPROC4_CLNT_FS_LOCATIONS, 504 NFSPROC4_CLNT_FS_LOCATIONS,
505
506 /* nfs41 */
507 NFSPROC4_CLNT_EXCHANGE_ID,
508 NFSPROC4_CLNT_CREATE_SESSION,
509 NFSPROC4_CLNT_DESTROY_SESSION,
510 NFSPROC4_CLNT_SEQUENCE,
511 NFSPROC4_CLNT_GET_LEASE_TIME,
512};
513
514/* nfs41 types */
515struct nfs4_sessionid {
516 unsigned char data[NFS4_MAX_SESSIONID_LEN];
517};
518
519/* Create Session Flags */
520#define SESSION4_PERSIST 0x001
521#define SESSION4_BACK_CHAN 0x002
522#define SESSION4_RDMA 0x004
523
524enum state_protect_how4 {
525 SP4_NONE = 0,
526 SP4_MACH_CRED = 1,
527 SP4_SSV = 2
394}; 528};
395 529
396#endif 530#endif
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index 04b355c801d8..5bccaab81056 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -76,4 +76,12 @@ void nfsd_reply_cache_shutdown(void);
76int nfsd_cache_lookup(struct svc_rqst *, int); 76int nfsd_cache_lookup(struct svc_rqst *, int);
77void nfsd_cache_update(struct svc_rqst *, int, __be32 *); 77void nfsd_cache_update(struct svc_rqst *, int, __be32 *);
78 78
79#ifdef CONFIG_NFSD_V4
80void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp);
81#else /* CONFIG_NFSD_V4 */
82static inline void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp)
83{
84}
85#endif /* CONFIG_NFSD_V4 */
86
79#endif /* NFSCACHE_H */ 87#endif /* NFSCACHE_H */
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index e19f45991b2e..2b49d676d0c9 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -23,7 +23,7 @@
23/* 23/*
24 * nfsd version 24 * nfsd version
25 */ 25 */
26#define NFSD_SUPPORTED_MINOR_VERSION 0 26#define NFSD_SUPPORTED_MINOR_VERSION 1
27 27
28/* 28/*
29 * Flags for nfsd_permission 29 * Flags for nfsd_permission
@@ -53,6 +53,7 @@ typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
53extern struct svc_program nfsd_program; 53extern struct svc_program nfsd_program;
54extern struct svc_version nfsd_version2, nfsd_version3, 54extern struct svc_version nfsd_version2, nfsd_version3,
55 nfsd_version4; 55 nfsd_version4;
56extern u32 nfsd_supported_minorversion;
56extern struct mutex nfsd_mutex; 57extern struct mutex nfsd_mutex;
57extern struct svc_serv *nfsd_serv; 58extern struct svc_serv *nfsd_serv;
58 59
@@ -105,7 +106,7 @@ void nfsd_close(struct file *);
105__be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *, 106__be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
106 loff_t, struct kvec *, int, unsigned long *); 107 loff_t, struct kvec *, int, unsigned long *);
107__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *, 108__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
108 loff_t, struct kvec *,int, unsigned long, int *); 109 loff_t, struct kvec *,int, unsigned long *, int *);
109__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *, 110__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
110 char *, int *); 111 char *, int *);
111__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *, 112__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
@@ -149,6 +150,7 @@ int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *);
149 150
150enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL }; 151enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL };
151int nfsd_vers(int vers, enum vers_op change); 152int nfsd_vers(int vers, enum vers_op change);
153int nfsd_minorversion(u32 minorversion, enum vers_op change);
152void nfsd_reset_versions(void); 154void nfsd_reset_versions(void);
153int nfsd_create_serv(void); 155int nfsd_create_serv(void);
154 156
@@ -186,78 +188,119 @@ void nfsd_lockd_shutdown(void);
186/* 188/*
187 * These macros provide pre-xdr'ed values for faster operation. 189 * These macros provide pre-xdr'ed values for faster operation.
188 */ 190 */
189#define nfs_ok __constant_htonl(NFS_OK) 191#define nfs_ok cpu_to_be32(NFS_OK)
190#define nfserr_perm __constant_htonl(NFSERR_PERM) 192#define nfserr_perm cpu_to_be32(NFSERR_PERM)
191#define nfserr_noent __constant_htonl(NFSERR_NOENT) 193#define nfserr_noent cpu_to_be32(NFSERR_NOENT)
192#define nfserr_io __constant_htonl(NFSERR_IO) 194#define nfserr_io cpu_to_be32(NFSERR_IO)
193#define nfserr_nxio __constant_htonl(NFSERR_NXIO) 195#define nfserr_nxio cpu_to_be32(NFSERR_NXIO)
194#define nfserr_eagain __constant_htonl(NFSERR_EAGAIN) 196#define nfserr_eagain cpu_to_be32(NFSERR_EAGAIN)
195#define nfserr_acces __constant_htonl(NFSERR_ACCES) 197#define nfserr_acces cpu_to_be32(NFSERR_ACCES)
196#define nfserr_exist __constant_htonl(NFSERR_EXIST) 198#define nfserr_exist cpu_to_be32(NFSERR_EXIST)
197#define nfserr_xdev __constant_htonl(NFSERR_XDEV) 199#define nfserr_xdev cpu_to_be32(NFSERR_XDEV)
198#define nfserr_nodev __constant_htonl(NFSERR_NODEV) 200#define nfserr_nodev cpu_to_be32(NFSERR_NODEV)
199#define nfserr_notdir __constant_htonl(NFSERR_NOTDIR) 201#define nfserr_notdir cpu_to_be32(NFSERR_NOTDIR)
200#define nfserr_isdir __constant_htonl(NFSERR_ISDIR) 202#define nfserr_isdir cpu_to_be32(NFSERR_ISDIR)
201#define nfserr_inval __constant_htonl(NFSERR_INVAL) 203#define nfserr_inval cpu_to_be32(NFSERR_INVAL)
202#define nfserr_fbig __constant_htonl(NFSERR_FBIG) 204#define nfserr_fbig cpu_to_be32(NFSERR_FBIG)
203#define nfserr_nospc __constant_htonl(NFSERR_NOSPC) 205#define nfserr_nospc cpu_to_be32(NFSERR_NOSPC)
204#define nfserr_rofs __constant_htonl(NFSERR_ROFS) 206#define nfserr_rofs cpu_to_be32(NFSERR_ROFS)
205#define nfserr_mlink __constant_htonl(NFSERR_MLINK) 207#define nfserr_mlink cpu_to_be32(NFSERR_MLINK)
206#define nfserr_opnotsupp __constant_htonl(NFSERR_OPNOTSUPP) 208#define nfserr_opnotsupp cpu_to_be32(NFSERR_OPNOTSUPP)
207#define nfserr_nametoolong __constant_htonl(NFSERR_NAMETOOLONG) 209#define nfserr_nametoolong cpu_to_be32(NFSERR_NAMETOOLONG)
208#define nfserr_notempty __constant_htonl(NFSERR_NOTEMPTY) 210#define nfserr_notempty cpu_to_be32(NFSERR_NOTEMPTY)
209#define nfserr_dquot __constant_htonl(NFSERR_DQUOT) 211#define nfserr_dquot cpu_to_be32(NFSERR_DQUOT)
210#define nfserr_stale __constant_htonl(NFSERR_STALE) 212#define nfserr_stale cpu_to_be32(NFSERR_STALE)
211#define nfserr_remote __constant_htonl(NFSERR_REMOTE) 213#define nfserr_remote cpu_to_be32(NFSERR_REMOTE)
212#define nfserr_wflush __constant_htonl(NFSERR_WFLUSH) 214#define nfserr_wflush cpu_to_be32(NFSERR_WFLUSH)
213#define nfserr_badhandle __constant_htonl(NFSERR_BADHANDLE) 215#define nfserr_badhandle cpu_to_be32(NFSERR_BADHANDLE)
214#define nfserr_notsync __constant_htonl(NFSERR_NOT_SYNC) 216#define nfserr_notsync cpu_to_be32(NFSERR_NOT_SYNC)
215#define nfserr_badcookie __constant_htonl(NFSERR_BAD_COOKIE) 217#define nfserr_badcookie cpu_to_be32(NFSERR_BAD_COOKIE)
216#define nfserr_notsupp __constant_htonl(NFSERR_NOTSUPP) 218#define nfserr_notsupp cpu_to_be32(NFSERR_NOTSUPP)
217#define nfserr_toosmall __constant_htonl(NFSERR_TOOSMALL) 219#define nfserr_toosmall cpu_to_be32(NFSERR_TOOSMALL)
218#define nfserr_serverfault __constant_htonl(NFSERR_SERVERFAULT) 220#define nfserr_serverfault cpu_to_be32(NFSERR_SERVERFAULT)
219#define nfserr_badtype __constant_htonl(NFSERR_BADTYPE) 221#define nfserr_badtype cpu_to_be32(NFSERR_BADTYPE)
220#define nfserr_jukebox __constant_htonl(NFSERR_JUKEBOX) 222#define nfserr_jukebox cpu_to_be32(NFSERR_JUKEBOX)
221#define nfserr_denied __constant_htonl(NFSERR_DENIED) 223#define nfserr_denied cpu_to_be32(NFSERR_DENIED)
222#define nfserr_deadlock __constant_htonl(NFSERR_DEADLOCK) 224#define nfserr_deadlock cpu_to_be32(NFSERR_DEADLOCK)
223#define nfserr_expired __constant_htonl(NFSERR_EXPIRED) 225#define nfserr_expired cpu_to_be32(NFSERR_EXPIRED)
224#define nfserr_bad_cookie __constant_htonl(NFSERR_BAD_COOKIE) 226#define nfserr_bad_cookie cpu_to_be32(NFSERR_BAD_COOKIE)
225#define nfserr_same __constant_htonl(NFSERR_SAME) 227#define nfserr_same cpu_to_be32(NFSERR_SAME)
226#define nfserr_clid_inuse __constant_htonl(NFSERR_CLID_INUSE) 228#define nfserr_clid_inuse cpu_to_be32(NFSERR_CLID_INUSE)
227#define nfserr_stale_clientid __constant_htonl(NFSERR_STALE_CLIENTID) 229#define nfserr_stale_clientid cpu_to_be32(NFSERR_STALE_CLIENTID)
228#define nfserr_resource __constant_htonl(NFSERR_RESOURCE) 230#define nfserr_resource cpu_to_be32(NFSERR_RESOURCE)
229#define nfserr_moved __constant_htonl(NFSERR_MOVED) 231#define nfserr_moved cpu_to_be32(NFSERR_MOVED)
230#define nfserr_nofilehandle __constant_htonl(NFSERR_NOFILEHANDLE) 232#define nfserr_nofilehandle cpu_to_be32(NFSERR_NOFILEHANDLE)
231#define nfserr_minor_vers_mismatch __constant_htonl(NFSERR_MINOR_VERS_MISMATCH) 233#define nfserr_minor_vers_mismatch cpu_to_be32(NFSERR_MINOR_VERS_MISMATCH)
232#define nfserr_share_denied __constant_htonl(NFSERR_SHARE_DENIED) 234#define nfserr_share_denied cpu_to_be32(NFSERR_SHARE_DENIED)
233#define nfserr_stale_stateid __constant_htonl(NFSERR_STALE_STATEID) 235#define nfserr_stale_stateid cpu_to_be32(NFSERR_STALE_STATEID)
234#define nfserr_old_stateid __constant_htonl(NFSERR_OLD_STATEID) 236#define nfserr_old_stateid cpu_to_be32(NFSERR_OLD_STATEID)
235#define nfserr_bad_stateid __constant_htonl(NFSERR_BAD_STATEID) 237#define nfserr_bad_stateid cpu_to_be32(NFSERR_BAD_STATEID)
236#define nfserr_bad_seqid __constant_htonl(NFSERR_BAD_SEQID) 238#define nfserr_bad_seqid cpu_to_be32(NFSERR_BAD_SEQID)
237#define nfserr_symlink __constant_htonl(NFSERR_SYMLINK) 239#define nfserr_symlink cpu_to_be32(NFSERR_SYMLINK)
238#define nfserr_not_same __constant_htonl(NFSERR_NOT_SAME) 240#define nfserr_not_same cpu_to_be32(NFSERR_NOT_SAME)
239#define nfserr_restorefh __constant_htonl(NFSERR_RESTOREFH) 241#define nfserr_restorefh cpu_to_be32(NFSERR_RESTOREFH)
240#define nfserr_attrnotsupp __constant_htonl(NFSERR_ATTRNOTSUPP) 242#define nfserr_attrnotsupp cpu_to_be32(NFSERR_ATTRNOTSUPP)
241#define nfserr_bad_xdr __constant_htonl(NFSERR_BAD_XDR) 243#define nfserr_bad_xdr cpu_to_be32(NFSERR_BAD_XDR)
242#define nfserr_openmode __constant_htonl(NFSERR_OPENMODE) 244#define nfserr_openmode cpu_to_be32(NFSERR_OPENMODE)
243#define nfserr_locks_held __constant_htonl(NFSERR_LOCKS_HELD) 245#define nfserr_locks_held cpu_to_be32(NFSERR_LOCKS_HELD)
244#define nfserr_op_illegal __constant_htonl(NFSERR_OP_ILLEGAL) 246#define nfserr_op_illegal cpu_to_be32(NFSERR_OP_ILLEGAL)
245#define nfserr_grace __constant_htonl(NFSERR_GRACE) 247#define nfserr_grace cpu_to_be32(NFSERR_GRACE)
246#define nfserr_no_grace __constant_htonl(NFSERR_NO_GRACE) 248#define nfserr_no_grace cpu_to_be32(NFSERR_NO_GRACE)
247#define nfserr_reclaim_bad __constant_htonl(NFSERR_RECLAIM_BAD) 249#define nfserr_reclaim_bad cpu_to_be32(NFSERR_RECLAIM_BAD)
248#define nfserr_badname __constant_htonl(NFSERR_BADNAME) 250#define nfserr_badname cpu_to_be32(NFSERR_BADNAME)
249#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) 251#define nfserr_cb_path_down cpu_to_be32(NFSERR_CB_PATH_DOWN)
250#define nfserr_locked __constant_htonl(NFSERR_LOCKED) 252#define nfserr_locked cpu_to_be32(NFSERR_LOCKED)
251#define nfserr_wrongsec __constant_htonl(NFSERR_WRONGSEC) 253#define nfserr_wrongsec cpu_to_be32(NFSERR_WRONGSEC)
252#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) 254#define nfserr_badiomode cpu_to_be32(NFS4ERR_BADIOMODE)
255#define nfserr_badlayout cpu_to_be32(NFS4ERR_BADLAYOUT)
256#define nfserr_bad_session_digest cpu_to_be32(NFS4ERR_BAD_SESSION_DIGEST)
257#define nfserr_badsession cpu_to_be32(NFS4ERR_BADSESSION)
258#define nfserr_badslot cpu_to_be32(NFS4ERR_BADSLOT)
259#define nfserr_complete_already cpu_to_be32(NFS4ERR_COMPLETE_ALREADY)
260#define nfserr_conn_not_bound_to_session cpu_to_be32(NFS4ERR_CONN_NOT_BOUND_TO_SESSION)
261#define nfserr_deleg_already_wanted cpu_to_be32(NFS4ERR_DELEG_ALREADY_WANTED)
262#define nfserr_back_chan_busy cpu_to_be32(NFS4ERR_BACK_CHAN_BUSY)
263#define nfserr_layouttrylater cpu_to_be32(NFS4ERR_LAYOUTTRYLATER)
264#define nfserr_layoutunavailable cpu_to_be32(NFS4ERR_LAYOUTUNAVAILABLE)
265#define nfserr_nomatching_layout cpu_to_be32(NFS4ERR_NOMATCHING_LAYOUT)
266#define nfserr_recallconflict cpu_to_be32(NFS4ERR_RECALLCONFLICT)
267#define nfserr_unknown_layouttype cpu_to_be32(NFS4ERR_UNKNOWN_LAYOUTTYPE)
268#define nfserr_seq_misordered cpu_to_be32(NFS4ERR_SEQ_MISORDERED)
269#define nfserr_sequence_pos cpu_to_be32(NFS4ERR_SEQUENCE_POS)
270#define nfserr_req_too_big cpu_to_be32(NFS4ERR_REQ_TOO_BIG)
271#define nfserr_rep_too_big cpu_to_be32(NFS4ERR_REP_TOO_BIG)
272#define nfserr_rep_too_big_to_cache cpu_to_be32(NFS4ERR_REP_TOO_BIG_TO_CACHE)
273#define nfserr_retry_uncached_rep cpu_to_be32(NFS4ERR_RETRY_UNCACHED_REP)
274#define nfserr_unsafe_compound cpu_to_be32(NFS4ERR_UNSAFE_COMPOUND)
275#define nfserr_too_many_ops cpu_to_be32(NFS4ERR_TOO_MANY_OPS)
276#define nfserr_op_not_in_session cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION)
277#define nfserr_hash_alg_unsupp cpu_to_be32(NFS4ERR_HASH_ALG_UNSUPP)
278#define nfserr_clientid_busy cpu_to_be32(NFS4ERR_CLIENTID_BUSY)
279#define nfserr_pnfs_io_hole cpu_to_be32(NFS4ERR_PNFS_IO_HOLE)
280#define nfserr_seq_false_retry cpu_to_be32(NFS4ERR_SEQ_FALSE_RETRY)
281#define nfserr_bad_high_slot cpu_to_be32(NFS4ERR_BAD_HIGH_SLOT)
282#define nfserr_deadsession cpu_to_be32(NFS4ERR_DEADSESSION)
283#define nfserr_encr_alg_unsupp cpu_to_be32(NFS4ERR_ENCR_ALG_UNSUPP)
284#define nfserr_pnfs_no_layout cpu_to_be32(NFS4ERR_PNFS_NO_LAYOUT)
285#define nfserr_not_only_op cpu_to_be32(NFS4ERR_NOT_ONLY_OP)
286#define nfserr_wrong_cred cpu_to_be32(NFS4ERR_WRONG_CRED)
287#define nfserr_wrong_type cpu_to_be32(NFS4ERR_WRONG_TYPE)
288#define nfserr_dirdeleg_unavail cpu_to_be32(NFS4ERR_DIRDELEG_UNAVAIL)
289#define nfserr_reject_deleg cpu_to_be32(NFS4ERR_REJECT_DELEG)
290#define nfserr_returnconflict cpu_to_be32(NFS4ERR_RETURNCONFLICT)
291#define nfserr_deleg_revoked cpu_to_be32(NFS4ERR_DELEG_REVOKED)
253 292
254/* error codes for internal use */ 293/* error codes for internal use */
255/* if a request fails due to kmalloc failure, it gets dropped. 294/* if a request fails due to kmalloc failure, it gets dropped.
256 * Client should resend eventually 295 * Client should resend eventually
257 */ 296 */
258#define nfserr_dropit __constant_htonl(30000) 297#define nfserr_dropit cpu_to_be32(30000)
259/* end-of-file indicator in readdir */ 298/* end-of-file indicator in readdir */
260#define nfserr_eof __constant_htonl(30001) 299#define nfserr_eof cpu_to_be32(30001)
300/* replay detected */
301#define nfserr_replay_me cpu_to_be32(11001)
302/* nfs41 replay detected */
303#define nfserr_replay_cache cpu_to_be32(11002)
261 304
262/* Check for dir entries '.' and '..' */ 305/* Check for dir entries '.' and '..' */
263#define isdotent(n, l) (l < 3 && n[0] == '.' && (l == 1 || n[1] == '.')) 306#define isdotent(n, l) (l < 3 && n[0] == '.' && (l == 1 || n[1] == '.'))
@@ -300,7 +343,7 @@ extern struct timeval nfssvc_boot;
300 * TIME_BACKUP (unlikely to be supported any time soon) 343 * TIME_BACKUP (unlikely to be supported any time soon)
301 * TIME_CREATE (unlikely to be supported any time soon) 344 * TIME_CREATE (unlikely to be supported any time soon)
302 */ 345 */
303#define NFSD_SUPPORTED_ATTRS_WORD0 \ 346#define NFSD4_SUPPORTED_ATTRS_WORD0 \
304(FATTR4_WORD0_SUPPORTED_ATTRS | FATTR4_WORD0_TYPE | FATTR4_WORD0_FH_EXPIRE_TYPE \ 347(FATTR4_WORD0_SUPPORTED_ATTRS | FATTR4_WORD0_TYPE | FATTR4_WORD0_FH_EXPIRE_TYPE \
305 | FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE | FATTR4_WORD0_LINK_SUPPORT \ 348 | FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE | FATTR4_WORD0_LINK_SUPPORT \
306 | FATTR4_WORD0_SYMLINK_SUPPORT | FATTR4_WORD0_NAMED_ATTR | FATTR4_WORD0_FSID \ 349 | FATTR4_WORD0_SYMLINK_SUPPORT | FATTR4_WORD0_NAMED_ATTR | FATTR4_WORD0_FSID \
@@ -312,7 +355,7 @@ extern struct timeval nfssvc_boot;
312 | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \ 355 | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \
313 | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL) 356 | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL)
314 357
315#define NFSD_SUPPORTED_ATTRS_WORD1 \ 358#define NFSD4_SUPPORTED_ATTRS_WORD1 \
316(FATTR4_WORD1_MODE | FATTR4_WORD1_NO_TRUNC | FATTR4_WORD1_NUMLINKS \ 359(FATTR4_WORD1_MODE | FATTR4_WORD1_NO_TRUNC | FATTR4_WORD1_NUMLINKS \
317 | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_RAWDEV \ 360 | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_RAWDEV \
318 | FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \ 361 | FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \
@@ -320,6 +363,35 @@ extern struct timeval nfssvc_boot;
320 | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \ 363 | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \
321 | FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID) 364 | FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID)
322 365
366#define NFSD4_SUPPORTED_ATTRS_WORD2 0
367
368#define NFSD4_1_SUPPORTED_ATTRS_WORD0 \
369 NFSD4_SUPPORTED_ATTRS_WORD0
370
371#define NFSD4_1_SUPPORTED_ATTRS_WORD1 \
372 NFSD4_SUPPORTED_ATTRS_WORD1
373
374#define NFSD4_1_SUPPORTED_ATTRS_WORD2 \
375 (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT)
376
377static inline u32 nfsd_suppattrs0(u32 minorversion)
378{
379 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0
380 : NFSD4_SUPPORTED_ATTRS_WORD0;
381}
382
383static inline u32 nfsd_suppattrs1(u32 minorversion)
384{
385 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD1
386 : NFSD4_SUPPORTED_ATTRS_WORD1;
387}
388
389static inline u32 nfsd_suppattrs2(u32 minorversion)
390{
391 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD2
392 : NFSD4_SUPPORTED_ATTRS_WORD2;
393}
394
323/* These will return ERR_INVAL if specified in GETATTR or READDIR. */ 395/* These will return ERR_INVAL if specified in GETATTR or READDIR. */
324#define NFSD_WRITEONLY_ATTRS_WORD1 \ 396#define NFSD_WRITEONLY_ATTRS_WORD1 \
325(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET) 397(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)
@@ -330,6 +402,19 @@ extern struct timeval nfssvc_boot;
330#define NFSD_WRITEABLE_ATTRS_WORD1 \ 402#define NFSD_WRITEABLE_ATTRS_WORD1 \
331(FATTR4_WORD1_MODE | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP \ 403(FATTR4_WORD1_MODE | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP \
332 | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET) 404 | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)
405#define NFSD_WRITEABLE_ATTRS_WORD2 0
406
407#define NFSD_SUPPATTR_EXCLCREAT_WORD0 \
408 NFSD_WRITEABLE_ATTRS_WORD0
409/*
410 * we currently store the exclusive create verifier in the v_{a,m}time
411 * attributes so the client can't set these at create time using EXCLUSIVE4_1
412 */
413#define NFSD_SUPPATTR_EXCLCREAT_WORD1 \
414 (NFSD_WRITEABLE_ATTRS_WORD1 & \
415 ~(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET))
416#define NFSD_SUPPATTR_EXCLCREAT_WORD2 \
417 NFSD_WRITEABLE_ATTRS_WORD2
333 418
334#endif /* CONFIG_NFSD_V4 */ 419#endif /* CONFIG_NFSD_V4 */
335 420
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index fa317f6c154b..afa19016c4a8 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -269,6 +269,13 @@ fh_copy(struct svc_fh *dst, struct svc_fh *src)
269 return dst; 269 return dst;
270} 270}
271 271
272static inline void
273fh_copy_shallow(struct knfsd_fh *dst, struct knfsd_fh *src)
274{
275 dst->fh_size = src->fh_size;
276 memcpy(&dst->fh_base, &src->fh_base, src->fh_size);
277}
278
272static __inline__ struct svc_fh * 279static __inline__ struct svc_fh *
273fh_init(struct svc_fh *fhp, int maxsize) 280fh_init(struct svc_fh *fhp, int maxsize)
274{ 281{
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 128298c0362d..4d61c873feed 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -66,8 +66,7 @@ struct nfs4_cb_recall {
66 u32 cbr_ident; 66 u32 cbr_ident;
67 int cbr_trunc; 67 int cbr_trunc;
68 stateid_t cbr_stateid; 68 stateid_t cbr_stateid;
69 u32 cbr_fhlen; 69 struct knfsd_fh cbr_fh;
70 char cbr_fhval[NFS4_FHSIZE];
71 struct nfs4_delegation *cbr_dp; 70 struct nfs4_delegation *cbr_dp;
72}; 71};
73 72
@@ -86,8 +85,7 @@ struct nfs4_delegation {
86}; 85};
87 86
88#define dl_stateid dl_recall.cbr_stateid 87#define dl_stateid dl_recall.cbr_stateid
89#define dl_fhlen dl_recall.cbr_fhlen 88#define dl_fh dl_recall.cbr_fh
90#define dl_fhval dl_recall.cbr_fhval
91 89
92/* client delegation callback info */ 90/* client delegation callback info */
93struct nfs4_callback { 91struct nfs4_callback {
@@ -101,6 +99,64 @@ struct nfs4_callback {
101 struct rpc_clnt * cb_client; 99 struct rpc_clnt * cb_client;
102}; 100};
103 101
102/* Maximum number of slots per session. 128 is useful for long haul TCP */
103#define NFSD_MAX_SLOTS_PER_SESSION 128
104/* Maximum number of pages per slot cache entry */
105#define NFSD_PAGES_PER_SLOT 1
106/* Maximum number of operations per session compound */
107#define NFSD_MAX_OPS_PER_COMPOUND 16
108
109struct nfsd4_cache_entry {
110 __be32 ce_status;
111 struct kvec ce_datav; /* encoded NFSv4.1 data in rq_res.head[0] */
112 struct page *ce_respages[NFSD_PAGES_PER_SLOT + 1];
113 int ce_cachethis;
114 short ce_resused;
115 int ce_opcnt;
116 int ce_rpchdrlen;
117};
118
119struct nfsd4_slot {
120 bool sl_inuse;
121 u32 sl_seqid;
122 struct nfsd4_cache_entry sl_cache_entry;
123};
124
125struct nfsd4_session {
126 struct kref se_ref;
127 struct list_head se_hash; /* hash by sessionid */
128 struct list_head se_perclnt;
129 u32 se_flags;
130 struct nfs4_client *se_client; /* for expire_client */
131 struct nfs4_sessionid se_sessionid;
132 u32 se_fmaxreq_sz;
133 u32 se_fmaxresp_sz;
134 u32 se_fmaxresp_cached;
135 u32 se_fmaxops;
136 u32 se_fnumslots;
137 struct nfsd4_slot se_slots[]; /* forward channel slots */
138};
139
140static inline void
141nfsd4_put_session(struct nfsd4_session *ses)
142{
143 extern void free_session(struct kref *kref);
144 kref_put(&ses->se_ref, free_session);
145}
146
147static inline void
148nfsd4_get_session(struct nfsd4_session *ses)
149{
150 kref_get(&ses->se_ref);
151}
152
153/* formatted contents of nfs4_sessionid */
154struct nfsd4_sessionid {
155 clientid_t clientid;
156 u32 sequence;
157 u32 reserved;
158};
159
104#define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */ 160#define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */
105 161
106/* 162/*
@@ -132,6 +188,12 @@ struct nfs4_client {
132 struct nfs4_callback cl_callback; /* callback info */ 188 struct nfs4_callback cl_callback; /* callback info */
133 atomic_t cl_count; /* ref count */ 189 atomic_t cl_count; /* ref count */
134 u32 cl_firststate; /* recovery dir creation */ 190 u32 cl_firststate; /* recovery dir creation */
191
192 /* for nfs41 */
193 struct list_head cl_sessions;
194 struct nfsd4_slot cl_slot; /* create_session slot */
195 u32 cl_exchange_flags;
196 struct nfs4_sessionid cl_sessionid;
135}; 197};
136 198
137/* struct nfs4_client_reset 199/* struct nfs4_client_reset
@@ -168,8 +230,7 @@ struct nfs4_replay {
168 unsigned int rp_buflen; 230 unsigned int rp_buflen;
169 char *rp_buf; 231 char *rp_buf;
170 unsigned intrp_allocated; 232 unsigned intrp_allocated;
171 int rp_openfh_len; 233 struct knfsd_fh rp_openfh;
172 char rp_openfh[NFS4_FHSIZE];
173 char rp_ibuf[NFSD4_REPLAY_ISIZE]; 234 char rp_ibuf[NFSD4_REPLAY_ISIZE];
174}; 235};
175 236
@@ -217,7 +278,7 @@ struct nfs4_stateowner {
217* share_acces, share_deny on the file. 278* share_acces, share_deny on the file.
218*/ 279*/
219struct nfs4_file { 280struct nfs4_file {
220 struct kref fi_ref; 281 atomic_t fi_ref;
221 struct list_head fi_hash; /* hash by "struct inode *" */ 282 struct list_head fi_hash; /* hash by "struct inode *" */
222 struct list_head fi_stateids; 283 struct list_head fi_stateids;
223 struct list_head fi_delegations; 284 struct list_head fi_delegations;
@@ -259,14 +320,13 @@ struct nfs4_stateid {
259}; 320};
260 321
261/* flags for preprocess_seqid_op() */ 322/* flags for preprocess_seqid_op() */
262#define CHECK_FH 0x00000001 323#define HAS_SESSION 0x00000001
263#define CONFIRM 0x00000002 324#define CONFIRM 0x00000002
264#define OPEN_STATE 0x00000004 325#define OPEN_STATE 0x00000004
265#define LOCK_STATE 0x00000008 326#define LOCK_STATE 0x00000008
266#define RD_STATE 0x00000010 327#define RD_STATE 0x00000010
267#define WR_STATE 0x00000020 328#define WR_STATE 0x00000020
268#define CLOSE_STATE 0x00000040 329#define CLOSE_STATE 0x00000040
269#define DELEG_RET 0x00000080
270 330
271#define seqid_mutating_err(err) \ 331#define seqid_mutating_err(err) \
272 (((err) != nfserr_stale_clientid) && \ 332 (((err) != nfserr_stale_clientid) && \
@@ -274,7 +334,9 @@ struct nfs4_stateid {
274 ((err) != nfserr_stale_stateid) && \ 334 ((err) != nfserr_stale_stateid) && \
275 ((err) != nfserr_bad_stateid)) 335 ((err) != nfserr_bad_stateid))
276 336
277extern __be32 nfs4_preprocess_stateid_op(struct svc_fh *current_fh, 337struct nfsd4_compound_state;
338
339extern __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
278 stateid_t *stateid, int flags, struct file **filp); 340 stateid_t *stateid, int flags, struct file **filp);
279extern void nfs4_lock_state(void); 341extern void nfs4_lock_state(void);
280extern void nfs4_unlock_state(void); 342extern void nfs4_unlock_state(void);
@@ -290,7 +352,7 @@ extern void nfsd4_init_recdir(char *recdir_name);
290extern int nfsd4_recdir_load(void); 352extern int nfsd4_recdir_load(void);
291extern void nfsd4_shutdown_recdir(void); 353extern void nfsd4_shutdown_recdir(void);
292extern int nfs4_client_to_reclaim(const char *name); 354extern int nfs4_client_to_reclaim(const char *name);
293extern int nfs4_has_reclaimed_state(const char *name); 355extern int nfs4_has_reclaimed_state(const char *name, bool use_exchange_id);
294extern void nfsd4_recdir_purge_old(void); 356extern void nfsd4_recdir_purge_old(void);
295extern int nfsd4_create_clid_dir(struct nfs4_client *clp); 357extern int nfsd4_create_clid_dir(struct nfs4_client *clp);
296extern void nfsd4_remove_clid_dir(struct nfs4_client *clp); 358extern void nfsd4_remove_clid_dir(struct nfs4_client *clp);
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
index 7678cfbe9960..2693ef647df6 100644
--- a/include/linux/nfsd/stats.h
+++ b/include/linux/nfsd/stats.h
@@ -11,6 +11,11 @@
11 11
12#include <linux/nfs4.h> 12#include <linux/nfs4.h>
13 13
14/* thread usage wraps very million seconds (approx one fortnight) */
15#define NFSD_USAGE_WRAP (HZ*1000000)
16
17#ifdef __KERNEL__
18
14struct nfsd_stats { 19struct nfsd_stats {
15 unsigned int rchits; /* repcache hits */ 20 unsigned int rchits; /* repcache hits */
16 unsigned int rcmisses; /* repcache hits */ 21 unsigned int rcmisses; /* repcache hits */
@@ -35,10 +40,6 @@ struct nfsd_stats {
35 40
36}; 41};
37 42
38/* thread usage wraps very million seconds (approx one fortnight) */
39#define NFSD_USAGE_WRAP (HZ*1000000)
40
41#ifdef __KERNEL__
42 43
43extern struct nfsd_stats nfsdstats; 44extern struct nfsd_stats nfsdstats;
44extern struct svc_stat nfsd_svcstats; 45extern struct svc_stat nfsd_svcstats;
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 27bd3e38ec5a..f80d6013fdc3 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -45,10 +45,22 @@
45#define XDR_LEN(n) (((n) + 3) & ~3) 45#define XDR_LEN(n) (((n) + 3) & ~3)
46 46
47struct nfsd4_compound_state { 47struct nfsd4_compound_state {
48 struct svc_fh current_fh; 48 struct svc_fh current_fh;
49 struct svc_fh save_fh; 49 struct svc_fh save_fh;
50 struct nfs4_stateowner *replay_owner; 50 struct nfs4_stateowner *replay_owner;
51}; 51 /* For sessions DRC */
52 struct nfsd4_session *session;
53 struct nfsd4_slot *slot;
54 __be32 *statp;
55 size_t iovlen;
56 u32 minorversion;
57 u32 status;
58};
59
60static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs)
61{
62 return cs->slot != NULL;
63}
52 64
53struct nfsd4_change_info { 65struct nfsd4_change_info {
54 u32 atomic; 66 u32 atomic;
@@ -90,7 +102,7 @@ struct nfsd4_create {
90 u32 specdata2; 102 u32 specdata2;
91 } dev; /* NF4BLK, NF4CHR */ 103 } dev; /* NF4BLK, NF4CHR */
92 } u; 104 } u;
93 u32 cr_bmval[2]; /* request */ 105 u32 cr_bmval[3]; /* request */
94 struct iattr cr_iattr; /* request */ 106 struct iattr cr_iattr; /* request */
95 struct nfsd4_change_info cr_cinfo; /* response */ 107 struct nfsd4_change_info cr_cinfo; /* response */
96 struct nfs4_acl *cr_acl; 108 struct nfs4_acl *cr_acl;
@@ -105,7 +117,7 @@ struct nfsd4_delegreturn {
105}; 117};
106 118
107struct nfsd4_getattr { 119struct nfsd4_getattr {
108 u32 ga_bmval[2]; /* request */ 120 u32 ga_bmval[3]; /* request */
109 struct svc_fh *ga_fhp; /* response */ 121 struct svc_fh *ga_fhp; /* response */
110}; 122};
111 123
@@ -206,11 +218,9 @@ struct nfsd4_open {
206 stateid_t op_delegate_stateid; /* request - response */ 218 stateid_t op_delegate_stateid; /* request - response */
207 u32 op_create; /* request */ 219 u32 op_create; /* request */
208 u32 op_createmode; /* request */ 220 u32 op_createmode; /* request */
209 u32 op_bmval[2]; /* request */ 221 u32 op_bmval[3]; /* request */
210 union { /* request */ 222 struct iattr iattr; /* UNCHECKED4, GUARDED4, EXCLUSIVE4_1 */
211 struct iattr iattr; /* UNCHECKED4,GUARDED4 */ 223 nfs4_verifier verf; /* EXCLUSIVE4 */
212 nfs4_verifier verf; /* EXCLUSIVE4 */
213 } u;
214 clientid_t op_clientid; /* request */ 224 clientid_t op_clientid; /* request */
215 struct xdr_netobj op_owner; /* request */ 225 struct xdr_netobj op_owner; /* request */
216 u32 op_seqid; /* request */ 226 u32 op_seqid; /* request */
@@ -224,8 +234,8 @@ struct nfsd4_open {
224 struct nfs4_stateowner *op_stateowner; /* used during processing */ 234 struct nfs4_stateowner *op_stateowner; /* used during processing */
225 struct nfs4_acl *op_acl; 235 struct nfs4_acl *op_acl;
226}; 236};
227#define op_iattr u.iattr 237#define op_iattr iattr
228#define op_verf u.verf 238#define op_verf verf
229 239
230struct nfsd4_open_confirm { 240struct nfsd4_open_confirm {
231 stateid_t oc_req_stateid /* request */; 241 stateid_t oc_req_stateid /* request */;
@@ -259,7 +269,7 @@ struct nfsd4_readdir {
259 nfs4_verifier rd_verf; /* request */ 269 nfs4_verifier rd_verf; /* request */
260 u32 rd_dircount; /* request */ 270 u32 rd_dircount; /* request */
261 u32 rd_maxcount; /* request */ 271 u32 rd_maxcount; /* request */
262 u32 rd_bmval[2]; /* request */ 272 u32 rd_bmval[3]; /* request */
263 struct svc_rqst *rd_rqstp; /* response */ 273 struct svc_rqst *rd_rqstp; /* response */
264 struct svc_fh * rd_fhp; /* response */ 274 struct svc_fh * rd_fhp; /* response */
265 275
@@ -301,7 +311,7 @@ struct nfsd4_secinfo {
301 311
302struct nfsd4_setattr { 312struct nfsd4_setattr {
303 stateid_t sa_stateid; /* request */ 313 stateid_t sa_stateid; /* request */
304 u32 sa_bmval[2]; /* request */ 314 u32 sa_bmval[3]; /* request */
305 struct iattr sa_iattr; /* request */ 315 struct iattr sa_iattr; /* request */
306 struct nfs4_acl *sa_acl; 316 struct nfs4_acl *sa_acl;
307}; 317};
@@ -327,7 +337,7 @@ struct nfsd4_setclientid_confirm {
327 337
328/* also used for NVERIFY */ 338/* also used for NVERIFY */
329struct nfsd4_verify { 339struct nfsd4_verify {
330 u32 ve_bmval[2]; /* request */ 340 u32 ve_bmval[3]; /* request */
331 u32 ve_attrlen; /* request */ 341 u32 ve_attrlen; /* request */
332 char * ve_attrval; /* request */ 342 char * ve_attrval; /* request */
333}; 343};
@@ -344,6 +354,54 @@ struct nfsd4_write {
344 nfs4_verifier wr_verifier; /* response */ 354 nfs4_verifier wr_verifier; /* response */
345}; 355};
346 356
357struct nfsd4_exchange_id {
358 nfs4_verifier verifier;
359 struct xdr_netobj clname;
360 u32 flags;
361 clientid_t clientid;
362 u32 seqid;
363 int spa_how;
364};
365
366struct nfsd4_channel_attrs {
367 u32 headerpadsz;
368 u32 maxreq_sz;
369 u32 maxresp_sz;
370 u32 maxresp_cached;
371 u32 maxops;
372 u32 maxreqs;
373 u32 nr_rdma_attrs;
374 u32 rdma_attrs;
375};
376
377struct nfsd4_create_session {
378 clientid_t clientid;
379 struct nfs4_sessionid sessionid;
380 u32 seqid;
381 u32 flags;
382 struct nfsd4_channel_attrs fore_channel;
383 struct nfsd4_channel_attrs back_channel;
384 u32 callback_prog;
385 u32 uid;
386 u32 gid;
387};
388
389struct nfsd4_sequence {
390 struct nfs4_sessionid sessionid; /* request/response */
391 u32 seqid; /* request/response */
392 u32 slotid; /* request/response */
393 u32 maxslots; /* request/response */
394 u32 cachethis; /* request */
395#if 0
396 u32 target_maxslots; /* response */
397 u32 status_flags; /* response */
398#endif /* not yet */
399};
400
401struct nfsd4_destroy_session {
402 struct nfs4_sessionid sessionid;
403};
404
347struct nfsd4_op { 405struct nfsd4_op {
348 int opnum; 406 int opnum;
349 __be32 status; 407 __be32 status;
@@ -378,6 +436,12 @@ struct nfsd4_op {
378 struct nfsd4_verify verify; 436 struct nfsd4_verify verify;
379 struct nfsd4_write write; 437 struct nfsd4_write write;
380 struct nfsd4_release_lockowner release_lockowner; 438 struct nfsd4_release_lockowner release_lockowner;
439
440 /* NFSv4.1 */
441 struct nfsd4_exchange_id exchange_id;
442 struct nfsd4_create_session create_session;
443 struct nfsd4_destroy_session destroy_session;
444 struct nfsd4_sequence sequence;
381 } u; 445 } u;
382 struct nfs4_replay * replay; 446 struct nfs4_replay * replay;
383}; 447};
@@ -416,9 +480,22 @@ struct nfsd4_compoundres {
416 u32 taglen; 480 u32 taglen;
417 char * tag; 481 char * tag;
418 u32 opcnt; 482 u32 opcnt;
419 __be32 * tagp; /* where to encode tag and opcount */ 483 __be32 * tagp; /* tag, opcount encode location */
484 struct nfsd4_compound_state cstate;
420}; 485};
421 486
487static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp)
488{
489 struct nfsd4_compoundargs *args = resp->rqstp->rq_argp;
490 return args->opcnt == 1;
491}
492
493static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp)
494{
495 return !resp->cstate.slot->sl_cache_entry.ce_cachethis ||
496 nfsd4_is_solo_sequence(resp);
497}
498
422#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) 499#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
423 500
424static inline void 501static inline void
@@ -448,7 +525,23 @@ extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
448extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 525extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
449 struct nfsd4_compound_state *, 526 struct nfsd4_compound_state *,
450 struct nfsd4_setclientid_confirm *setclientid_confirm); 527 struct nfsd4_setclientid_confirm *setclientid_confirm);
451extern __be32 nfsd4_process_open1(struct nfsd4_open *open); 528extern void nfsd4_store_cache_entry(struct nfsd4_compoundres *resp);
529extern __be32 nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp,
530 struct nfsd4_sequence *seq);
531extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp,
532 struct nfsd4_compound_state *,
533struct nfsd4_exchange_id *);
534 extern __be32 nfsd4_create_session(struct svc_rqst *,
535 struct nfsd4_compound_state *,
536 struct nfsd4_create_session *);
537extern __be32 nfsd4_sequence(struct svc_rqst *,
538 struct nfsd4_compound_state *,
539 struct nfsd4_sequence *);
540extern __be32 nfsd4_destroy_session(struct svc_rqst *,
541 struct nfsd4_compound_state *,
542 struct nfsd4_destroy_session *);
543extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *,
544 struct nfsd4_open *open);
452extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, 545extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
453 struct svc_fh *current_fh, struct nfsd4_open *open); 546 struct svc_fh *current_fh, struct nfsd4_open *open);
454extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, 547extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
new file mode 100644
index 000000000000..79fec6af3f9f
--- /dev/null
+++ b/include/linux/nilfs2_fs.h
@@ -0,0 +1,801 @@
1/*
2 * nilfs2_fs.h - NILFS2 on-disk structures and common declarations.
3 *
4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 * Written by Koji Sato <koji@osrg.net>
21 * Ryusuke Konishi <ryusuke@osrg.net>
22 */
23/*
24 * linux/include/linux/ext2_fs.h
25 *
26 * Copyright (C) 1992, 1993, 1994, 1995
27 * Remy Card (card@masi.ibp.fr)
28 * Laboratoire MASI - Institut Blaise Pascal
29 * Universite Pierre et Marie Curie (Paris VI)
30 *
31 * from
32 *
33 * linux/include/linux/minix_fs.h
34 *
35 * Copyright (C) 1991, 1992 Linus Torvalds
36 */
37
38#ifndef _LINUX_NILFS_FS_H
39#define _LINUX_NILFS_FS_H
40
41#include <linux/types.h>
42#include <linux/ioctl.h>
43
44/*
45 * Inode flags stored in nilfs_inode and on-memory nilfs inode
46 *
47 * We define these flags based on ext2-fs because of the
48 * compatibility reason; to avoid problems in chattr(1)
49 */
50#define NILFS_SECRM_FL 0x00000001 /* Secure deletion */
51#define NILFS_UNRM_FL 0x00000002 /* Undelete */
52#define NILFS_SYNC_FL 0x00000008 /* Synchronous updates */
53#define NILFS_IMMUTABLE_FL 0x00000010 /* Immutable file */
54#define NILFS_APPEND_FL 0x00000020 /* writes to file may only append */
55#define NILFS_NODUMP_FL 0x00000040 /* do not dump file */
56#define NILFS_NOATIME_FL 0x00000080 /* do not update atime */
57/* Reserved for compression usage... */
58#define NILFS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
59#define NILFS_DIRSYNC_FL 0x00010000 /* dirsync behaviour */
60
61#define NILFS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
62#define NILFS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
63
64
65#define NILFS_INODE_BMAP_SIZE 7
66/**
67 * struct nilfs_inode - structure of an inode on disk
68 * @i_blocks: blocks count
69 * @i_size: size in bytes
70 * @i_ctime: creation time (seconds)
71 * @i_mtime: modification time (seconds)
72 * @i_ctime_nsec: creation time (nano seconds)
73 * @i_mtime_nsec: modification time (nano seconds)
74 * @i_uid: user id
75 * @i_gid: group id
76 * @i_mode: file mode
77 * @i_links_count: links count
78 * @i_flags: file flags
79 * @i_bmap: block mapping
80 * @i_xattr: extended attributes
81 * @i_generation: file generation (for NFS)
82 * @i_pad: padding
83 */
84struct nilfs_inode {
85 __le64 i_blocks;
86 __le64 i_size;
87 __le64 i_ctime;
88 __le64 i_mtime;
89 __le32 i_ctime_nsec;
90 __le32 i_mtime_nsec;
91 __le32 i_uid;
92 __le32 i_gid;
93 __le16 i_mode;
94 __le16 i_links_count;
95 __le32 i_flags;
96 __le64 i_bmap[NILFS_INODE_BMAP_SIZE];
97#define i_device_code i_bmap[0]
98 __le64 i_xattr;
99 __le32 i_generation;
100 __le32 i_pad;
101};
102
103/**
104 * struct nilfs_super_root - structure of super root
105 * @sr_sum: check sum
106 * @sr_bytes: byte count of the structure
107 * @sr_flags: flags (reserved)
108 * @sr_nongc_ctime: write time of the last segment not for cleaner operation
109 * @sr_dat: DAT file inode
110 * @sr_cpfile: checkpoint file inode
111 * @sr_sufile: segment usage file inode
112 */
113struct nilfs_super_root {
114 __le32 sr_sum;
115 __le16 sr_bytes;
116 __le16 sr_flags;
117 __le64 sr_nongc_ctime;
118 struct nilfs_inode sr_dat;
119 struct nilfs_inode sr_cpfile;
120 struct nilfs_inode sr_sufile;
121};
122
123#define NILFS_SR_MDT_OFFSET(inode_size, i) \
124 ((unsigned long)&((struct nilfs_super_root *)0)->sr_dat + \
125 (inode_size) * (i))
126#define NILFS_SR_DAT_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 0)
127#define NILFS_SR_CPFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 1)
128#define NILFS_SR_SUFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 2)
129#define NILFS_SR_BYTES (sizeof(struct nilfs_super_root))
130
131/*
132 * Maximal mount counts
133 */
134#define NILFS_DFL_MAX_MNT_COUNT 50 /* 50 mounts */
135
136/*
137 * File system states (sbp->s_state, nilfs->ns_mount_state)
138 */
139#define NILFS_VALID_FS 0x0001 /* Unmounted cleanly */
140#define NILFS_ERROR_FS 0x0002 /* Errors detected */
141#define NILFS_RESIZE_FS 0x0004 /* Resize required */
142
143/*
144 * Mount flags (sbi->s_mount_opt)
145 */
146#define NILFS_MOUNT_ERROR_MODE 0x0070 /* Error mode mask */
147#define NILFS_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */
148#define NILFS_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */
149#define NILFS_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */
150#define NILFS_MOUNT_SNAPSHOT 0x0080 /* Snapshot flag */
151#define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */
152#define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order
153 semantics also for data */
154
155
156/**
157 * struct nilfs_super_block - structure of super block on disk
158 */
159struct nilfs_super_block {
160 __le32 s_rev_level; /* Revision level */
161 __le16 s_minor_rev_level; /* minor revision level */
162 __le16 s_magic; /* Magic signature */
163
164 __le16 s_bytes; /* Bytes count of CRC calculation
165 for this structure. s_reserved
166 is excluded. */
167 __le16 s_flags; /* flags */
168 __le32 s_crc_seed; /* Seed value of CRC calculation */
169 __le32 s_sum; /* Check sum of super block */
170
171 __le32 s_log_block_size; /* Block size represented as follows
172 blocksize =
173 1 << (s_log_block_size + 10) */
174 __le64 s_nsegments; /* Number of segments in filesystem */
175 __le64 s_dev_size; /* block device size in bytes */
176 __le64 s_first_data_block; /* 1st seg disk block number */
177 __le32 s_blocks_per_segment; /* number of blocks per full segment */
178 __le32 s_r_segments_percentage; /* Reserved segments percentage */
179
180 __le64 s_last_cno; /* Last checkpoint number */
181 __le64 s_last_pseg; /* disk block addr pseg written last */
182 __le64 s_last_seq; /* seq. number of seg written last */
183 __le64 s_free_blocks_count; /* Free blocks count */
184
185 __le64 s_ctime; /* Creation time (execution time of
186 newfs) */
187 __le64 s_mtime; /* Mount time */
188 __le64 s_wtime; /* Write time */
189 __le16 s_mnt_count; /* Mount count */
190 __le16 s_max_mnt_count; /* Maximal mount count */
191 __le16 s_state; /* File system state */
192 __le16 s_errors; /* Behaviour when detecting errors */
193 __le64 s_lastcheck; /* time of last check */
194
195 __le32 s_checkinterval; /* max. time between checks */
196 __le32 s_creator_os; /* OS */
197 __le16 s_def_resuid; /* Default uid for reserved blocks */
198 __le16 s_def_resgid; /* Default gid for reserved blocks */
199 __le32 s_first_ino; /* First non-reserved inode */
200
201 __le16 s_inode_size; /* Size of an inode */
202 __le16 s_dat_entry_size; /* Size of a dat entry */
203 __le16 s_checkpoint_size; /* Size of a checkpoint */
204 __le16 s_segment_usage_size; /* Size of a segment usage */
205
206 __u8 s_uuid[16]; /* 128-bit uuid for volume */
207 char s_volume_name[16]; /* volume name */
208 char s_last_mounted[64]; /* directory where last mounted */
209
210 __le32 s_c_interval; /* Commit interval of segment */
211 __le32 s_c_block_max; /* Threshold of data amount for
212 the segment construction */
213 __u32 s_reserved[192]; /* padding to the end of the block */
214};
215
216/*
217 * Codes for operating systems
218 */
219#define NILFS_OS_LINUX 0
220/* Codes from 1 to 4 are reserved to keep compatibility with ext2 creator-OS */
221
222/*
223 * Revision levels
224 */
225#define NILFS_CURRENT_REV 2 /* current major revision */
226#define NILFS_MINOR_REV 0 /* minor revision */
227
228/*
229 * Bytes count of super_block for CRC-calculation
230 */
231#define NILFS_SB_BYTES \
232 ((long)&((struct nilfs_super_block *)0)->s_reserved)
233
234/*
235 * Special inode number
236 */
237#define NILFS_ROOT_INO 2 /* Root file inode */
238#define NILFS_DAT_INO 3 /* DAT file */
239#define NILFS_CPFILE_INO 4 /* checkpoint file */
240#define NILFS_SUFILE_INO 5 /* segment usage file */
241#define NILFS_IFILE_INO 6 /* ifile */
242#define NILFS_ATIME_INO 7 /* Atime file (reserved) */
243#define NILFS_XATTR_INO 8 /* Xattribute file (reserved) */
244#define NILFS_SKETCH_INO 10 /* Sketch file */
245#define NILFS_USER_INO 11 /* Fisrt user's file inode number */
246
247#define NILFS_SB_OFFSET_BYTES 1024 /* byte offset of nilfs superblock */
248#define NILFS_SUPER_MAGIC 0x3434 /* NILFS filesystem magic number */
249
250#define NILFS_SEG_MIN_BLOCKS 16 /* Minimum number of blocks in
251 a full segment */
252#define NILFS_PSEG_MIN_BLOCKS 2 /* Minimum number of blocks in
253 a partial segment */
254#define NILFS_MIN_NRSVSEGS 8 /* Minimum number of reserved
255 segments */
256
257/*
258 * bytes offset of secondary super block
259 */
260#define NILFS_SB2_OFFSET_BYTES(devsize) ((((devsize) >> 12) - 1) << 12)
261
262/*
263 * Maximal count of links to a file
264 */
265#define NILFS_LINK_MAX 32000
266
267/*
268 * Structure of a directory entry
269 * (Same as ext2)
270 */
271
272#define NILFS_NAME_LEN 255
273
274/*
275 * The new version of the directory entry. Since V0 structures are
276 * stored in intel byte order, and the name_len field could never be
277 * bigger than 255 chars, it's safe to reclaim the extra byte for the
278 * file_type field.
279 */
280struct nilfs_dir_entry {
281 __le64 inode; /* Inode number */
282 __le16 rec_len; /* Directory entry length */
283 __u8 name_len; /* Name length */
284 __u8 file_type;
285 char name[NILFS_NAME_LEN]; /* File name */
286 char pad;
287};
288
289/*
290 * NILFS directory file types. Only the low 3 bits are used. The
291 * other bits are reserved for now.
292 */
293enum {
294 NILFS_FT_UNKNOWN,
295 NILFS_FT_REG_FILE,
296 NILFS_FT_DIR,
297 NILFS_FT_CHRDEV,
298 NILFS_FT_BLKDEV,
299 NILFS_FT_FIFO,
300 NILFS_FT_SOCK,
301 NILFS_FT_SYMLINK,
302 NILFS_FT_MAX
303};
304
305/*
306 * NILFS_DIR_PAD defines the directory entries boundaries
307 *
308 * NOTE: It must be a multiple of 8
309 */
310#define NILFS_DIR_PAD 8
311#define NILFS_DIR_ROUND (NILFS_DIR_PAD - 1)
312#define NILFS_DIR_REC_LEN(name_len) (((name_len) + 12 + NILFS_DIR_ROUND) & \
313 ~NILFS_DIR_ROUND)
314
315
316/**
317 * struct nilfs_finfo - file information
318 * @fi_ino: inode number
319 * @fi_cno: checkpoint number
320 * @fi_nblocks: number of blocks (including intermediate blocks)
321 * @fi_ndatablk: number of file data blocks
322 */
323struct nilfs_finfo {
324 __le64 fi_ino;
325 __le64 fi_cno;
326 __le32 fi_nblocks;
327 __le32 fi_ndatablk;
328 /* array of virtual block numbers */
329};
330
331/**
332 * struct nilfs_binfo_v - information for the block to which a virtual block number is assigned
333 * @bi_vblocknr: virtual block number
334 * @bi_blkoff: block offset
335 */
336struct nilfs_binfo_v {
337 __le64 bi_vblocknr;
338 __le64 bi_blkoff;
339};
340
341/**
342 * struct nilfs_binfo_dat - information for the block which belongs to the DAT file
343 * @bi_blkoff: block offset
344 * @bi_level: level
345 * @bi_pad: padding
346 */
347struct nilfs_binfo_dat {
348 __le64 bi_blkoff;
349 __u8 bi_level;
350 __u8 bi_pad[7];
351};
352
353/**
354 * union nilfs_binfo: block information
355 * @bi_v: nilfs_binfo_v structure
356 * @bi_dat: nilfs_binfo_dat structure
357 */
358union nilfs_binfo {
359 struct nilfs_binfo_v bi_v;
360 struct nilfs_binfo_dat bi_dat;
361};
362
363/**
364 * struct nilfs_segment_summary - segment summary
365 * @ss_datasum: checksum of data
366 * @ss_sumsum: checksum of segment summary
367 * @ss_magic: magic number
368 * @ss_bytes: size of this structure in bytes
369 * @ss_flags: flags
370 * @ss_seq: sequence number
371 * @ss_create: creation timestamp
372 * @ss_next: next segment
373 * @ss_nblocks: number of blocks
374 * @ss_nfinfo: number of finfo structures
375 * @ss_sumbytes: total size of segment summary in bytes
376 * @ss_pad: padding
377 */
378struct nilfs_segment_summary {
379 __le32 ss_datasum;
380 __le32 ss_sumsum;
381 __le32 ss_magic;
382 __le16 ss_bytes;
383 __le16 ss_flags;
384 __le64 ss_seq;
385 __le64 ss_create;
386 __le64 ss_next;
387 __le32 ss_nblocks;
388 __le32 ss_nfinfo;
389 __le32 ss_sumbytes;
390 __le32 ss_pad;
391 /* array of finfo structures */
392};
393
394#define NILFS_SEGSUM_MAGIC 0x1eaffa11 /* segment summary magic number */
395
396/*
397 * Segment summary flags
398 */
399#define NILFS_SS_LOGBGN 0x0001 /* begins a logical segment */
400#define NILFS_SS_LOGEND 0x0002 /* ends a logical segment */
401#define NILFS_SS_SR 0x0004 /* has super root */
402#define NILFS_SS_SYNDT 0x0008 /* includes data only updates */
403#define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */
404
405/**
406 * struct nilfs_palloc_group_desc - block group descriptor
407 * @pg_nfrees: number of free entries in block group
408 */
409struct nilfs_palloc_group_desc {
410 __le32 pg_nfrees;
411};
412
413/**
414 * struct nilfs_dat_entry - disk address translation entry
415 * @dt_blocknr: block number
416 * @dt_start: start checkpoint number
417 * @dt_end: end checkpoint number
418 * @dt_rsv: reserved for future use
419 */
420struct nilfs_dat_entry {
421 __le64 de_blocknr;
422 __le64 de_start;
423 __le64 de_end;
424 __le64 de_rsv;
425};
426
427/**
428 * struct nilfs_dat_group_desc - block group descriptor
429 * @dg_nfrees: number of free virtual block numbers in block group
430 */
431struct nilfs_dat_group_desc {
432 __le32 dg_nfrees;
433};
434
435
436/**
437 * struct nilfs_snapshot_list - snapshot list
438 * @ssl_next: next checkpoint number on snapshot list
439 * @ssl_prev: previous checkpoint number on snapshot list
440 */
441struct nilfs_snapshot_list {
442 __le64 ssl_next;
443 __le64 ssl_prev;
444};
445
446/**
447 * struct nilfs_checkpoint - checkpoint structure
448 * @cp_flags: flags
449 * @cp_checkpoints_count: checkpoints count in a block
450 * @cp_snapshot_list: snapshot list
451 * @cp_cno: checkpoint number
452 * @cp_create: creation timestamp
453 * @cp_nblk_inc: number of blocks incremented by this checkpoint
454 * @cp_inodes_count: inodes count
455 * @cp_blocks_count: blocks count
456 * @cp_ifile_inode: inode of ifile
457 */
458struct nilfs_checkpoint {
459 __le32 cp_flags;
460 __le32 cp_checkpoints_count;
461 struct nilfs_snapshot_list cp_snapshot_list;
462 __le64 cp_cno;
463 __le64 cp_create;
464 __le64 cp_nblk_inc;
465 __le64 cp_inodes_count;
466 __le64 cp_blocks_count; /* Reserved (might be deleted) */
467
468 /* Do not change the byte offset of ifile inode.
469 To keep the compatibility of the disk format,
470 additional fields should be added behind cp_ifile_inode. */
471 struct nilfs_inode cp_ifile_inode;
472};
473
474/* checkpoint flags */
475enum {
476 NILFS_CHECKPOINT_SNAPSHOT,
477 NILFS_CHECKPOINT_INVALID,
478 NILFS_CHECKPOINT_SKETCH,
479 NILFS_CHECKPOINT_MINOR,
480};
481
482#define NILFS_CHECKPOINT_FNS(flag, name) \
483static inline void \
484nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \
485{ \
486 cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \
487 (1UL << NILFS_CHECKPOINT_##flag)); \
488} \
489static inline void \
490nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \
491{ \
492 cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) & \
493 ~(1UL << NILFS_CHECKPOINT_##flag)); \
494} \
495static inline int \
496nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \
497{ \
498 return !!(le32_to_cpu(cp->cp_flags) & \
499 (1UL << NILFS_CHECKPOINT_##flag)); \
500}
501
502NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
503NILFS_CHECKPOINT_FNS(INVALID, invalid)
504NILFS_CHECKPOINT_FNS(MINOR, minor)
505
506/**
507 * struct nilfs_cpinfo - checkpoint information
508 * @ci_flags: flags
509 * @ci_pad: padding
510 * @ci_cno: checkpoint number
511 * @ci_create: creation timestamp
512 * @ci_nblk_inc: number of blocks incremented by this checkpoint
513 * @ci_inodes_count: inodes count
514 * @ci_blocks_count: blocks count
515 * @ci_next: next checkpoint number in snapshot list
516 */
517struct nilfs_cpinfo {
518 __u32 ci_flags;
519 __u32 ci_pad;
520 __u64 ci_cno;
521 __u64 ci_create;
522 __u64 ci_nblk_inc;
523 __u64 ci_inodes_count;
524 __u64 ci_blocks_count;
525 __u64 ci_next;
526};
527
528#define NILFS_CPINFO_FNS(flag, name) \
529static inline int \
530nilfs_cpinfo_##name(const struct nilfs_cpinfo *cpinfo) \
531{ \
532 return !!(cpinfo->ci_flags & (1UL << NILFS_CHECKPOINT_##flag)); \
533}
534
535NILFS_CPINFO_FNS(SNAPSHOT, snapshot)
536NILFS_CPINFO_FNS(INVALID, invalid)
537NILFS_CPINFO_FNS(MINOR, minor)
538
539
540/**
541 * struct nilfs_cpfile_header - checkpoint file header
542 * @ch_ncheckpoints: number of checkpoints
543 * @ch_nsnapshots: number of snapshots
544 * @ch_snapshot_list: snapshot list
545 */
546struct nilfs_cpfile_header {
547 __le64 ch_ncheckpoints;
548 __le64 ch_nsnapshots;
549 struct nilfs_snapshot_list ch_snapshot_list;
550};
551
552#define NILFS_CPFILE_FIRST_CHECKPOINT_OFFSET \
553 ((sizeof(struct nilfs_cpfile_header) + \
554 sizeof(struct nilfs_checkpoint) - 1) / \
555 sizeof(struct nilfs_checkpoint))
556
557/**
558 * struct nilfs_segment_usage - segment usage
559 * @su_lastmod: last modified timestamp
560 * @su_nblocks: number of blocks in segment
561 * @su_flags: flags
562 */
563struct nilfs_segment_usage {
564 __le64 su_lastmod;
565 __le32 su_nblocks;
566 __le32 su_flags;
567};
568
569/* segment usage flag */
570enum {
571 NILFS_SEGMENT_USAGE_ACTIVE,
572 NILFS_SEGMENT_USAGE_DIRTY,
573 NILFS_SEGMENT_USAGE_ERROR,
574
575 /* ... */
576};
577
578#define NILFS_SEGMENT_USAGE_FNS(flag, name) \
579static inline void \
580nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \
581{ \
582 su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) | \
583 (1UL << NILFS_SEGMENT_USAGE_##flag));\
584} \
585static inline void \
586nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \
587{ \
588 su->su_flags = \
589 cpu_to_le32(le32_to_cpu(su->su_flags) & \
590 ~(1UL << NILFS_SEGMENT_USAGE_##flag)); \
591} \
592static inline int \
593nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \
594{ \
595 return !!(le32_to_cpu(su->su_flags) & \
596 (1UL << NILFS_SEGMENT_USAGE_##flag)); \
597}
598
599NILFS_SEGMENT_USAGE_FNS(ACTIVE, active)
600NILFS_SEGMENT_USAGE_FNS(DIRTY, dirty)
601NILFS_SEGMENT_USAGE_FNS(ERROR, error)
602
603static inline void
604nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su)
605{
606 su->su_lastmod = cpu_to_le64(0);
607 su->su_nblocks = cpu_to_le32(0);
608 su->su_flags = cpu_to_le32(0);
609}
610
611static inline int
612nilfs_segment_usage_clean(const struct nilfs_segment_usage *su)
613{
614 return !le32_to_cpu(su->su_flags);
615}
616
617/**
618 * struct nilfs_sufile_header - segment usage file header
619 * @sh_ncleansegs: number of clean segments
620 * @sh_ndirtysegs: number of dirty segments
621 * @sh_last_alloc: last allocated segment number
622 */
623struct nilfs_sufile_header {
624 __le64 sh_ncleansegs;
625 __le64 sh_ndirtysegs;
626 __le64 sh_last_alloc;
627 /* ... */
628};
629
630#define NILFS_SUFILE_FIRST_SEGMENT_USAGE_OFFSET \
631 ((sizeof(struct nilfs_sufile_header) + \
632 sizeof(struct nilfs_segment_usage) - 1) / \
633 sizeof(struct nilfs_segment_usage))
634
635/**
636 * nilfs_suinfo - segment usage information
637 * @sui_lastmod:
638 * @sui_nblocks:
639 * @sui_flags:
640 */
641struct nilfs_suinfo {
642 __u64 sui_lastmod;
643 __u32 sui_nblocks;
644 __u32 sui_flags;
645};
646
647#define NILFS_SUINFO_FNS(flag, name) \
648static inline int \
649nilfs_suinfo_##name(const struct nilfs_suinfo *si) \
650{ \
651 return si->sui_flags & (1UL << NILFS_SEGMENT_USAGE_##flag); \
652}
653
654NILFS_SUINFO_FNS(ACTIVE, active)
655NILFS_SUINFO_FNS(DIRTY, dirty)
656NILFS_SUINFO_FNS(ERROR, error)
657
658static inline int nilfs_suinfo_clean(const struct nilfs_suinfo *si)
659{
660 return !si->sui_flags;
661}
662
663/* ioctl */
664enum {
665 NILFS_CHECKPOINT,
666 NILFS_SNAPSHOT,
667};
668
669/**
670 * struct nilfs_cpmode -
671 * @cc_cno:
672 * @cc_mode:
673 */
674struct nilfs_cpmode {
675 __u64 cm_cno;
676 __u32 cm_mode;
677 __u32 cm_pad;
678};
679
680/**
681 * struct nilfs_argv - argument vector
682 * @v_base:
683 * @v_nmembs:
684 * @v_size:
685 * @v_flags:
686 * @v_index:
687 */
688struct nilfs_argv {
689 __u64 v_base;
690 __u32 v_nmembs; /* number of members */
691 __u16 v_size; /* size of members */
692 __u16 v_flags;
693 __u64 v_index;
694};
695
696/**
697 * struct nilfs_period -
698 * @p_start:
699 * @p_end:
700 */
701struct nilfs_period {
702 __u64 p_start;
703 __u64 p_end;
704};
705
706/**
707 * struct nilfs_cpstat -
708 * @cs_cno: checkpoint number
709 * @cs_ncps: number of checkpoints
710 * @cs_nsss: number of snapshots
711 */
712struct nilfs_cpstat {
713 __u64 cs_cno;
714 __u64 cs_ncps;
715 __u64 cs_nsss;
716};
717
718/**
719 * struct nilfs_sustat -
720 * @ss_nsegs: number of segments
721 * @ss_ncleansegs: number of clean segments
722 * @ss_ndirtysegs: number of dirty segments
723 * @ss_ctime: creation time of the last segment
724 * @ss_nongc_ctime: creation time of the last segment not for GC
725 * @ss_prot_seq: least sequence number of segments which must not be reclaimed
726 */
727struct nilfs_sustat {
728 __u64 ss_nsegs;
729 __u64 ss_ncleansegs;
730 __u64 ss_ndirtysegs;
731 __u64 ss_ctime;
732 __u64 ss_nongc_ctime;
733 __u64 ss_prot_seq;
734};
735
736/**
737 * struct nilfs_vinfo - virtual block number information
738 * @vi_vblocknr:
739 * @vi_start:
740 * @vi_end:
741 * @vi_blocknr:
742 */
743struct nilfs_vinfo {
744 __u64 vi_vblocknr;
745 __u64 vi_start;
746 __u64 vi_end;
747 __u64 vi_blocknr;
748};
749
750/**
751 * struct nilfs_vdesc -
752 */
753struct nilfs_vdesc {
754 __u64 vd_ino;
755 __u64 vd_cno;
756 __u64 vd_vblocknr;
757 struct nilfs_period vd_period;
758 __u64 vd_blocknr;
759 __u64 vd_offset;
760 __u32 vd_flags;
761 __u32 vd_pad;
762};
763
764/**
765 * struct nilfs_bdesc -
766 */
767struct nilfs_bdesc {
768 __u64 bd_ino;
769 __u64 bd_oblocknr;
770 __u64 bd_blocknr;
771 __u64 bd_offset;
772 __u32 bd_level;
773 __u32 bd_pad;
774};
775
776#define NILFS_IOCTL_IDENT 'n'
777
778#define NILFS_IOCTL_CHANGE_CPMODE \
779 _IOW(NILFS_IOCTL_IDENT, 0x80, struct nilfs_cpmode)
780#define NILFS_IOCTL_DELETE_CHECKPOINT \
781 _IOW(NILFS_IOCTL_IDENT, 0x81, __u64)
782#define NILFS_IOCTL_GET_CPINFO \
783 _IOR(NILFS_IOCTL_IDENT, 0x82, struct nilfs_argv)
784#define NILFS_IOCTL_GET_CPSTAT \
785 _IOR(NILFS_IOCTL_IDENT, 0x83, struct nilfs_cpstat)
786#define NILFS_IOCTL_GET_SUINFO \
787 _IOR(NILFS_IOCTL_IDENT, 0x84, struct nilfs_argv)
788#define NILFS_IOCTL_GET_SUSTAT \
789 _IOR(NILFS_IOCTL_IDENT, 0x85, struct nilfs_sustat)
790#define NILFS_IOCTL_GET_VINFO \
791 _IOWR(NILFS_IOCTL_IDENT, 0x86, struct nilfs_argv)
792#define NILFS_IOCTL_GET_BDESCS \
793 _IOWR(NILFS_IOCTL_IDENT, 0x87, struct nilfs_argv)
794#define NILFS_IOCTL_CLEAN_SEGMENTS \
795 _IOW(NILFS_IOCTL_IDENT, 0x88, struct nilfs_argv[5])
796#define NILFS_IOCTL_SYNC \
797 _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64)
798#define NILFS_IOCTL_RESIZE \
799 _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64)
800
801#endif /* _LINUX_NILFS_FS_H */
diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h
index ea8c6d84996d..cc1767f5cca8 100644
--- a/include/linux/parport_pc.h
+++ b/include/linux/parport_pc.h
@@ -228,10 +228,11 @@ extern void parport_pc_release_resources(struct parport *p);
228extern int parport_pc_claim_resources(struct parport *p); 228extern int parport_pc_claim_resources(struct parport *p);
229 229
230/* PCMCIA code will want to get us to look at a port. Provide a mechanism. */ 230/* PCMCIA code will want to get us to look at a port. Provide a mechanism. */
231extern struct parport *parport_pc_probe_port (unsigned long base, 231extern struct parport *parport_pc_probe_port(unsigned long base,
232 unsigned long base_hi, 232 unsigned long base_hi,
233 int irq, int dma, 233 int irq, int dma,
234 struct device *dev); 234 struct device *dev,
235extern void parport_pc_unregister_port (struct parport *p); 235 int irqflags);
236extern void parport_pc_unregister_port(struct parport *p);
236 237
237#endif 238#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a7fe4bbd7ff1..72698d89e767 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -674,6 +674,11 @@ int __must_check pci_reenable_device(struct pci_dev *);
674int __must_check pcim_enable_device(struct pci_dev *pdev); 674int __must_check pcim_enable_device(struct pci_dev *pdev);
675void pcim_pin_device(struct pci_dev *pdev); 675void pcim_pin_device(struct pci_dev *pdev);
676 676
677static inline int pci_is_enabled(struct pci_dev *pdev)
678{
679 return (atomic_read(&pdev->enable_cnt) > 0);
680}
681
677static inline int pci_is_managed(struct pci_dev *pdev) 682static inline int pci_is_managed(struct pci_dev *pdev)
678{ 683{
679 return pdev->is_managed; 684 return pdev->is_managed;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 170f8b1f22db..06ba90c211a5 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -944,6 +944,32 @@
944#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 944#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801
945#define PCI_DEVICE_ID_SUN_CASSINI 0xabba 945#define PCI_DEVICE_ID_SUN_CASSINI 0xabba
946 946
947#define PCI_VENDOR_ID_NI 0x1093
948#define PCI_DEVICE_ID_NI_PCI2322 0xd130
949#define PCI_DEVICE_ID_NI_PCI2324 0xd140
950#define PCI_DEVICE_ID_NI_PCI2328 0xd150
951#define PCI_DEVICE_ID_NI_PXI8422_2322 0xd190
952#define PCI_DEVICE_ID_NI_PXI8422_2324 0xd1a0
953#define PCI_DEVICE_ID_NI_PXI8420_2322 0xd1d0
954#define PCI_DEVICE_ID_NI_PXI8420_2324 0xd1e0
955#define PCI_DEVICE_ID_NI_PXI8420_2328 0xd1f0
956#define PCI_DEVICE_ID_NI_PXI8420_23216 0xd1f1
957#define PCI_DEVICE_ID_NI_PCI2322I 0xd250
958#define PCI_DEVICE_ID_NI_PCI2324I 0xd270
959#define PCI_DEVICE_ID_NI_PCI23216 0xd2b0
960#define PCI_DEVICE_ID_NI_PXI8430_2322 0x7080
961#define PCI_DEVICE_ID_NI_PCI8430_2322 0x70db
962#define PCI_DEVICE_ID_NI_PXI8430_2324 0x70dd
963#define PCI_DEVICE_ID_NI_PCI8430_2324 0x70df
964#define PCI_DEVICE_ID_NI_PXI8430_2328 0x70e2
965#define PCI_DEVICE_ID_NI_PCI8430_2328 0x70e4
966#define PCI_DEVICE_ID_NI_PXI8430_23216 0x70e6
967#define PCI_DEVICE_ID_NI_PCI8430_23216 0x70e7
968#define PCI_DEVICE_ID_NI_PXI8432_2322 0x70e8
969#define PCI_DEVICE_ID_NI_PCI8432_2322 0x70ea
970#define PCI_DEVICE_ID_NI_PXI8432_2324 0x70ec
971#define PCI_DEVICE_ID_NI_PCI8432_2324 0x70ee
972
947#define PCI_VENDOR_ID_CMD 0x1095 973#define PCI_VENDOR_ID_CMD 0x1095
948#define PCI_DEVICE_ID_CMD_643 0x0643 974#define PCI_DEVICE_ID_CMD_643 0x0643
949#define PCI_DEVICE_ID_CMD_646 0x0646 975#define PCI_DEVICE_ID_CMD_646 0x0646
@@ -2488,6 +2514,8 @@
2488#define PCI_DEVICE_ID_INTEL_IOAT_TBG3 0x3433 2514#define PCI_DEVICE_ID_INTEL_IOAT_TBG3 0x3433
2489#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2515#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2490#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2516#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
2517#define PCI_DEVICE_ID_INTEL_82854_HB 0x358c
2518#define PCI_DEVICE_ID_INTEL_82854_IG 0x358e
2491#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 2519#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580
2492#define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582 2520#define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582
2493#define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590 2521#define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h
index cb7d10f30763..d4cf7a2ceb3e 100644
--- a/include/linux/pda_power.h
+++ b/include/linux/pda_power.h
@@ -31,6 +31,8 @@ struct pda_power_pdata {
31 unsigned int wait_for_status; /* msecs, default is 500 */ 31 unsigned int wait_for_status; /* msecs, default is 500 */
32 unsigned int wait_for_charger; /* msecs, default is 500 */ 32 unsigned int wait_for_charger; /* msecs, default is 500 */
33 unsigned int polling_interval; /* msecs, default is 2000 */ 33 unsigned int polling_interval; /* msecs, default is 2000 */
34
35 unsigned long ac_max_uA; /* current to draw when on AC */
34}; 36};
35 37
36#endif /* __PDA_POWER_H__ */ 38#endif /* __PDA_POWER_H__ */
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index ee5615d65211..cfda2d5ad319 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -168,4 +168,56 @@ static inline void free_percpu(void *p)
168#define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ 168#define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \
169 __alignof__(type)) 169 __alignof__(type))
170 170
171/*
172 * Optional methods for optimized non-lvalue per-cpu variable access.
173 *
174 * @var can be a percpu variable or a field of it and its size should
175 * equal char, int or long. percpu_read() evaluates to a lvalue and
176 * all others to void.
177 *
178 * These operations are guaranteed to be atomic w.r.t. preemption.
179 * The generic versions use plain get/put_cpu_var(). Archs are
180 * encouraged to implement single-instruction alternatives which don't
181 * require preemption protection.
182 */
183#ifndef percpu_read
184# define percpu_read(var) \
185 ({ \
186 typeof(per_cpu_var(var)) __tmp_var__; \
187 __tmp_var__ = get_cpu_var(var); \
188 put_cpu_var(var); \
189 __tmp_var__; \
190 })
191#endif
192
193#define __percpu_generic_to_op(var, val, op) \
194do { \
195 get_cpu_var(var) op val; \
196 put_cpu_var(var); \
197} while (0)
198
199#ifndef percpu_write
200# define percpu_write(var, val) __percpu_generic_to_op(var, (val), =)
201#endif
202
203#ifndef percpu_add
204# define percpu_add(var, val) __percpu_generic_to_op(var, (val), +=)
205#endif
206
207#ifndef percpu_sub
208# define percpu_sub(var, val) __percpu_generic_to_op(var, (val), -=)
209#endif
210
211#ifndef percpu_and
212# define percpu_and(var, val) __percpu_generic_to_op(var, (val), &=)
213#endif
214
215#ifndef percpu_or
216# define percpu_or(var, val) __percpu_generic_to_op(var, (val), |=)
217#endif
218
219#ifndef percpu_xor
220# define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=)
221#endif
222
171#endif /* __LINUX_PERCPU_H */ 223#endif /* __LINUX_PERCPU_H */
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h
index 80044a4f3ab9..bfd92e1e5d2c 100644
--- a/include/linux/rcuclassic.h
+++ b/include/linux/rcuclassic.h
@@ -36,7 +36,6 @@
36#include <linux/cache.h> 36#include <linux/cache.h>
37#include <linux/spinlock.h> 37#include <linux/spinlock.h>
38#include <linux/threads.h> 38#include <linux/threads.h>
39#include <linux/percpu.h>
40#include <linux/cpumask.h> 39#include <linux/cpumask.h>
41#include <linux/seqlock.h> 40#include <linux/seqlock.h>
42 41
@@ -108,25 +107,14 @@ struct rcu_data {
108 struct rcu_head barrier; 107 struct rcu_head barrier;
109}; 108};
110 109
111DECLARE_PER_CPU(struct rcu_data, rcu_data);
112DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
113
114/* 110/*
115 * Increment the quiescent state counter. 111 * Increment the quiescent state counter.
116 * The counter is a bit degenerated: We do not need to know 112 * The counter is a bit degenerated: We do not need to know
117 * how many quiescent states passed, just if there was at least 113 * how many quiescent states passed, just if there was at least
118 * one since the start of the grace period. Thus just a flag. 114 * one since the start of the grace period. Thus just a flag.
119 */ 115 */
120static inline void rcu_qsctr_inc(int cpu) 116extern void rcu_qsctr_inc(int cpu);
121{ 117extern void rcu_bh_qsctr_inc(int cpu);
122 struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
123 rdp->passed_quiesc = 1;
124}
125static inline void rcu_bh_qsctr_inc(int cpu)
126{
127 struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
128 rdp->passed_quiesc = 1;
129}
130 118
131extern int rcu_pending(int cpu); 119extern int rcu_pending(int cpu);
132extern int rcu_needs_cpu(int cpu); 120extern int rcu_needs_cpu(int cpu);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 528343e6da51..15fbb3ca634d 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -36,7 +36,6 @@
36#include <linux/cache.h> 36#include <linux/cache.h>
37#include <linux/spinlock.h> 37#include <linux/spinlock.h>
38#include <linux/threads.h> 38#include <linux/threads.h>
39#include <linux/percpu.h>
40#include <linux/cpumask.h> 39#include <linux/cpumask.h>
41#include <linux/seqlock.h> 40#include <linux/seqlock.h>
42#include <linux/lockdep.h> 41#include <linux/lockdep.h>
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h
index 74304b4538d8..fce522782ffa 100644
--- a/include/linux/rcupreempt.h
+++ b/include/linux/rcupreempt.h
@@ -36,34 +36,19 @@
36#include <linux/cache.h> 36#include <linux/cache.h>
37#include <linux/spinlock.h> 37#include <linux/spinlock.h>
38#include <linux/threads.h> 38#include <linux/threads.h>
39#include <linux/percpu.h> 39#include <linux/smp.h>
40#include <linux/cpumask.h> 40#include <linux/cpumask.h>
41#include <linux/seqlock.h> 41#include <linux/seqlock.h>
42 42
43struct rcu_dyntick_sched { 43extern void rcu_qsctr_inc(int cpu);
44 int dynticks; 44static inline void rcu_bh_qsctr_inc(int cpu) { }
45 int dynticks_snap;
46 int sched_qs;
47 int sched_qs_snap;
48 int sched_dynticks_snap;
49};
50
51DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);
52
53static inline void rcu_qsctr_inc(int cpu)
54{
55 struct rcu_dyntick_sched *rdssp = &per_cpu(rcu_dyntick_sched, cpu);
56
57 rdssp->sched_qs++;
58}
59#define rcu_bh_qsctr_inc(cpu)
60 45
61/* 46/*
62 * Someone might want to pass call_rcu_bh as a function pointer. 47 * Someone might want to pass call_rcu_bh as a function pointer.
63 * So this needs to just be a rename and not a macro function. 48 * So this needs to just be a rename and not a macro function.
64 * (no parentheses) 49 * (no parentheses)
65 */ 50 */
66#define call_rcu_bh call_rcu 51#define call_rcu_bh call_rcu
67 52
68/** 53/**
69 * call_rcu_sched - Queue RCU callback for invocation after sched grace period. 54 * call_rcu_sched - Queue RCU callback for invocation after sched grace period.
@@ -117,30 +102,12 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
117struct softirq_action; 102struct softirq_action;
118 103
119#ifdef CONFIG_NO_HZ 104#ifdef CONFIG_NO_HZ
120 105extern void rcu_enter_nohz(void);
121static inline void rcu_enter_nohz(void) 106extern void rcu_exit_nohz(void);
122{ 107#else
123 static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); 108# define rcu_enter_nohz() do { } while (0)
124 109# define rcu_exit_nohz() do { } while (0)
125 smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */ 110#endif
126 __get_cpu_var(rcu_dyntick_sched).dynticks++;
127 WARN_ON_RATELIMIT(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1, &rs);
128}
129
130static inline void rcu_exit_nohz(void)
131{
132 static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1);
133
134 __get_cpu_var(rcu_dyntick_sched).dynticks++;
135 smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
136 WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1),
137 &rs);
138}
139
140#else /* CONFIG_NO_HZ */
141#define rcu_enter_nohz() do { } while (0)
142#define rcu_exit_nohz() do { } while (0)
143#endif /* CONFIG_NO_HZ */
144 111
145/* 112/*
146 * A context switch is a grace period for rcupreempt synchronize_rcu() 113 * A context switch is a grace period for rcupreempt synchronize_rcu()
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index a722fb67bb2d..0cdda00f2b2a 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -33,7 +33,6 @@
33#include <linux/cache.h> 33#include <linux/cache.h>
34#include <linux/spinlock.h> 34#include <linux/spinlock.h>
35#include <linux/threads.h> 35#include <linux/threads.h>
36#include <linux/percpu.h>
37#include <linux/cpumask.h> 36#include <linux/cpumask.h>
38#include <linux/seqlock.h> 37#include <linux/seqlock.h>
39 38
@@ -236,30 +235,8 @@ struct rcu_state {
236#endif /* #ifdef CONFIG_NO_HZ */ 235#endif /* #ifdef CONFIG_NO_HZ */
237}; 236};
238 237
239extern struct rcu_state rcu_state; 238extern void rcu_qsctr_inc(int cpu);
240DECLARE_PER_CPU(struct rcu_data, rcu_data); 239extern void rcu_bh_qsctr_inc(int cpu);
241
242extern struct rcu_state rcu_bh_state;
243DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
244
245/*
246 * Increment the quiescent state counter.
247 * The counter is a bit degenerated: We do not need to know
248 * how many quiescent states passed, just if there was at least
249 * one since the start of the grace period. Thus just a flag.
250 */
251static inline void rcu_qsctr_inc(int cpu)
252{
253 struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
254 rdp->passed_quiesc = 1;
255 rdp->passed_quiesc_completed = rdp->completed;
256}
257static inline void rcu_bh_qsctr_inc(int cpu)
258{
259 struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);
260 rdp->passed_quiesc = 1;
261 rdp->passed_quiesc_completed = rdp->completed;
262}
263 240
264extern int rcu_pending(int cpu); 241extern int rcu_pending(int cpu);
265extern int rcu_needs_cpu(int cpu); 242extern int rcu_needs_cpu(int cpu);
diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h
new file mode 100644
index 000000000000..12d63a30c347
--- /dev/null
+++ b/include/linux/rotary_encoder.h
@@ -0,0 +1,13 @@
1#ifndef __ROTARY_ENCODER_H__
2#define __ROTARY_ENCODER_H__
3
4struct rotary_encoder_platform_data {
5 unsigned int steps;
6 unsigned int axis;
7 unsigned int gpio_a;
8 unsigned int gpio_b;
9 unsigned int inverted_a;
10 unsigned int inverted_b;
11};
12
13#endif /* __ROTARY_ENCODER_H__ */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b94f3541f67b..b4c38bc8049c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -205,7 +205,8 @@ extern unsigned long long time_sync_thresh;
205#define task_is_stopped_or_traced(task) \ 205#define task_is_stopped_or_traced(task) \
206 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) 206 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
207#define task_contributes_to_load(task) \ 207#define task_contributes_to_load(task) \
208 ((task->state & TASK_UNINTERRUPTIBLE) != 0) 208 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
209 (task->flags & PF_FROZEN) == 0)
209 210
210#define __set_task_state(tsk, state_value) \ 211#define __set_task_state(tsk, state_value) \
211 do { (tsk)->state = (state_value); } while (0) 212 do { (tsk)->state = (state_value); } while (0)
@@ -300,17 +301,11 @@ extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write,
300 struct file *filp, void __user *buffer, 301 struct file *filp, void __user *buffer,
301 size_t *lenp, loff_t *ppos); 302 size_t *lenp, loff_t *ppos);
302extern unsigned int softlockup_panic; 303extern unsigned int softlockup_panic;
303extern unsigned long sysctl_hung_task_check_count;
304extern unsigned long sysctl_hung_task_timeout_secs;
305extern unsigned long sysctl_hung_task_warnings;
306extern int softlockup_thresh; 304extern int softlockup_thresh;
307#else 305#else
308static inline void softlockup_tick(void) 306static inline void softlockup_tick(void)
309{ 307{
310} 308}
311static inline void spawn_softlockup_task(void)
312{
313}
314static inline void touch_softlockup_watchdog(void) 309static inline void touch_softlockup_watchdog(void)
315{ 310{
316} 311}
@@ -319,6 +314,15 @@ static inline void touch_all_softlockup_watchdogs(void)
319} 314}
320#endif 315#endif
321 316
317#ifdef CONFIG_DETECT_HUNG_TASK
318extern unsigned int sysctl_hung_task_panic;
319extern unsigned long sysctl_hung_task_check_count;
320extern unsigned long sysctl_hung_task_timeout_secs;
321extern unsigned long sysctl_hung_task_warnings;
322extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
323 struct file *filp, void __user *buffer,
324 size_t *lenp, loff_t *ppos);
325#endif
322 326
323/* Attach to any functions which should be ignored in wchan output. */ 327/* Attach to any functions which should be ignored in wchan output. */
324#define __sched __attribute__((__section__(".sched.text"))) 328#define __sched __attribute__((__section__(".sched.text")))
@@ -1255,9 +1259,8 @@ struct task_struct {
1255/* ipc stuff */ 1259/* ipc stuff */
1256 struct sysv_sem sysvsem; 1260 struct sysv_sem sysvsem;
1257#endif 1261#endif
1258#ifdef CONFIG_DETECT_SOFTLOCKUP 1262#ifdef CONFIG_DETECT_HUNG_TASK
1259/* hung task detection */ 1263/* hung task detection */
1260 unsigned long last_switch_timestamp;
1261 unsigned long last_switch_count; 1264 unsigned long last_switch_count;
1262#endif 1265#endif
1263/* CPU-specific state of this task */ 1266/* CPU-specific state of this task */
@@ -1294,6 +1297,11 @@ struct task_struct {
1294/* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ 1297/* Protection of (de-)allocation: mm, files, fs, tty, keyrings */
1295 spinlock_t alloc_lock; 1298 spinlock_t alloc_lock;
1296 1299
1300#ifdef CONFIG_GENERIC_HARDIRQS
1301 /* IRQ handler threads */
1302 struct irqaction *irqaction;
1303#endif
1304
1297 /* Protection of the PI data structures: */ 1305 /* Protection of the PI data structures: */
1298 spinlock_t pi_lock; 1306 spinlock_t pi_lock;
1299 1307
diff --git a/include/linux/security.h b/include/linux/security.h
index 54ed15799a83..d5fd6163606f 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -32,6 +32,7 @@
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/key.h> 33#include <linux/key.h>
34#include <linux/xfrm.h> 34#include <linux/xfrm.h>
35#include <linux/gfp.h>
35#include <net/flow.h> 36#include <net/flow.h>
36 37
37/* Maximum number of letters for an LSM name string */ 38/* Maximum number of letters for an LSM name string */
@@ -2953,5 +2954,28 @@ static inline void securityfs_remove(struct dentry *dentry)
2953 2954
2954#endif 2955#endif
2955 2956
2957#ifdef CONFIG_SECURITY
2958
2959static inline char *alloc_secdata(void)
2960{
2961 return (char *)get_zeroed_page(GFP_KERNEL);
2962}
2963
2964static inline void free_secdata(void *secdata)
2965{
2966 free_page((unsigned long)secdata);
2967}
2968
2969#else
2970
2971static inline char *alloc_secdata(void)
2972{
2973 return (char *)1;
2974}
2975
2976static inline void free_secdata(void *secdata)
2977{ }
2978#endif /* CONFIG_SECURITY */
2979
2956#endif /* ! __LINUX_SECURITY_H */ 2980#endif /* ! __LINUX_SECURITY_H */
2957 2981
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index df9245c7bd3b..57a97e52e58d 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -164,6 +164,9 @@
164/* NWPSERIAL */ 164/* NWPSERIAL */
165#define PORT_NWPSERIAL 85 165#define PORT_NWPSERIAL 85
166 166
167/* MAX3100 */
168#define PORT_MAX3100 86
169
167#ifdef __KERNEL__ 170#ifdef __KERNEL__
168 171
169#include <linux/compiler.h> 172#include <linux/compiler.h>
@@ -277,7 +280,7 @@ struct uart_port {
277 struct uart_icount icount; /* statistics */ 280 struct uart_icount icount; /* statistics */
278 281
279 struct console *cons; /* struct console, if any */ 282 struct console *cons; /* struct console, if any */
280#ifdef CONFIG_SERIAL_CORE_CONSOLE 283#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(SUPPORT_SYSRQ)
281 unsigned long sysrq; /* sysrq timeout */ 284 unsigned long sysrq; /* sysrq timeout */
282#endif 285#endif
283 286
diff --git a/include/linux/serial_max3100.h b/include/linux/serial_max3100.h
new file mode 100644
index 000000000000..4976befb6aeb
--- /dev/null
+++ b/include/linux/serial_max3100.h
@@ -0,0 +1,52 @@
1/*
2 *
3 * Copyright (C) 2007 Christian Pellegrin
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11
12#ifndef _LINUX_SERIAL_MAX3100_H
13#define _LINUX_SERIAL_MAX3100_H 1
14
15
16/**
17 * struct plat_max3100 - MAX3100 SPI UART platform data
18 * @loopback: force MAX3100 in loopback
19 * @crystal: 1 for 3.6864 Mhz, 0 for 1.8432
20 * @max3100_hw_suspend: MAX3100 has a shutdown pin. This is a hook
21 * called on suspend and resume to activate it.
22 * @poll_time: poll time for CTS signal in ms, 0 disables (so no hw
23 * flow ctrl is possible but you have less CPU usage)
24 *
25 * You should use this structure in your machine description to specify
26 * how the MAX3100 is connected. Example:
27 *
28 * static struct plat_max3100 max3100_plat_data = {
29 * .loopback = 0,
30 * .crystal = 0,
31 * .poll_time = 100,
32 * };
33 *
34 * static struct spi_board_info spi_board_info[] = {
35 * {
36 * .modalias = "max3100",
37 * .platform_data = &max3100_plat_data,
38 * .irq = IRQ_EINT12,
39 * .max_speed_hz = 5*1000*1000,
40 * .chip_select = 0,
41 * },
42 * };
43 *
44 **/
45struct plat_max3100 {
46 int loopback;
47 int crystal;
48 void (*max3100_hw_suspend) (int suspend);
49 int poll_time;
50};
51
52#endif
diff --git a/include/linux/sht15.h b/include/linux/sht15.h
new file mode 100644
index 000000000000..046bce05ecab
--- /dev/null
+++ b/include/linux/sht15.h
@@ -0,0 +1,24 @@
1/*
2 * sht15.h - support for the SHT15 Temperature and Humidity Sensor
3 *
4 * Copyright (c) 2009 Jonathan Cameron
5 *
6 * Copyright (c) 2007 Wouter Horre
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13/**
14 * struct sht15_platform_data - sht15 connectivity info
15 * @gpio_data: no. of gpio to which bidirectional data line is connected
16 * @gpio_sck: no. of gpio to which the data clock is connected.
17 * @supply_mv: supply voltage in mv. Overridden by regulator if available.
18 **/
19struct sht15_platform_data {
20 int gpio_data;
21 int gpio_sck;
22 int supply_mv;
23};
24
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index f4523651fa42..5ac9b0bcaf9a 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -73,8 +73,8 @@ found:
73 73
74 ret = kmem_cache_alloc_notrace(cachep, flags); 74 ret = kmem_cache_alloc_notrace(cachep, flags);
75 75
76 kmemtrace_mark_alloc(KMEMTRACE_TYPE_KMALLOC, _THIS_IP_, ret, 76 trace_kmalloc(_THIS_IP_, ret,
77 size, slab_buffer_size(cachep), flags); 77 size, slab_buffer_size(cachep), flags);
78 78
79 return ret; 79 return ret;
80 } 80 }
@@ -128,9 +128,9 @@ found:
128 128
129 ret = kmem_cache_alloc_node_notrace(cachep, flags, node); 129 ret = kmem_cache_alloc_node_notrace(cachep, flags, node);
130 130
131 kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC, _THIS_IP_, 131 trace_kmalloc_node(_THIS_IP_, ret,
132 ret, size, slab_buffer_size(cachep), 132 size, slab_buffer_size(cachep),
133 flags, node); 133 flags, node);
134 134
135 return ret; 135 return ret;
136 } 136 }
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index a1f90528e70b..5046f90c1171 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -233,8 +233,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
233 unsigned int order = get_order(size); 233 unsigned int order = get_order(size);
234 void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); 234 void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order);
235 235
236 kmemtrace_mark_alloc(KMEMTRACE_TYPE_KMALLOC, _THIS_IP_, ret, 236 trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags);
237 size, PAGE_SIZE << order, flags);
238 237
239 return ret; 238 return ret;
240} 239}
@@ -255,9 +254,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
255 254
256 ret = kmem_cache_alloc_notrace(s, flags); 255 ret = kmem_cache_alloc_notrace(s, flags);
257 256
258 kmemtrace_mark_alloc(KMEMTRACE_TYPE_KMALLOC, 257 trace_kmalloc(_THIS_IP_, ret, size, s->size, flags);
259 _THIS_IP_, ret,
260 size, s->size, flags);
261 258
262 return ret; 259 return ret;
263 } 260 }
@@ -296,9 +293,8 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
296 293
297 ret = kmem_cache_alloc_node_notrace(s, flags, node); 294 ret = kmem_cache_alloc_node_notrace(s, flags, node);
298 295
299 kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC, 296 trace_kmalloc_node(_THIS_IP_, ret,
300 _THIS_IP_, ret, 297 size, s->size, flags, node);
301 size, s->size, flags, node);
302 298
303 return ret; 299 return ret;
304 } 300 }
diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h
new file mode 100644
index 000000000000..4231104c9afa
--- /dev/null
+++ b/include/linux/spi/ad7879.h
@@ -0,0 +1,35 @@
1/* linux/spi/ad7879.h */
2
3/* Touchscreen characteristics vary between boards and models. The
4 * platform_data for the device's "struct device" holds this information.
5 *
6 * It's OK if the min/max values are zero.
7 */
8struct ad7879_platform_data {
9 u16 model; /* 7879 */
10 u16 x_plate_ohms;
11 u16 x_min, x_max;
12 u16 y_min, y_max;
13 u16 pressure_min, pressure_max;
14
15 /* [0..255] 0=OFF Starts at 1=550us and goes
16 * all the way to 9.440ms in steps of 35us.
17 */
18 u8 pen_down_acc_interval;
19 /* [0..15] Starts at 0=128us and goes all the
20 * way to 4.096ms in steps of 128us.
21 */
22 u8 first_conversion_delay;
23 /* [0..3] 0 = 2us, 1 = 4us, 2 = 8us, 3 = 16us */
24 u8 acquisition_time;
25 /* [0..3] Average X middle samples 0 = 2, 1 = 4, 2 = 8, 3 = 16 */
26 u8 averaging;
27 /* [0..3] Perform X measurements 0 = OFF,
28 * 1 = 4, 2 = 8, 3 = 16 (median > averaging)
29 */
30 u8 median;
31 /* 1 = AUX/VBAT/GPIO set to GPIO Output */
32 u8 gpio_output;
33 /* Initial GPIO pin state (valid if gpio_output = 1) */
34 u8 gpio_default;
35};
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 68bb1c501d0d..2cc43fa380cb 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
204 * SPI slaves, and are numbered from zero to num_chipselects. 204 * SPI slaves, and are numbered from zero to num_chipselects.
205 * each slave has a chipselect signal, but it's common that not 205 * each slave has a chipselect signal, but it's common that not
206 * every chipselect is connected to a slave. 206 * every chipselect is connected to a slave.
207 * @dma_alignment: SPI controller constraint on DMA buffers alignment.
207 * @setup: updates the device mode and clocking records used by a 208 * @setup: updates the device mode and clocking records used by a
208 * device's SPI controller; protocol code may call this. This 209 * device's SPI controller; protocol code may call this. This
209 * must fail if an unrecognized or unsupported mode is requested. 210 * must fail if an unrecognized or unsupported mode is requested.
@@ -239,6 +240,11 @@ struct spi_master {
239 */ 240 */
240 u16 num_chipselect; 241 u16 num_chipselect;
241 242
243 /* some SPI controllers pose alignment requirements on DMAable
244 * buffers; let protocol drivers know about these requirements.
245 */
246 u16 dma_alignment;
247
242 /* setup mode and clock, etc (spi driver may call many times) */ 248 /* setup mode and clock, etc (spi driver may call many times) */
243 int (*setup)(struct spi_device *spi); 249 int (*setup)(struct spi_device *spi);
244 250
diff --git a/include/linux/stringify.h b/include/linux/stringify.h
index 0b4388356c87..841cec8ed525 100644
--- a/include/linux/stringify.h
+++ b/include/linux/stringify.h
@@ -6,7 +6,7 @@
6 * converts to "bar". 6 * converts to "bar".
7 */ 7 */
8 8
9#define __stringify_1(x) #x 9#define __stringify_1(x...) #x
10#define __stringify(x) __stringify_1(x) 10#define __stringify(x...) __stringify_1(x)
11 11
12#endif /* !__LINUX_STRINGIFY_H */ 12#endif /* !__LINUX_STRINGIFY_H */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index d3a4c0231933..2a30775959e9 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -24,6 +24,15 @@
24 */ 24 */
25typedef int (*svc_thread_fn)(void *); 25typedef int (*svc_thread_fn)(void *);
26 26
27/* statistics for svc_pool structures */
28struct svc_pool_stats {
29 unsigned long packets;
30 unsigned long sockets_queued;
31 unsigned long threads_woken;
32 unsigned long overloads_avoided;
33 unsigned long threads_timedout;
34};
35
27/* 36/*
28 * 37 *
29 * RPC service thread pool. 38 * RPC service thread pool.
@@ -41,6 +50,8 @@ struct svc_pool {
41 struct list_head sp_sockets; /* pending sockets */ 50 struct list_head sp_sockets; /* pending sockets */
42 unsigned int sp_nrthreads; /* # of threads in pool */ 51 unsigned int sp_nrthreads; /* # of threads in pool */
43 struct list_head sp_all_threads; /* all server threads */ 52 struct list_head sp_all_threads; /* all server threads */
53 int sp_nwaking; /* number of threads woken but not yet active */
54 struct svc_pool_stats sp_stats; /* statistics on pool operation */
44} ____cacheline_aligned_in_smp; 55} ____cacheline_aligned_in_smp;
45 56
46/* 57/*
@@ -83,6 +94,8 @@ struct svc_serv {
83 struct module * sv_module; /* optional module to count when 94 struct module * sv_module; /* optional module to count when
84 * adding threads */ 95 * adding threads */
85 svc_thread_fn sv_function; /* main function for threads */ 96 svc_thread_fn sv_function; /* main function for threads */
97 unsigned int sv_drc_max_pages; /* Total pages for DRC */
98 unsigned int sv_drc_pages_used;/* DRC pages used */
86}; 99};
87 100
88/* 101/*
@@ -218,6 +231,7 @@ struct svc_rqst {
218 struct svc_cred rq_cred; /* auth info */ 231 struct svc_cred rq_cred; /* auth info */
219 void * rq_xprt_ctxt; /* transport specific context ptr */ 232 void * rq_xprt_ctxt; /* transport specific context ptr */
220 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ 233 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */
234 int rq_usedeferral; /* use deferral */
221 235
222 size_t rq_xprt_hlen; /* xprt header len */ 236 size_t rq_xprt_hlen; /* xprt header len */
223 struct xdr_buf rq_arg; 237 struct xdr_buf rq_arg;
@@ -263,6 +277,7 @@ struct svc_rqst {
263 * cache pages */ 277 * cache pages */
264 wait_queue_head_t rq_wait; /* synchronization */ 278 wait_queue_head_t rq_wait; /* synchronization */
265 struct task_struct *rq_task; /* service thread */ 279 struct task_struct *rq_task; /* service thread */
280 int rq_waking; /* 1 if thread is being woken */
266}; 281};
267 282
268/* 283/*
@@ -393,6 +408,7 @@ struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
393 void (*shutdown)(struct svc_serv *), 408 void (*shutdown)(struct svc_serv *),
394 svc_thread_fn, struct module *); 409 svc_thread_fn, struct module *);
395int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); 410int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
411int svc_pool_stats_open(struct svc_serv *serv, struct file *file);
396void svc_destroy(struct svc_serv *); 412void svc_destroy(struct svc_serv *);
397int svc_process(struct svc_rqst *); 413int svc_process(struct svc_rqst *);
398int svc_register(const struct svc_serv *, const int, 414int svc_register(const struct svc_serv *, const int,
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 49e1eb454465..d8910b68e1bd 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -69,27 +69,27 @@ struct xdr_buf {
69 * pre-xdr'ed macros. 69 * pre-xdr'ed macros.
70 */ 70 */
71 71
72#define xdr_zero __constant_htonl(0) 72#define xdr_zero cpu_to_be32(0)
73#define xdr_one __constant_htonl(1) 73#define xdr_one cpu_to_be32(1)
74#define xdr_two __constant_htonl(2) 74#define xdr_two cpu_to_be32(2)
75 75
76#define rpc_success __constant_htonl(RPC_SUCCESS) 76#define rpc_success cpu_to_be32(RPC_SUCCESS)
77#define rpc_prog_unavail __constant_htonl(RPC_PROG_UNAVAIL) 77#define rpc_prog_unavail cpu_to_be32(RPC_PROG_UNAVAIL)
78#define rpc_prog_mismatch __constant_htonl(RPC_PROG_MISMATCH) 78#define rpc_prog_mismatch cpu_to_be32(RPC_PROG_MISMATCH)
79#define rpc_proc_unavail __constant_htonl(RPC_PROC_UNAVAIL) 79#define rpc_proc_unavail cpu_to_be32(RPC_PROC_UNAVAIL)
80#define rpc_garbage_args __constant_htonl(RPC_GARBAGE_ARGS) 80#define rpc_garbage_args cpu_to_be32(RPC_GARBAGE_ARGS)
81#define rpc_system_err __constant_htonl(RPC_SYSTEM_ERR) 81#define rpc_system_err cpu_to_be32(RPC_SYSTEM_ERR)
82#define rpc_drop_reply __constant_htonl(RPC_DROP_REPLY) 82#define rpc_drop_reply cpu_to_be32(RPC_DROP_REPLY)
83 83
84#define rpc_auth_ok __constant_htonl(RPC_AUTH_OK) 84#define rpc_auth_ok cpu_to_be32(RPC_AUTH_OK)
85#define rpc_autherr_badcred __constant_htonl(RPC_AUTH_BADCRED) 85#define rpc_autherr_badcred cpu_to_be32(RPC_AUTH_BADCRED)
86#define rpc_autherr_rejectedcred __constant_htonl(RPC_AUTH_REJECTEDCRED) 86#define rpc_autherr_rejectedcred cpu_to_be32(RPC_AUTH_REJECTEDCRED)
87#define rpc_autherr_badverf __constant_htonl(RPC_AUTH_BADVERF) 87#define rpc_autherr_badverf cpu_to_be32(RPC_AUTH_BADVERF)
88#define rpc_autherr_rejectedverf __constant_htonl(RPC_AUTH_REJECTEDVERF) 88#define rpc_autherr_rejectedverf cpu_to_be32(RPC_AUTH_REJECTEDVERF)
89#define rpc_autherr_tooweak __constant_htonl(RPC_AUTH_TOOWEAK) 89#define rpc_autherr_tooweak cpu_to_be32(RPC_AUTH_TOOWEAK)
90#define rpcsec_gsserr_credproblem __constant_htonl(RPCSEC_GSS_CREDPROBLEM) 90#define rpcsec_gsserr_credproblem cpu_to_be32(RPCSEC_GSS_CREDPROBLEM)
91#define rpcsec_gsserr_ctxproblem __constant_htonl(RPCSEC_GSS_CTXPROBLEM) 91#define rpcsec_gsserr_ctxproblem cpu_to_be32(RPCSEC_GSS_CTXPROBLEM)
92#define rpc_autherr_oldseqnum __constant_htonl(101) 92#define rpc_autherr_oldseqnum cpu_to_be32(101)
93 93
94/* 94/*
95 * Miscellaneous XDR helper functions 95 * Miscellaneous XDR helper functions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 6470f74074af..dabe4ad89141 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -65,7 +65,7 @@ struct old_linux_dirent;
65#include <asm/signal.h> 65#include <asm/signal.h>
66#include <linux/quota.h> 66#include <linux/quota.h>
67#include <linux/key.h> 67#include <linux/key.h>
68#include <linux/ftrace.h> 68#include <trace/syscall.h>
69 69
70#define __SC_DECL1(t1, a1) t1 a1 70#define __SC_DECL1(t1, a1) t1 a1
71#define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) 71#define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__)
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 8615d661ab60..bcba84ea2d86 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -309,7 +309,8 @@ extern void tty_set_operations(struct tty_driver *driver,
309extern struct tty_driver *tty_find_polling_driver(char *name, int *line); 309extern struct tty_driver *tty_find_polling_driver(char *name, int *line);
310 310
311extern void tty_driver_kref_put(struct tty_driver *driver); 311extern void tty_driver_kref_put(struct tty_driver *driver);
312extern inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) 312
313static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
313{ 314{
314 kref_get(&d->kref); 315 kref_get(&d->kref);
315 return d; 316 return d;
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index b95842542590..625e9e4639c6 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -29,7 +29,7 @@
29/** 29/**
30 * usb_serial_port: structure for the specific ports of a device. 30 * usb_serial_port: structure for the specific ports of a device.
31 * @serial: pointer back to the struct usb_serial owner of this port. 31 * @serial: pointer back to the struct usb_serial owner of this port.
32 * @tty: pointer to the corresponding tty for this port. 32 * @port: pointer to the corresponding tty_port for this port.
33 * @lock: spinlock to grab when updating portions of this structure. 33 * @lock: spinlock to grab when updating portions of this structure.
34 * @mutex: mutex used to synchronize serial_open() and serial_close() 34 * @mutex: mutex used to synchronize serial_open() and serial_close()
35 * access for this port. 35 * access for this port.
@@ -44,19 +44,22 @@
44 * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe 44 * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe
45 * for this port. 45 * for this port.
46 * @bulk_in_buffer: pointer to the bulk in buffer for this port. 46 * @bulk_in_buffer: pointer to the bulk in buffer for this port.
47 * @bulk_in_size: the size of the bulk_in_buffer, in bytes.
47 * @read_urb: pointer to the bulk in struct urb for this port. 48 * @read_urb: pointer to the bulk in struct urb for this port.
48 * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this 49 * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this
49 * port. 50 * port.
50 * @bulk_out_buffer: pointer to the bulk out buffer for this port. 51 * @bulk_out_buffer: pointer to the bulk out buffer for this port.
51 * @bulk_out_size: the size of the bulk_out_buffer, in bytes. 52 * @bulk_out_size: the size of the bulk_out_buffer, in bytes.
52 * @write_urb: pointer to the bulk out struct urb for this port. 53 * @write_urb: pointer to the bulk out struct urb for this port.
54 * @write_urb_busy: port`s writing status
53 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this 55 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this
54 * port. 56 * port.
55 * @write_wait: a wait_queue_head_t used by the port. 57 * @write_wait: a wait_queue_head_t used by the port.
56 * @work: work queue entry for the line discipline waking up. 58 * @work: work queue entry for the line discipline waking up.
57 * @open_count: number of times this port has been opened.
58 * @throttled: nonzero if the read urb is inactive to throttle the device 59 * @throttled: nonzero if the read urb is inactive to throttle the device
59 * @throttle_req: nonzero if the tty wants to throttle us 60 * @throttle_req: nonzero if the tty wants to throttle us
61 * @console: attached usb serial console
62 * @dev: pointer to the serial device
60 * 63 *
61 * This structure is used by the usb-serial core and drivers for the specific 64 * This structure is used by the usb-serial core and drivers for the specific
62 * ports of a device. 65 * ports of a device.
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 139d234923cd..ebb2ea6b4995 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -737,6 +737,11 @@ struct v4l2_input {
737#define V4L2_IN_ST_NO_SIGNAL 0x00000002 737#define V4L2_IN_ST_NO_SIGNAL 0x00000002
738#define V4L2_IN_ST_NO_COLOR 0x00000004 738#define V4L2_IN_ST_NO_COLOR 0x00000004
739 739
740/* field 'status' - sensor orientation */
741/* If sensor is mounted upside down set both bits */
742#define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */
743#define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */
744
740/* field 'status' - analog */ 745/* field 'status' - analog */
741#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ 746#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
742#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ 747#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 93445477f86a..9c1ed1fb6ddb 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -168,6 +168,8 @@ void writeback_set_ratelimit(void);
168/* pdflush.c */ 168/* pdflush.c */
169extern int nr_pdflush_threads; /* Global so it can be exported to sysctl 169extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
170 read-only. */ 170 read-only. */
171extern int nr_pdflush_threads_max; /* Global so it can be exported to sysctl */
172extern int nr_pdflush_threads_min; /* Global so it can be exported to sysctl */
171 173
172 174
173#endif /* WRITEBACK_H */ 175#endif /* WRITEBACK_H */