diff options
Diffstat (limited to 'include/linux')
62 files changed, 996 insertions, 646 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index f46cfd73a553..bcbdd7484e58 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -485,14 +485,6 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 485 | 485 | ||
| 486 | #endif /* !CONFIG_ACPI */ | 486 | #endif /* !CONFIG_ACPI */ |
| 487 | 487 | ||
| 488 | #ifdef CONFIG_ACPI_NUMA | ||
| 489 | void __init early_parse_srat(void); | ||
| 490 | #else | ||
| 491 | static inline void early_parse_srat(void) | ||
| 492 | { | ||
| 493 | } | ||
| 494 | #endif | ||
| 495 | |||
| 496 | #ifdef CONFIG_ACPI | 488 | #ifdef CONFIG_ACPI |
| 497 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, | 489 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, |
| 498 | u32 pm1a_ctrl, u32 pm1b_ctrl)); | 490 | u32 pm1a_ctrl, u32 pm1b_ctrl)); |
diff --git a/include/linux/bcm47xx_wdt.h b/include/linux/bcm47xx_wdt.h index e5dfc256485b..b708786d4cbf 100644 --- a/include/linux/bcm47xx_wdt.h +++ b/include/linux/bcm47xx_wdt.h | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | #ifndef LINUX_BCM47XX_WDT_H_ | 1 | #ifndef LINUX_BCM47XX_WDT_H_ |
| 2 | #define LINUX_BCM47XX_WDT_H_ | 2 | #define LINUX_BCM47XX_WDT_H_ |
| 3 | 3 | ||
| 4 | #include <linux/notifier.h> | ||
| 5 | #include <linux/timer.h> | ||
| 4 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 7 | #include <linux/watchdog.h> | ||
| 5 | 8 | ||
| 6 | 9 | ||
| 7 | struct bcm47xx_wdt { | 10 | struct bcm47xx_wdt { |
| @@ -10,6 +13,12 @@ struct bcm47xx_wdt { | |||
| 10 | u32 max_timer_ms; | 13 | u32 max_timer_ms; |
| 11 | 14 | ||
| 12 | void *driver_data; | 15 | void *driver_data; |
| 16 | |||
| 17 | struct watchdog_device wdd; | ||
| 18 | struct notifier_block notifier; | ||
| 19 | |||
| 20 | struct timer_list soft_timer; | ||
| 21 | atomic_t soft_ticks; | ||
| 13 | }; | 22 | }; |
| 14 | 23 | ||
| 15 | static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt) | 24 | static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt) |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 1d002b58b60b..8390c474f69a 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
| @@ -528,6 +528,7 @@ struct bcma_sflash { | |||
| 528 | u32 size; | 528 | u32 size; |
| 529 | 529 | ||
| 530 | struct mtd_info *mtd; | 530 | struct mtd_info *mtd; |
| 531 | void *priv; | ||
| 531 | }; | 532 | }; |
| 532 | #endif | 533 | #endif |
| 533 | 534 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f94bc83011ed..78feda9bbae2 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/gfp.h> | 19 | #include <linux/gfp.h> |
| 20 | #include <linux/bsg.h> | 20 | #include <linux/bsg.h> |
| 21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 22 | #include <linux/rcupdate.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/scatterlist.h> | 24 | #include <asm/scatterlist.h> |
| 24 | 25 | ||
| @@ -437,6 +438,7 @@ struct request_queue { | |||
| 437 | /* Throttle data */ | 438 | /* Throttle data */ |
| 438 | struct throtl_data *td; | 439 | struct throtl_data *td; |
| 439 | #endif | 440 | #endif |
| 441 | struct rcu_head rcu_head; | ||
| 440 | }; | 442 | }; |
| 441 | 443 | ||
| 442 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 444 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
| @@ -974,7 +976,6 @@ struct blk_plug { | |||
| 974 | unsigned long magic; /* detect uninitialized use-cases */ | 976 | unsigned long magic; /* detect uninitialized use-cases */ |
| 975 | struct list_head list; /* requests */ | 977 | struct list_head list; /* requests */ |
| 976 | struct list_head cb_list; /* md requires an unplug callback */ | 978 | struct list_head cb_list; /* md requires an unplug callback */ |
| 977 | unsigned int should_sort; /* list to be sorted before flushing? */ | ||
| 978 | }; | 979 | }; |
| 979 | #define BLK_MAX_REQUEST_COUNT 16 | 980 | #define BLK_MAX_REQUEST_COUNT 16 |
| 980 | 981 | ||
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 7c2e030e72f1..0ea61e07a91c 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | struct blk_trace { | 13 | struct blk_trace { |
| 14 | int trace_state; | 14 | int trace_state; |
| 15 | bool rq_based; | ||
| 15 | struct rchan *rchan; | 16 | struct rchan *rchan; |
| 16 | unsigned long __percpu *sequence; | 17 | unsigned long __percpu *sequence; |
| 17 | unsigned char __percpu *msg_data; | 18 | unsigned char __percpu *msg_data; |
diff --git a/include/linux/btrfs.h b/include/linux/btrfs.h new file mode 100644 index 000000000000..22d799147db2 --- /dev/null +++ b/include/linux/btrfs.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _LINUX_BTRFS_H | ||
| 2 | #define _LINUX_BTRFS_H | ||
| 3 | |||
| 4 | #include <uapi/linux/btrfs.h> | ||
| 5 | |||
| 6 | #endif /* _LINUX_BTRFS_H */ | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 458f497738a4..5afc4f94d110 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -126,7 +126,6 @@ BUFFER_FNS(Write_EIO, write_io_error) | |||
| 126 | BUFFER_FNS(Unwritten, unwritten) | 126 | BUFFER_FNS(Unwritten, unwritten) |
| 127 | 127 | ||
| 128 | #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) | 128 | #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) |
| 129 | #define touch_buffer(bh) mark_page_accessed(bh->b_page) | ||
| 130 | 129 | ||
| 131 | /* If we *know* page->private refers to buffer_heads */ | 130 | /* If we *know* page->private refers to buffer_heads */ |
| 132 | #define page_buffers(page) \ | 131 | #define page_buffers(page) \ |
| @@ -142,6 +141,7 @@ BUFFER_FNS(Unwritten, unwritten) | |||
| 142 | 141 | ||
| 143 | void mark_buffer_dirty(struct buffer_head *bh); | 142 | void mark_buffer_dirty(struct buffer_head *bh); |
| 144 | void init_buffer(struct buffer_head *, bh_end_io_t *, void *); | 143 | void init_buffer(struct buffer_head *, bh_end_io_t *, void *); |
| 144 | void touch_buffer(struct buffer_head *bh); | ||
| 145 | void set_bh_page(struct buffer_head *bh, | 145 | void set_bh_page(struct buffer_head *bh, |
| 146 | struct page *page, unsigned long offset); | 146 | struct page *page, unsigned long offset); |
| 147 | int try_to_free_buffers(struct page *); | 147 | int try_to_free_buffers(struct page *); |
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index dad579b0c0e6..76554cecaab2 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h | |||
| @@ -12,16 +12,46 @@ | |||
| 12 | #define CEPH_FEATURE_MONNAMES (1<<5) | 12 | #define CEPH_FEATURE_MONNAMES (1<<5) |
| 13 | #define CEPH_FEATURE_RECONNECT_SEQ (1<<6) | 13 | #define CEPH_FEATURE_RECONNECT_SEQ (1<<6) |
| 14 | #define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) | 14 | #define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) |
| 15 | /* bits 8-17 defined by user-space; not supported yet here */ | 15 | #define CEPH_FEATURE_OBJECTLOCATOR (1<<8) |
| 16 | #define CEPH_FEATURE_PGID64 (1<<9) | ||
| 17 | #define CEPH_FEATURE_INCSUBOSDMAP (1<<10) | ||
| 18 | #define CEPH_FEATURE_PGPOOL3 (1<<11) | ||
| 19 | #define CEPH_FEATURE_OSDREPLYMUX (1<<12) | ||
| 20 | #define CEPH_FEATURE_OSDENC (1<<13) | ||
| 21 | #define CEPH_FEATURE_OMAP (1<<14) | ||
| 22 | #define CEPH_FEATURE_MONENC (1<<15) | ||
| 23 | #define CEPH_FEATURE_QUERY_T (1<<16) | ||
| 24 | #define CEPH_FEATURE_INDEP_PG_MAP (1<<17) | ||
| 16 | #define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) | 25 | #define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) |
| 26 | #define CEPH_FEATURE_CHUNKY_SCRUB (1<<19) | ||
| 27 | #define CEPH_FEATURE_MON_NULLROUTE (1<<20) | ||
| 28 | #define CEPH_FEATURE_MON_GV (1<<21) | ||
| 29 | #define CEPH_FEATURE_BACKFILL_RESERVATION (1<<22) | ||
| 30 | #define CEPH_FEATURE_MSG_AUTH (1<<23) | ||
| 31 | #define CEPH_FEATURE_RECOVERY_RESERVATION (1<<24) | ||
| 32 | #define CEPH_FEATURE_CRUSH_TUNABLES2 (1<<25) | ||
| 33 | #define CEPH_FEATURE_CREATEPOOLID (1<<26) | ||
| 34 | #define CEPH_FEATURE_REPLY_CREATE_INODE (1<<27) | ||
| 35 | #define CEPH_FEATURE_OSD_HBMSGS (1<<28) | ||
| 36 | #define CEPH_FEATURE_MDSENC (1<<29) | ||
| 37 | #define CEPH_FEATURE_OSDHASHPSPOOL (1<<30) | ||
| 17 | 38 | ||
| 18 | /* | 39 | /* |
| 19 | * Features supported. | 40 | * Features supported. |
| 20 | */ | 41 | */ |
| 21 | #define CEPH_FEATURES_SUPPORTED_DEFAULT \ | 42 | #define CEPH_FEATURES_SUPPORTED_DEFAULT \ |
| 22 | (CEPH_FEATURE_NOSRCADDR | \ | 43 | (CEPH_FEATURE_NOSRCADDR | \ |
| 23 | CEPH_FEATURE_CRUSH_TUNABLES) | 44 | CEPH_FEATURE_PGID64 | \ |
| 45 | CEPH_FEATURE_PGPOOL3 | \ | ||
| 46 | CEPH_FEATURE_OSDENC | \ | ||
| 47 | CEPH_FEATURE_CRUSH_TUNABLES | \ | ||
| 48 | CEPH_FEATURE_CRUSH_TUNABLES2 | \ | ||
| 49 | CEPH_FEATURE_REPLY_CREATE_INODE | \ | ||
| 50 | CEPH_FEATURE_OSDHASHPSPOOL) | ||
| 24 | 51 | ||
| 25 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ | 52 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ |
| 26 | (CEPH_FEATURE_NOSRCADDR) | 53 | (CEPH_FEATURE_NOSRCADDR | \ |
| 54 | CEPH_FEATURE_PGID64 | \ | ||
| 55 | CEPH_FEATURE_PGPOOL3 | \ | ||
| 56 | CEPH_FEATURE_OSDENC) | ||
| 27 | #endif | 57 | #endif |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index cf6f4d998a76..2ad7b860f062 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
| @@ -21,16 +21,14 @@ | |||
| 21 | * internal cluster protocols separately from the public, | 21 | * internal cluster protocols separately from the public, |
| 22 | * client-facing protocol. | 22 | * client-facing protocol. |
| 23 | */ | 23 | */ |
| 24 | #define CEPH_OSD_PROTOCOL 8 /* cluster internal */ | ||
| 25 | #define CEPH_MDS_PROTOCOL 12 /* cluster internal */ | ||
| 26 | #define CEPH_MON_PROTOCOL 5 /* cluster internal */ | ||
| 27 | #define CEPH_OSDC_PROTOCOL 24 /* server/client */ | 24 | #define CEPH_OSDC_PROTOCOL 24 /* server/client */ |
| 28 | #define CEPH_MDSC_PROTOCOL 32 /* server/client */ | 25 | #define CEPH_MDSC_PROTOCOL 32 /* server/client */ |
| 29 | #define CEPH_MONC_PROTOCOL 15 /* server/client */ | 26 | #define CEPH_MONC_PROTOCOL 15 /* server/client */ |
| 30 | 27 | ||
| 31 | 28 | ||
| 32 | #define CEPH_INO_ROOT 1 | 29 | #define CEPH_INO_ROOT 1 |
| 33 | #define CEPH_INO_CEPH 2 /* hidden .ceph dir */ | 30 | #define CEPH_INO_CEPH 2 /* hidden .ceph dir */ |
| 31 | #define CEPH_INO_DOTDOT 3 /* used by ceph fuse for parent (..) */ | ||
| 34 | 32 | ||
| 35 | /* arbitrary limit on max # of monitors (cluster of 3 is typical) */ | 33 | /* arbitrary limit on max # of monitors (cluster of 3 is typical) */ |
| 36 | #define CEPH_MAX_MON 31 | 34 | #define CEPH_MAX_MON 31 |
| @@ -51,7 +49,7 @@ struct ceph_file_layout { | |||
| 51 | __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */ | 49 | __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */ |
| 52 | 50 | ||
| 53 | /* object -> pg layout */ | 51 | /* object -> pg layout */ |
| 54 | __le32 fl_unused; /* unused; used to be preferred primary (-1) */ | 52 | __le32 fl_unused; /* unused; used to be preferred primary for pg (-1 for none) */ |
| 55 | __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ | 53 | __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ |
| 56 | } __attribute__ ((packed)); | 54 | } __attribute__ ((packed)); |
| 57 | 55 | ||
| @@ -101,6 +99,8 @@ struct ceph_dir_layout { | |||
| 101 | #define CEPH_MSG_MON_SUBSCRIBE_ACK 16 | 99 | #define CEPH_MSG_MON_SUBSCRIBE_ACK 16 |
| 102 | #define CEPH_MSG_AUTH 17 | 100 | #define CEPH_MSG_AUTH 17 |
| 103 | #define CEPH_MSG_AUTH_REPLY 18 | 101 | #define CEPH_MSG_AUTH_REPLY 18 |
| 102 | #define CEPH_MSG_MON_GET_VERSION 19 | ||
| 103 | #define CEPH_MSG_MON_GET_VERSION_REPLY 20 | ||
| 104 | 104 | ||
| 105 | /* client <-> mds */ | 105 | /* client <-> mds */ |
| 106 | #define CEPH_MSG_MDS_MAP 21 | 106 | #define CEPH_MSG_MDS_MAP 21 |
| @@ -221,6 +221,11 @@ struct ceph_mon_subscribe_ack { | |||
| 221 | } __attribute__ ((packed)); | 221 | } __attribute__ ((packed)); |
| 222 | 222 | ||
| 223 | /* | 223 | /* |
| 224 | * mdsmap flags | ||
| 225 | */ | ||
| 226 | #define CEPH_MDSMAP_DOWN (1<<0) /* cluster deliberately down */ | ||
| 227 | |||
| 228 | /* | ||
| 224 | * mds states | 229 | * mds states |
| 225 | * > 0 -> in | 230 | * > 0 -> in |
| 226 | * <= 0 -> out | 231 | * <= 0 -> out |
| @@ -233,6 +238,7 @@ struct ceph_mon_subscribe_ack { | |||
| 233 | #define CEPH_MDS_STATE_CREATING -6 /* up, creating MDS instance. */ | 238 | #define CEPH_MDS_STATE_CREATING -6 /* up, creating MDS instance. */ |
| 234 | #define CEPH_MDS_STATE_STARTING -7 /* up, starting previously stopped mds */ | 239 | #define CEPH_MDS_STATE_STARTING -7 /* up, starting previously stopped mds */ |
| 235 | #define CEPH_MDS_STATE_STANDBY_REPLAY -8 /* up, tailing active node's journal */ | 240 | #define CEPH_MDS_STATE_STANDBY_REPLAY -8 /* up, tailing active node's journal */ |
| 241 | #define CEPH_MDS_STATE_REPLAYONCE -9 /* up, replaying an active node's journal */ | ||
| 236 | 242 | ||
| 237 | #define CEPH_MDS_STATE_REPLAY 8 /* up, replaying journal. */ | 243 | #define CEPH_MDS_STATE_REPLAY 8 /* up, replaying journal. */ |
| 238 | #define CEPH_MDS_STATE_RESOLVE 9 /* up, disambiguating distributed | 244 | #define CEPH_MDS_STATE_RESOLVE 9 /* up, disambiguating distributed |
| @@ -264,6 +270,7 @@ extern const char *ceph_mds_state_name(int s); | |||
| 264 | #define CEPH_LOCK_IXATTR 2048 | 270 | #define CEPH_LOCK_IXATTR 2048 |
| 265 | #define CEPH_LOCK_IFLOCK 4096 /* advisory file locks */ | 271 | #define CEPH_LOCK_IFLOCK 4096 /* advisory file locks */ |
| 266 | #define CEPH_LOCK_INO 8192 /* immutable inode bits; not a lock */ | 272 | #define CEPH_LOCK_INO 8192 /* immutable inode bits; not a lock */ |
| 273 | #define CEPH_LOCK_IPOLICY 16384 /* policy lock on dirs. MDS internal */ | ||
| 267 | 274 | ||
| 268 | /* client_session ops */ | 275 | /* client_session ops */ |
| 269 | enum { | 276 | enum { |
| @@ -338,6 +345,12 @@ extern const char *ceph_mds_op_name(int op); | |||
| 338 | #define CEPH_SETATTR_SIZE 32 | 345 | #define CEPH_SETATTR_SIZE 32 |
| 339 | #define CEPH_SETATTR_CTIME 64 | 346 | #define CEPH_SETATTR_CTIME 64 |
| 340 | 347 | ||
| 348 | /* | ||
| 349 | * Ceph setxattr request flags. | ||
| 350 | */ | ||
| 351 | #define CEPH_XATTR_CREATE 1 | ||
| 352 | #define CEPH_XATTR_REPLACE 2 | ||
| 353 | |||
| 341 | union ceph_mds_request_args { | 354 | union ceph_mds_request_args { |
| 342 | struct { | 355 | struct { |
| 343 | __le32 mask; /* CEPH_CAP_* */ | 356 | __le32 mask; /* CEPH_CAP_* */ |
| @@ -522,14 +535,17 @@ int ceph_flags_to_mode(int flags); | |||
| 522 | #define CEPH_CAP_GWREXTEND 64 /* (file) client can extend EOF */ | 535 | #define CEPH_CAP_GWREXTEND 64 /* (file) client can extend EOF */ |
| 523 | #define CEPH_CAP_GLAZYIO 128 /* (file) client can perform lazy io */ | 536 | #define CEPH_CAP_GLAZYIO 128 /* (file) client can perform lazy io */ |
| 524 | 537 | ||
| 538 | #define CEPH_CAP_SIMPLE_BITS 2 | ||
| 539 | #define CEPH_CAP_FILE_BITS 8 | ||
| 540 | |||
| 525 | /* per-lock shift */ | 541 | /* per-lock shift */ |
| 526 | #define CEPH_CAP_SAUTH 2 | 542 | #define CEPH_CAP_SAUTH 2 |
| 527 | #define CEPH_CAP_SLINK 4 | 543 | #define CEPH_CAP_SLINK 4 |
| 528 | #define CEPH_CAP_SXATTR 6 | 544 | #define CEPH_CAP_SXATTR 6 |
| 529 | #define CEPH_CAP_SFILE 8 | 545 | #define CEPH_CAP_SFILE 8 |
| 530 | #define CEPH_CAP_SFLOCK 20 | 546 | #define CEPH_CAP_SFLOCK 20 |
| 531 | 547 | ||
| 532 | #define CEPH_CAP_BITS 22 | 548 | #define CEPH_CAP_BITS 22 |
| 533 | 549 | ||
| 534 | /* composed values */ | 550 | /* composed values */ |
| 535 | #define CEPH_CAP_AUTH_SHARED (CEPH_CAP_GSHARED << CEPH_CAP_SAUTH) | 551 | #define CEPH_CAP_AUTH_SHARED (CEPH_CAP_GSHARED << CEPH_CAP_SAUTH) |
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 63d092822bad..360d9d08ca9e 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h | |||
| @@ -52,10 +52,10 @@ static inline int ceph_has_room(void **p, void *end, size_t n) | |||
| 52 | return end >= *p && n <= end - *p; | 52 | return end >= *p && n <= end - *p; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | #define ceph_decode_need(p, end, n, bad) \ | 55 | #define ceph_decode_need(p, end, n, bad) \ |
| 56 | do { \ | 56 | do { \ |
| 57 | if (!likely(ceph_has_room(p, end, n))) \ | 57 | if (!likely(ceph_has_room(p, end, n))) \ |
| 58 | goto bad; \ | 58 | goto bad; \ |
| 59 | } while (0) | 59 | } while (0) |
| 60 | 60 | ||
| 61 | #define ceph_decode_64_safe(p, end, v, bad) \ | 61 | #define ceph_decode_64_safe(p, end, v, bad) \ |
| @@ -99,8 +99,8 @@ static inline int ceph_has_room(void **p, void *end, size_t n) | |||
| 99 | * | 99 | * |
| 100 | * There are two possible failures: | 100 | * There are two possible failures: |
| 101 | * - converting the string would require accessing memory at or | 101 | * - converting the string would require accessing memory at or |
| 102 | * beyond the "end" pointer provided (-E | 102 | * beyond the "end" pointer provided (-ERANGE) |
| 103 | * - memory could not be allocated for the result | 103 | * - memory could not be allocated for the result (-ENOMEM) |
| 104 | */ | 104 | */ |
| 105 | static inline char *ceph_extract_encoded_string(void **p, void *end, | 105 | static inline char *ceph_extract_encoded_string(void **p, void *end, |
| 106 | size_t *lenp, gfp_t gfp) | 106 | size_t *lenp, gfp_t gfp) |
| @@ -217,10 +217,10 @@ static inline void ceph_encode_string(void **p, void *end, | |||
| 217 | *p += len; | 217 | *p += len; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | #define ceph_encode_need(p, end, n, bad) \ | 220 | #define ceph_encode_need(p, end, n, bad) \ |
| 221 | do { \ | 221 | do { \ |
| 222 | if (!likely(ceph_has_room(p, end, n))) \ | 222 | if (!likely(ceph_has_room(p, end, n))) \ |
| 223 | goto bad; \ | 223 | goto bad; \ |
| 224 | } while (0) | 224 | } while (0) |
| 225 | 225 | ||
| 226 | #define ceph_encode_64_safe(p, end, v, bad) \ | 226 | #define ceph_encode_64_safe(p, end, v, bad) \ |
| @@ -231,12 +231,17 @@ static inline void ceph_encode_string(void **p, void *end, | |||
| 231 | #define ceph_encode_32_safe(p, end, v, bad) \ | 231 | #define ceph_encode_32_safe(p, end, v, bad) \ |
| 232 | do { \ | 232 | do { \ |
| 233 | ceph_encode_need(p, end, sizeof(u32), bad); \ | 233 | ceph_encode_need(p, end, sizeof(u32), bad); \ |
| 234 | ceph_encode_32(p, v); \ | 234 | ceph_encode_32(p, v); \ |
| 235 | } while (0) | 235 | } while (0) |
| 236 | #define ceph_encode_16_safe(p, end, v, bad) \ | 236 | #define ceph_encode_16_safe(p, end, v, bad) \ |
| 237 | do { \ | 237 | do { \ |
| 238 | ceph_encode_need(p, end, sizeof(u16), bad); \ | 238 | ceph_encode_need(p, end, sizeof(u16), bad); \ |
| 239 | ceph_encode_16(p, v); \ | 239 | ceph_encode_16(p, v); \ |
| 240 | } while (0) | ||
| 241 | #define ceph_encode_8_safe(p, end, v, bad) \ | ||
| 242 | do { \ | ||
| 243 | ceph_encode_need(p, end, sizeof(u8), bad); \ | ||
| 244 | ceph_encode_8(p, v); \ | ||
| 240 | } while (0) | 245 | } while (0) |
| 241 | 246 | ||
| 242 | #define ceph_encode_copy_safe(p, end, pv, n, bad) \ | 247 | #define ceph_encode_copy_safe(p, end, pv, n, bad) \ |
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 084d3c622b12..29818fc3fa49 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
| @@ -193,6 +193,8 @@ static inline int calc_pages_for(u64 off, u64 len) | |||
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | /* ceph_common.c */ | 195 | /* ceph_common.c */ |
| 196 | extern bool libceph_compatible(void *data); | ||
| 197 | |||
| 196 | extern const char *ceph_msg_type_name(int type); | 198 | extern const char *ceph_msg_type_name(int type); |
| 197 | extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); | 199 | extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); |
| 198 | extern struct kmem_cache *ceph_inode_cachep; | 200 | extern struct kmem_cache *ceph_inode_cachep; |
| @@ -220,7 +222,7 @@ extern int ceph_open_session(struct ceph_client *client); | |||
| 220 | /* pagevec.c */ | 222 | /* pagevec.c */ |
| 221 | extern void ceph_release_page_vector(struct page **pages, int num_pages); | 223 | extern void ceph_release_page_vector(struct page **pages, int num_pages); |
| 222 | 224 | ||
| 223 | extern struct page **ceph_get_direct_page_vector(const char __user *data, | 225 | extern struct page **ceph_get_direct_page_vector(const void __user *data, |
| 224 | int num_pages, | 226 | int num_pages, |
| 225 | bool write_page); | 227 | bool write_page); |
| 226 | extern void ceph_put_page_vector(struct page **pages, int num_pages, | 228 | extern void ceph_put_page_vector(struct page **pages, int num_pages, |
| @@ -228,15 +230,15 @@ extern void ceph_put_page_vector(struct page **pages, int num_pages, | |||
| 228 | extern void ceph_release_page_vector(struct page **pages, int num_pages); | 230 | extern void ceph_release_page_vector(struct page **pages, int num_pages); |
| 229 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); | 231 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); |
| 230 | extern int ceph_copy_user_to_page_vector(struct page **pages, | 232 | extern int ceph_copy_user_to_page_vector(struct page **pages, |
| 231 | const char __user *data, | 233 | const void __user *data, |
| 232 | loff_t off, size_t len); | 234 | loff_t off, size_t len); |
| 233 | extern int ceph_copy_to_page_vector(struct page **pages, | 235 | extern void ceph_copy_to_page_vector(struct page **pages, |
| 234 | const char *data, | 236 | const void *data, |
| 235 | loff_t off, size_t len); | 237 | loff_t off, size_t len); |
| 236 | extern int ceph_copy_from_page_vector(struct page **pages, | 238 | extern void ceph_copy_from_page_vector(struct page **pages, |
| 237 | char *data, | 239 | void *data, |
| 238 | loff_t off, size_t len); | 240 | loff_t off, size_t len); |
| 239 | extern int ceph_copy_page_vector_to_user(struct page **pages, char __user *data, | 241 | extern int ceph_copy_page_vector_to_user(struct page **pages, void __user *data, |
| 240 | loff_t off, size_t len); | 242 | loff_t off, size_t len); |
| 241 | extern void ceph_zero_page_vector_range(int off, int len, struct page **pages); | 243 | extern void ceph_zero_page_vector_range(int off, int len, struct page **pages); |
| 242 | 244 | ||
diff --git a/include/linux/ceph/mdsmap.h b/include/linux/ceph/mdsmap.h index cb15b5d867c7..87ed09f54800 100644 --- a/include/linux/ceph/mdsmap.h +++ b/include/linux/ceph/mdsmap.h | |||
| @@ -29,8 +29,8 @@ struct ceph_mdsmap { | |||
| 29 | 29 | ||
| 30 | /* which object pools file data can be stored in */ | 30 | /* which object pools file data can be stored in */ |
| 31 | int m_num_data_pg_pools; | 31 | int m_num_data_pg_pools; |
| 32 | u32 *m_data_pg_pools; | 32 | u64 *m_data_pg_pools; |
| 33 | u32 m_cas_pg_pool; | 33 | u64 m_cas_pg_pool; |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | static inline struct ceph_entity_addr * | 36 | static inline struct ceph_entity_addr * |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 14ba5ee738a9..60903e0f665c 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
| @@ -83,9 +83,11 @@ struct ceph_msg { | |||
| 83 | struct list_head list_head; | 83 | struct list_head list_head; |
| 84 | 84 | ||
| 85 | struct kref kref; | 85 | struct kref kref; |
| 86 | #ifdef CONFIG_BLOCK | ||
| 86 | struct bio *bio; /* instead of pages/pagelist */ | 87 | struct bio *bio; /* instead of pages/pagelist */ |
| 87 | struct bio *bio_iter; /* bio iterator */ | 88 | struct bio *bio_iter; /* bio iterator */ |
| 88 | int bio_seg; /* current bio segment */ | 89 | int bio_seg; /* current bio segment */ |
| 90 | #endif /* CONFIG_BLOCK */ | ||
| 89 | struct ceph_pagelist *trail; /* the trailing part of the data */ | 91 | struct ceph_pagelist *trail; /* the trailing part of the data */ |
| 90 | bool front_is_vmalloc; | 92 | bool front_is_vmalloc; |
| 91 | bool more_to_follow; | 93 | bool more_to_follow; |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index d9b880e977e6..1dd5d466b6f9 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/ceph/osdmap.h> | 10 | #include <linux/ceph/osdmap.h> |
| 11 | #include <linux/ceph/messenger.h> | 11 | #include <linux/ceph/messenger.h> |
| 12 | #include <linux/ceph/auth.h> | 12 | #include <linux/ceph/auth.h> |
| 13 | #include <linux/ceph/pagelist.h> | ||
| 13 | 14 | ||
| 14 | /* | 15 | /* |
| 15 | * Maximum object name size | 16 | * Maximum object name size |
| @@ -22,7 +23,6 @@ struct ceph_snap_context; | |||
| 22 | struct ceph_osd_request; | 23 | struct ceph_osd_request; |
| 23 | struct ceph_osd_client; | 24 | struct ceph_osd_client; |
| 24 | struct ceph_authorizer; | 25 | struct ceph_authorizer; |
| 25 | struct ceph_pagelist; | ||
| 26 | 26 | ||
| 27 | /* | 27 | /* |
| 28 | * completion callback for async writepages | 28 | * completion callback for async writepages |
| @@ -47,6 +47,9 @@ struct ceph_osd { | |||
| 47 | struct list_head o_keepalive_item; | 47 | struct list_head o_keepalive_item; |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | |||
| 51 | #define CEPH_OSD_MAX_OP 10 | ||
| 52 | |||
| 50 | /* an in-flight request */ | 53 | /* an in-flight request */ |
| 51 | struct ceph_osd_request { | 54 | struct ceph_osd_request { |
| 52 | u64 r_tid; /* unique for this client */ | 55 | u64 r_tid; /* unique for this client */ |
| @@ -63,9 +66,23 @@ struct ceph_osd_request { | |||
| 63 | struct ceph_connection *r_con_filling_msg; | 66 | struct ceph_connection *r_con_filling_msg; |
| 64 | 67 | ||
| 65 | struct ceph_msg *r_request, *r_reply; | 68 | struct ceph_msg *r_request, *r_reply; |
| 66 | int r_result; | ||
| 67 | int r_flags; /* any additional flags for the osd */ | 69 | int r_flags; /* any additional flags for the osd */ |
| 68 | u32 r_sent; /* >0 if r_request is sending/sent */ | 70 | u32 r_sent; /* >0 if r_request is sending/sent */ |
| 71 | int r_num_ops; | ||
| 72 | |||
| 73 | /* encoded message content */ | ||
| 74 | struct ceph_osd_op *r_request_ops; | ||
| 75 | /* these are updated on each send */ | ||
| 76 | __le32 *r_request_osdmap_epoch; | ||
| 77 | __le32 *r_request_flags; | ||
| 78 | __le64 *r_request_pool; | ||
| 79 | void *r_request_pgid; | ||
| 80 | __le32 *r_request_attempts; | ||
| 81 | struct ceph_eversion *r_request_reassert_version; | ||
| 82 | |||
| 83 | int r_result; | ||
| 84 | int r_reply_op_len[CEPH_OSD_MAX_OP]; | ||
| 85 | s32 r_reply_op_result[CEPH_OSD_MAX_OP]; | ||
| 69 | int r_got_reply; | 86 | int r_got_reply; |
| 70 | int r_linger; | 87 | int r_linger; |
| 71 | 88 | ||
| @@ -82,6 +99,7 @@ struct ceph_osd_request { | |||
| 82 | 99 | ||
| 83 | char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */ | 100 | char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */ |
| 84 | int r_oid_len; | 101 | int r_oid_len; |
| 102 | u64 r_snapid; | ||
| 85 | unsigned long r_stamp; /* send OR check time */ | 103 | unsigned long r_stamp; /* send OR check time */ |
| 86 | 104 | ||
| 87 | struct ceph_file_layout r_file_layout; | 105 | struct ceph_file_layout r_file_layout; |
| @@ -95,7 +113,7 @@ struct ceph_osd_request { | |||
| 95 | struct bio *r_bio; /* instead of pages */ | 113 | struct bio *r_bio; /* instead of pages */ |
| 96 | #endif | 114 | #endif |
| 97 | 115 | ||
| 98 | struct ceph_pagelist *r_trail; /* trailing part of the data */ | 116 | struct ceph_pagelist r_trail; /* trailing part of the data */ |
| 99 | }; | 117 | }; |
| 100 | 118 | ||
| 101 | struct ceph_osd_event { | 119 | struct ceph_osd_event { |
| @@ -107,7 +125,6 @@ struct ceph_osd_event { | |||
| 107 | struct rb_node node; | 125 | struct rb_node node; |
| 108 | struct list_head osd_node; | 126 | struct list_head osd_node; |
| 109 | struct kref kref; | 127 | struct kref kref; |
| 110 | struct completion completion; | ||
| 111 | }; | 128 | }; |
| 112 | 129 | ||
| 113 | struct ceph_osd_event_work { | 130 | struct ceph_osd_event_work { |
| @@ -157,7 +174,7 @@ struct ceph_osd_client { | |||
| 157 | 174 | ||
| 158 | struct ceph_osd_req_op { | 175 | struct ceph_osd_req_op { |
| 159 | u16 op; /* CEPH_OSD_OP_* */ | 176 | u16 op; /* CEPH_OSD_OP_* */ |
| 160 | u32 flags; /* CEPH_OSD_FLAG_* */ | 177 | u32 payload_len; |
| 161 | union { | 178 | union { |
| 162 | struct { | 179 | struct { |
| 163 | u64 offset, length; | 180 | u64 offset, length; |
| @@ -166,23 +183,24 @@ struct ceph_osd_req_op { | |||
| 166 | } extent; | 183 | } extent; |
| 167 | struct { | 184 | struct { |
| 168 | const char *name; | 185 | const char *name; |
| 169 | u32 name_len; | ||
| 170 | const char *val; | 186 | const char *val; |
| 187 | u32 name_len; | ||
| 171 | u32 value_len; | 188 | u32 value_len; |
| 172 | __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ | 189 | __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ |
| 173 | __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ | 190 | __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ |
| 174 | } xattr; | 191 | } xattr; |
| 175 | struct { | 192 | struct { |
| 176 | const char *class_name; | 193 | const char *class_name; |
| 177 | __u8 class_len; | ||
| 178 | const char *method_name; | 194 | const char *method_name; |
| 179 | __u8 method_len; | ||
| 180 | __u8 argc; | ||
| 181 | const char *indata; | 195 | const char *indata; |
| 182 | u32 indata_len; | 196 | u32 indata_len; |
| 197 | __u8 class_len; | ||
| 198 | __u8 method_len; | ||
| 199 | __u8 argc; | ||
| 183 | } cls; | 200 | } cls; |
| 184 | struct { | 201 | struct { |
| 185 | u64 cookie, count; | 202 | u64 cookie; |
| 203 | u64 count; | ||
| 186 | } pgls; | 204 | } pgls; |
| 187 | struct { | 205 | struct { |
| 188 | u64 snapid; | 206 | u64 snapid; |
| @@ -190,12 +208,11 @@ struct ceph_osd_req_op { | |||
| 190 | struct { | 208 | struct { |
| 191 | u64 cookie; | 209 | u64 cookie; |
| 192 | u64 ver; | 210 | u64 ver; |
| 193 | __u8 flag; | ||
| 194 | u32 prot_ver; | 211 | u32 prot_ver; |
| 195 | u32 timeout; | 212 | u32 timeout; |
| 213 | __u8 flag; | ||
| 196 | } watch; | 214 | } watch; |
| 197 | }; | 215 | }; |
| 198 | u32 payload_len; | ||
| 199 | }; | 216 | }; |
| 200 | 217 | ||
| 201 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, | 218 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, |
| @@ -207,29 +224,19 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, | |||
| 207 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, | 224 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, |
| 208 | struct ceph_msg *msg); | 225 | struct ceph_msg *msg); |
| 209 | 226 | ||
| 210 | extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc, | ||
| 211 | struct ceph_file_layout *layout, | ||
| 212 | u64 snapid, | ||
| 213 | u64 off, u64 *plen, u64 *bno, | ||
| 214 | struct ceph_osd_request *req, | ||
| 215 | struct ceph_osd_req_op *op); | ||
| 216 | |||
| 217 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, | 227 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, |
| 218 | int flags, | ||
| 219 | struct ceph_snap_context *snapc, | 228 | struct ceph_snap_context *snapc, |
| 220 | struct ceph_osd_req_op *ops, | 229 | unsigned int num_op, |
| 221 | bool use_mempool, | 230 | bool use_mempool, |
| 222 | gfp_t gfp_flags, | 231 | gfp_t gfp_flags); |
| 223 | struct page **pages, | ||
| 224 | struct bio *bio); | ||
| 225 | 232 | ||
| 226 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, | 233 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, |
| 227 | u64 off, u64 *plen, | 234 | u64 off, u64 len, |
| 235 | unsigned int num_op, | ||
| 228 | struct ceph_osd_req_op *src_ops, | 236 | struct ceph_osd_req_op *src_ops, |
| 229 | struct ceph_snap_context *snapc, | 237 | struct ceph_snap_context *snapc, |
| 230 | struct timespec *mtime, | 238 | u64 snap_id, |
| 231 | const char *oid, | 239 | struct timespec *mtime); |
| 232 | int oid_len); | ||
| 233 | 240 | ||
| 234 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | 241 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, |
| 235 | struct ceph_file_layout *layout, | 242 | struct ceph_file_layout *layout, |
| @@ -239,8 +246,7 @@ extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | |||
| 239 | int do_sync, u32 truncate_seq, | 246 | int do_sync, u32 truncate_seq, |
| 240 | u64 truncate_size, | 247 | u64 truncate_size, |
| 241 | struct timespec *mtime, | 248 | struct timespec *mtime, |
| 242 | bool use_mempool, int num_reply, | 249 | bool use_mempool, int page_align); |
| 243 | int page_align); | ||
| 244 | 250 | ||
| 245 | extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc, | 251 | extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc, |
| 246 | struct ceph_osd_request *req); | 252 | struct ceph_osd_request *req); |
| @@ -279,17 +285,13 @@ extern int ceph_osdc_writepages(struct ceph_osd_client *osdc, | |||
| 279 | u64 off, u64 len, | 285 | u64 off, u64 len, |
| 280 | u32 truncate_seq, u64 truncate_size, | 286 | u32 truncate_seq, u64 truncate_size, |
| 281 | struct timespec *mtime, | 287 | struct timespec *mtime, |
| 282 | struct page **pages, int nr_pages, | 288 | struct page **pages, int nr_pages); |
| 283 | int flags, int do_sync, bool nofail); | ||
| 284 | 289 | ||
| 285 | /* watch/notify events */ | 290 | /* watch/notify events */ |
| 286 | extern int ceph_osdc_create_event(struct ceph_osd_client *osdc, | 291 | extern int ceph_osdc_create_event(struct ceph_osd_client *osdc, |
| 287 | void (*event_cb)(u64, u64, u8, void *), | 292 | void (*event_cb)(u64, u64, u8, void *), |
| 288 | int one_shot, void *data, | 293 | void *data, struct ceph_osd_event **pevent); |
| 289 | struct ceph_osd_event **pevent); | ||
| 290 | extern void ceph_osdc_cancel_event(struct ceph_osd_event *event); | 294 | extern void ceph_osdc_cancel_event(struct ceph_osd_event *event); |
| 291 | extern int ceph_osdc_wait_event(struct ceph_osd_event *event, | ||
| 292 | unsigned long timeout); | ||
| 293 | extern void ceph_osdc_put_event(struct ceph_osd_event *event); | 295 | extern void ceph_osdc_put_event(struct ceph_osd_event *event); |
| 294 | #endif | 296 | #endif |
| 295 | 297 | ||
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index 10a417f9f76f..c819190d1642 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
| @@ -18,14 +18,31 @@ | |||
| 18 | * The map can be updated either via an incremental map (diff) describing | 18 | * The map can be updated either via an incremental map (diff) describing |
| 19 | * the change between two successive epochs, or as a fully encoded map. | 19 | * the change between two successive epochs, or as a fully encoded map. |
| 20 | */ | 20 | */ |
| 21 | struct ceph_pg { | ||
| 22 | uint64_t pool; | ||
| 23 | uint32_t seed; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #define CEPH_POOL_FLAG_HASHPSPOOL 1 | ||
| 27 | |||
| 21 | struct ceph_pg_pool_info { | 28 | struct ceph_pg_pool_info { |
| 22 | struct rb_node node; | 29 | struct rb_node node; |
| 23 | int id; | 30 | s64 id; |
| 24 | struct ceph_pg_pool v; | 31 | u8 type; |
| 25 | int pg_num_mask, pgp_num_mask, lpg_num_mask, lpgp_num_mask; | 32 | u8 size; |
| 33 | u8 crush_ruleset; | ||
| 34 | u8 object_hash; | ||
| 35 | u32 pg_num, pgp_num; | ||
| 36 | int pg_num_mask, pgp_num_mask; | ||
| 37 | u64 flags; | ||
| 26 | char *name; | 38 | char *name; |
| 27 | }; | 39 | }; |
| 28 | 40 | ||
| 41 | struct ceph_object_locator { | ||
| 42 | uint64_t pool; | ||
| 43 | char *key; | ||
| 44 | }; | ||
| 45 | |||
| 29 | struct ceph_pg_mapping { | 46 | struct ceph_pg_mapping { |
| 30 | struct rb_node node; | 47 | struct rb_node node; |
| 31 | struct ceph_pg pgid; | 48 | struct ceph_pg pgid; |
| @@ -110,15 +127,16 @@ extern void ceph_osdmap_destroy(struct ceph_osdmap *map); | |||
| 110 | 127 | ||
| 111 | /* calculate mapping of a file extent to an object */ | 128 | /* calculate mapping of a file extent to an object */ |
| 112 | extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout, | 129 | extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout, |
| 113 | u64 off, u64 *plen, | 130 | u64 off, u64 len, |
| 114 | u64 *bno, u64 *oxoff, u64 *oxlen); | 131 | u64 *bno, u64 *oxoff, u64 *oxlen); |
| 115 | 132 | ||
| 116 | /* calculate mapping of object to a placement group */ | 133 | /* calculate mapping of object to a placement group */ |
| 117 | extern int ceph_calc_object_layout(struct ceph_object_layout *ol, | 134 | extern int ceph_calc_object_layout(struct ceph_pg *pg, |
| 118 | const char *oid, | 135 | const char *oid, |
| 119 | struct ceph_file_layout *fl, | 136 | struct ceph_file_layout *fl, |
| 120 | struct ceph_osdmap *osdmap); | 137 | struct ceph_osdmap *osdmap); |
| 121 | extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, struct ceph_pg pgid, | 138 | extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, |
| 139 | struct ceph_pg pgid, | ||
| 122 | int *acting); | 140 | int *acting); |
| 123 | extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, | 141 | extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, |
| 124 | struct ceph_pg pgid); | 142 | struct ceph_pg pgid); |
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h index 2c04afeead1c..68c96a508ac2 100644 --- a/include/linux/ceph/rados.h +++ b/include/linux/ceph/rados.h | |||
| @@ -9,14 +9,6 @@ | |||
| 9 | #include <linux/ceph/msgr.h> | 9 | #include <linux/ceph/msgr.h> |
| 10 | 10 | ||
| 11 | /* | 11 | /* |
| 12 | * osdmap encoding versions | ||
| 13 | */ | ||
| 14 | #define CEPH_OSDMAP_INC_VERSION 5 | ||
| 15 | #define CEPH_OSDMAP_INC_VERSION_EXT 6 | ||
| 16 | #define CEPH_OSDMAP_VERSION 5 | ||
| 17 | #define CEPH_OSDMAP_VERSION_EXT 6 | ||
| 18 | |||
| 19 | /* | ||
| 20 | * fs id | 12 | * fs id |
| 21 | */ | 13 | */ |
| 22 | struct ceph_fsid { | 14 | struct ceph_fsid { |
| @@ -64,7 +56,7 @@ struct ceph_timespec { | |||
| 64 | * placement group. | 56 | * placement group. |
| 65 | * we encode this into one __le64. | 57 | * we encode this into one __le64. |
| 66 | */ | 58 | */ |
| 67 | struct ceph_pg { | 59 | struct ceph_pg_v1 { |
| 68 | __le16 preferred; /* preferred primary osd */ | 60 | __le16 preferred; /* preferred primary osd */ |
| 69 | __le16 ps; /* placement seed */ | 61 | __le16 ps; /* placement seed */ |
| 70 | __le32 pool; /* object pool */ | 62 | __le32 pool; /* object pool */ |
| @@ -91,21 +83,6 @@ struct ceph_pg { | |||
| 91 | 83 | ||
| 92 | #define CEPH_PG_TYPE_REP 1 | 84 | #define CEPH_PG_TYPE_REP 1 |
| 93 | #define CEPH_PG_TYPE_RAID4 2 | 85 | #define CEPH_PG_TYPE_RAID4 2 |
| 94 | #define CEPH_PG_POOL_VERSION 2 | ||
| 95 | struct ceph_pg_pool { | ||
| 96 | __u8 type; /* CEPH_PG_TYPE_* */ | ||
| 97 | __u8 size; /* number of osds in each pg */ | ||
| 98 | __u8 crush_ruleset; /* crush placement rule */ | ||
| 99 | __u8 object_hash; /* hash mapping object name to ps */ | ||
| 100 | __le32 pg_num, pgp_num; /* number of pg's */ | ||
| 101 | __le32 lpg_num, lpgp_num; /* number of localized pg's */ | ||
| 102 | __le32 last_change; /* most recent epoch changed */ | ||
| 103 | __le64 snap_seq; /* seq for per-pool snapshot */ | ||
| 104 | __le32 snap_epoch; /* epoch of last snap */ | ||
| 105 | __le32 num_snaps; | ||
| 106 | __le32 num_removed_snap_intervals; /* if non-empty, NO per-pool snaps */ | ||
| 107 | __le64 auid; /* who owns the pg */ | ||
| 108 | } __attribute__ ((packed)); | ||
| 109 | 86 | ||
| 110 | /* | 87 | /* |
| 111 | * stable_mod func is used to control number of placement groups. | 88 | * stable_mod func is used to control number of placement groups. |
| @@ -128,7 +105,7 @@ static inline int ceph_stable_mod(int x, int b, int bmask) | |||
| 128 | * object layout - how a given object should be stored. | 105 | * object layout - how a given object should be stored. |
| 129 | */ | 106 | */ |
| 130 | struct ceph_object_layout { | 107 | struct ceph_object_layout { |
| 131 | struct ceph_pg ol_pgid; /* raw pg, with _full_ ps precision. */ | 108 | struct ceph_pg_v1 ol_pgid; /* raw pg, with _full_ ps precision. */ |
| 132 | __le32 ol_stripe_unit; /* for per-object parity, if any */ | 109 | __le32 ol_stripe_unit; /* for per-object parity, if any */ |
| 133 | } __attribute__ ((packed)); | 110 | } __attribute__ ((packed)); |
| 134 | 111 | ||
| @@ -145,8 +122,12 @@ struct ceph_eversion { | |||
| 145 | */ | 122 | */ |
| 146 | 123 | ||
| 147 | /* status bits */ | 124 | /* status bits */ |
| 148 | #define CEPH_OSD_EXISTS 1 | 125 | #define CEPH_OSD_EXISTS (1<<0) |
| 149 | #define CEPH_OSD_UP 2 | 126 | #define CEPH_OSD_UP (1<<1) |
| 127 | #define CEPH_OSD_AUTOOUT (1<<2) /* osd was automatically marked out */ | ||
| 128 | #define CEPH_OSD_NEW (1<<3) /* osd is new, never marked in */ | ||
| 129 | |||
| 130 | extern const char *ceph_osd_state_name(int s); | ||
| 150 | 131 | ||
| 151 | /* osd weights. fixed point value: 0x10000 == 1.0 ("in"), 0 == "out" */ | 132 | /* osd weights. fixed point value: 0x10000 == 1.0 ("in"), 0 == "out" */ |
| 152 | #define CEPH_OSD_IN 0x10000 | 133 | #define CEPH_OSD_IN 0x10000 |
| @@ -161,9 +142,25 @@ struct ceph_eversion { | |||
| 161 | #define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */ | 142 | #define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */ |
| 162 | #define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */ | 143 | #define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */ |
| 163 | #define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */ | 144 | #define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */ |
| 145 | #define CEPH_OSDMAP_NOUP (1<<5) /* block osd boot */ | ||
| 146 | #define CEPH_OSDMAP_NODOWN (1<<6) /* block osd mark-down/failure */ | ||
| 147 | #define CEPH_OSDMAP_NOOUT (1<<7) /* block osd auto mark-out */ | ||
| 148 | #define CEPH_OSDMAP_NOIN (1<<8) /* block osd auto mark-in */ | ||
| 149 | #define CEPH_OSDMAP_NOBACKFILL (1<<9) /* block osd backfill */ | ||
| 150 | #define CEPH_OSDMAP_NORECOVER (1<<10) /* block osd recovery and backfill */ | ||
| 151 | |||
| 152 | /* | ||
| 153 | * The error code to return when an OSD can't handle a write | ||
| 154 | * because it is too large. | ||
| 155 | */ | ||
| 156 | #define OSD_WRITETOOBIG EMSGSIZE | ||
| 164 | 157 | ||
| 165 | /* | 158 | /* |
| 166 | * osd ops | 159 | * osd ops |
| 160 | * | ||
| 161 | * WARNING: do not use these op codes directly. Use the helpers | ||
| 162 | * defined below instead. In certain cases, op code behavior was | ||
| 163 | * redefined, resulting in special-cases in the helpers. | ||
| 167 | */ | 164 | */ |
| 168 | #define CEPH_OSD_OP_MODE 0xf000 | 165 | #define CEPH_OSD_OP_MODE 0xf000 |
| 169 | #define CEPH_OSD_OP_MODE_RD 0x1000 | 166 | #define CEPH_OSD_OP_MODE_RD 0x1000 |
| @@ -177,6 +174,7 @@ struct ceph_eversion { | |||
| 177 | #define CEPH_OSD_OP_TYPE_ATTR 0x0300 | 174 | #define CEPH_OSD_OP_TYPE_ATTR 0x0300 |
| 178 | #define CEPH_OSD_OP_TYPE_EXEC 0x0400 | 175 | #define CEPH_OSD_OP_TYPE_EXEC 0x0400 |
| 179 | #define CEPH_OSD_OP_TYPE_PG 0x0500 | 176 | #define CEPH_OSD_OP_TYPE_PG 0x0500 |
| 177 | #define CEPH_OSD_OP_TYPE_MULTI 0x0600 /* multiobject */ | ||
| 180 | 178 | ||
| 181 | enum { | 179 | enum { |
| 182 | /** data **/ | 180 | /** data **/ |
| @@ -217,6 +215,23 @@ enum { | |||
| 217 | 215 | ||
| 218 | CEPH_OSD_OP_WATCH = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 15, | 216 | CEPH_OSD_OP_WATCH = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 15, |
| 219 | 217 | ||
| 218 | /* omap */ | ||
| 219 | CEPH_OSD_OP_OMAPGETKEYS = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 17, | ||
| 220 | CEPH_OSD_OP_OMAPGETVALS = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 18, | ||
| 221 | CEPH_OSD_OP_OMAPGETHEADER = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 19, | ||
| 222 | CEPH_OSD_OP_OMAPGETVALSBYKEYS = | ||
| 223 | CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 20, | ||
| 224 | CEPH_OSD_OP_OMAPSETVALS = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 21, | ||
| 225 | CEPH_OSD_OP_OMAPSETHEADER = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 22, | ||
| 226 | CEPH_OSD_OP_OMAPCLEAR = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 23, | ||
| 227 | CEPH_OSD_OP_OMAPRMKEYS = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 24, | ||
| 228 | CEPH_OSD_OP_OMAP_CMP = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 25, | ||
| 229 | |||
| 230 | /** multi **/ | ||
| 231 | CEPH_OSD_OP_CLONERANGE = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_MULTI | 1, | ||
| 232 | CEPH_OSD_OP_ASSERT_SRC_VERSION = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_MULTI | 2, | ||
| 233 | CEPH_OSD_OP_SRC_CMPXATTR = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_MULTI | 3, | ||
| 234 | |||
| 220 | /** attrs **/ | 235 | /** attrs **/ |
| 221 | /* read */ | 236 | /* read */ |
| 222 | CEPH_OSD_OP_GETXATTR = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_ATTR | 1, | 237 | CEPH_OSD_OP_GETXATTR = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_ATTR | 1, |
| @@ -238,6 +253,7 @@ enum { | |||
| 238 | CEPH_OSD_OP_SCRUB_RESERVE = CEPH_OSD_OP_MODE_SUB | 6, | 253 | CEPH_OSD_OP_SCRUB_RESERVE = CEPH_OSD_OP_MODE_SUB | 6, |
| 239 | CEPH_OSD_OP_SCRUB_UNRESERVE = CEPH_OSD_OP_MODE_SUB | 7, | 254 | CEPH_OSD_OP_SCRUB_UNRESERVE = CEPH_OSD_OP_MODE_SUB | 7, |
| 240 | CEPH_OSD_OP_SCRUB_STOP = CEPH_OSD_OP_MODE_SUB | 8, | 255 | CEPH_OSD_OP_SCRUB_STOP = CEPH_OSD_OP_MODE_SUB | 8, |
| 256 | CEPH_OSD_OP_SCRUB_MAP = CEPH_OSD_OP_MODE_SUB | 9, | ||
| 241 | 257 | ||
| 242 | /** lock **/ | 258 | /** lock **/ |
| 243 | CEPH_OSD_OP_WRLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 1, | 259 | CEPH_OSD_OP_WRLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 1, |
| @@ -248,10 +264,12 @@ enum { | |||
| 248 | CEPH_OSD_OP_DNLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 6, | 264 | CEPH_OSD_OP_DNLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 6, |
| 249 | 265 | ||
| 250 | /** exec **/ | 266 | /** exec **/ |
| 267 | /* note: the RD bit here is wrong; see special-case below in helper */ | ||
| 251 | CEPH_OSD_OP_CALL = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_EXEC | 1, | 268 | CEPH_OSD_OP_CALL = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_EXEC | 1, |
| 252 | 269 | ||
| 253 | /** pg **/ | 270 | /** pg **/ |
| 254 | CEPH_OSD_OP_PGLS = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_PG | 1, | 271 | CEPH_OSD_OP_PGLS = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_PG | 1, |
| 272 | CEPH_OSD_OP_PGLS_FILTER = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_PG | 2, | ||
| 255 | }; | 273 | }; |
| 256 | 274 | ||
| 257 | static inline int ceph_osd_op_type_lock(int op) | 275 | static inline int ceph_osd_op_type_lock(int op) |
| @@ -274,6 +292,10 @@ static inline int ceph_osd_op_type_pg(int op) | |||
| 274 | { | 292 | { |
| 275 | return (op & CEPH_OSD_OP_TYPE) == CEPH_OSD_OP_TYPE_PG; | 293 | return (op & CEPH_OSD_OP_TYPE) == CEPH_OSD_OP_TYPE_PG; |
| 276 | } | 294 | } |
| 295 | static inline int ceph_osd_op_type_multi(int op) | ||
| 296 | { | ||
| 297 | return (op & CEPH_OSD_OP_TYPE) == CEPH_OSD_OP_TYPE_MULTI; | ||
| 298 | } | ||
| 277 | 299 | ||
| 278 | static inline int ceph_osd_op_mode_subop(int op) | 300 | static inline int ceph_osd_op_mode_subop(int op) |
| 279 | { | 301 | { |
| @@ -281,11 +303,12 @@ static inline int ceph_osd_op_mode_subop(int op) | |||
| 281 | } | 303 | } |
| 282 | static inline int ceph_osd_op_mode_read(int op) | 304 | static inline int ceph_osd_op_mode_read(int op) |
| 283 | { | 305 | { |
| 284 | return (op & CEPH_OSD_OP_MODE) == CEPH_OSD_OP_MODE_RD; | 306 | return (op & CEPH_OSD_OP_MODE_RD) && |
| 307 | op != CEPH_OSD_OP_CALL; | ||
| 285 | } | 308 | } |
| 286 | static inline int ceph_osd_op_mode_modify(int op) | 309 | static inline int ceph_osd_op_mode_modify(int op) |
| 287 | { | 310 | { |
| 288 | return (op & CEPH_OSD_OP_MODE) == CEPH_OSD_OP_MODE_WR; | 311 | return op & CEPH_OSD_OP_MODE_WR; |
| 289 | } | 312 | } |
| 290 | 313 | ||
| 291 | /* | 314 | /* |
| @@ -294,34 +317,38 @@ static inline int ceph_osd_op_mode_modify(int op) | |||
| 294 | */ | 317 | */ |
| 295 | #define CEPH_OSD_TMAP_HDR 'h' | 318 | #define CEPH_OSD_TMAP_HDR 'h' |
| 296 | #define CEPH_OSD_TMAP_SET 's' | 319 | #define CEPH_OSD_TMAP_SET 's' |
| 320 | #define CEPH_OSD_TMAP_CREATE 'c' /* create key */ | ||
| 297 | #define CEPH_OSD_TMAP_RM 'r' | 321 | #define CEPH_OSD_TMAP_RM 'r' |
| 322 | #define CEPH_OSD_TMAP_RMSLOPPY 'R' | ||
| 298 | 323 | ||
| 299 | extern const char *ceph_osd_op_name(int op); | 324 | extern const char *ceph_osd_op_name(int op); |
| 300 | 325 | ||
| 301 | |||
| 302 | /* | 326 | /* |
| 303 | * osd op flags | 327 | * osd op flags |
| 304 | * | 328 | * |
| 305 | * An op may be READ, WRITE, or READ|WRITE. | 329 | * An op may be READ, WRITE, or READ|WRITE. |
| 306 | */ | 330 | */ |
| 307 | enum { | 331 | enum { |
| 308 | CEPH_OSD_FLAG_ACK = 1, /* want (or is) "ack" ack */ | 332 | CEPH_OSD_FLAG_ACK = 0x0001, /* want (or is) "ack" ack */ |
| 309 | CEPH_OSD_FLAG_ONNVRAM = 2, /* want (or is) "onnvram" ack */ | 333 | CEPH_OSD_FLAG_ONNVRAM = 0x0002, /* want (or is) "onnvram" ack */ |
| 310 | CEPH_OSD_FLAG_ONDISK = 4, /* want (or is) "ondisk" ack */ | 334 | CEPH_OSD_FLAG_ONDISK = 0x0004, /* want (or is) "ondisk" ack */ |
| 311 | CEPH_OSD_FLAG_RETRY = 8, /* resend attempt */ | 335 | CEPH_OSD_FLAG_RETRY = 0x0008, /* resend attempt */ |
| 312 | CEPH_OSD_FLAG_READ = 16, /* op may read */ | 336 | CEPH_OSD_FLAG_READ = 0x0010, /* op may read */ |
| 313 | CEPH_OSD_FLAG_WRITE = 32, /* op may write */ | 337 | CEPH_OSD_FLAG_WRITE = 0x0020, /* op may write */ |
| 314 | CEPH_OSD_FLAG_ORDERSNAP = 64, /* EOLDSNAP if snapc is out of order */ | 338 | CEPH_OSD_FLAG_ORDERSNAP = 0x0040, /* EOLDSNAP if snapc is out of order */ |
| 315 | CEPH_OSD_FLAG_PEERSTAT = 128, /* msg includes osd_peer_stat */ | 339 | CEPH_OSD_FLAG_PEERSTAT_OLD = 0x0080, /* DEPRECATED msg includes osd_peer_stat */ |
| 316 | CEPH_OSD_FLAG_BALANCE_READS = 256, | 340 | CEPH_OSD_FLAG_BALANCE_READS = 0x0100, |
| 317 | CEPH_OSD_FLAG_PARALLELEXEC = 512, /* execute op in parallel */ | 341 | CEPH_OSD_FLAG_PARALLELEXEC = 0x0200, /* execute op in parallel */ |
| 318 | CEPH_OSD_FLAG_PGOP = 1024, /* pg op, no object */ | 342 | CEPH_OSD_FLAG_PGOP = 0x0400, /* pg op, no object */ |
| 319 | CEPH_OSD_FLAG_EXEC = 2048, /* op may exec */ | 343 | CEPH_OSD_FLAG_EXEC = 0x0800, /* op may exec */ |
| 320 | CEPH_OSD_FLAG_EXEC_PUBLIC = 4096, /* op may exec (public) */ | 344 | CEPH_OSD_FLAG_EXEC_PUBLIC = 0x1000, /* DEPRECATED op may exec (public) */ |
| 345 | CEPH_OSD_FLAG_LOCALIZE_READS = 0x2000, /* read from nearby replica, if any */ | ||
| 346 | CEPH_OSD_FLAG_RWORDERED = 0x4000, /* order wrt concurrent reads */ | ||
| 321 | }; | 347 | }; |
| 322 | 348 | ||
| 323 | enum { | 349 | enum { |
| 324 | CEPH_OSD_OP_FLAG_EXCL = 1, /* EXCL object create */ | 350 | CEPH_OSD_OP_FLAG_EXCL = 1, /* EXCL object create */ |
| 351 | CEPH_OSD_OP_FLAG_FAILOK = 2, /* continue despite failure */ | ||
| 325 | }; | 352 | }; |
| 326 | 353 | ||
| 327 | #define EOLDSNAPC ERESTART /* ORDERSNAP flag set; writer has old snapc*/ | 354 | #define EOLDSNAPC ERESTART /* ORDERSNAP flag set; writer has old snapc*/ |
| @@ -381,48 +408,13 @@ struct ceph_osd_op { | |||
| 381 | __le64 ver; | 408 | __le64 ver; |
| 382 | __u8 flag; /* 0 = unwatch, 1 = watch */ | 409 | __u8 flag; /* 0 = unwatch, 1 = watch */ |
| 383 | } __attribute__ ((packed)) watch; | 410 | } __attribute__ ((packed)) watch; |
| 384 | }; | 411 | struct { |
| 412 | __le64 offset, length; | ||
| 413 | __le64 src_offset; | ||
| 414 | } __attribute__ ((packed)) clonerange; | ||
| 415 | }; | ||
| 385 | __le32 payload_len; | 416 | __le32 payload_len; |
| 386 | } __attribute__ ((packed)); | 417 | } __attribute__ ((packed)); |
| 387 | 418 | ||
| 388 | /* | ||
| 389 | * osd request message header. each request may include multiple | ||
| 390 | * ceph_osd_op object operations. | ||
| 391 | */ | ||
| 392 | struct ceph_osd_request_head { | ||
| 393 | __le32 client_inc; /* client incarnation */ | ||
| 394 | struct ceph_object_layout layout; /* pgid */ | ||
| 395 | __le32 osdmap_epoch; /* client's osdmap epoch */ | ||
| 396 | |||
| 397 | __le32 flags; | ||
| 398 | |||
| 399 | struct ceph_timespec mtime; /* for mutations only */ | ||
| 400 | struct ceph_eversion reassert_version; /* if we are replaying op */ | ||
| 401 | |||
| 402 | __le32 object_len; /* length of object name */ | ||
| 403 | |||
| 404 | __le64 snapid; /* snapid to read */ | ||
| 405 | __le64 snap_seq; /* writer's snap context */ | ||
| 406 | __le32 num_snaps; | ||
| 407 | |||
| 408 | __le16 num_ops; | ||
| 409 | struct ceph_osd_op ops[]; /* followed by ops[], obj, ticket, snaps */ | ||
| 410 | } __attribute__ ((packed)); | ||
| 411 | |||
| 412 | struct ceph_osd_reply_head { | ||
| 413 | __le32 client_inc; /* client incarnation */ | ||
| 414 | __le32 flags; | ||
| 415 | struct ceph_object_layout layout; | ||
| 416 | __le32 osdmap_epoch; | ||
| 417 | struct ceph_eversion reassert_version; /* for replaying uncommitted */ | ||
| 418 | |||
| 419 | __le32 result; /* result code */ | ||
| 420 | |||
| 421 | __le32 object_len; /* length of object name */ | ||
| 422 | __le32 num_ops; | ||
| 423 | struct ceph_osd_op ops[0]; /* ops[], object */ | ||
| 424 | } __attribute__ ((packed)); | ||
| 425 | |||
| 426 | |||
| 427 | 419 | ||
| 428 | #endif | 420 | #endif |
diff --git a/include/linux/compat.h b/include/linux/compat.h index de095b0462a7..76a87fb57ac2 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -359,6 +359,7 @@ asmlinkage ssize_t compat_sys_preadv(unsigned long fd, | |||
| 359 | asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, | 359 | asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, |
| 360 | const struct compat_iovec __user *vec, | 360 | const struct compat_iovec __user *vec, |
| 361 | unsigned long vlen, u32 pos_low, u32 pos_high); | 361 | unsigned long vlen, u32 pos_low, u32 pos_high); |
| 362 | asmlinkage long comat_sys_lseek(unsigned int, compat_off_t, unsigned int); | ||
| 362 | 363 | ||
| 363 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, | 364 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, |
| 364 | const compat_uptr_t __user *envp); | 365 | const compat_uptr_t __user *envp); |
| @@ -535,6 +536,8 @@ asmlinkage long compat_sys_openat(int dfd, const char __user *filename, | |||
| 535 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, | 536 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, |
| 536 | struct file_handle __user *handle, | 537 | struct file_handle __user *handle, |
| 537 | int flags); | 538 | int flags); |
| 539 | asmlinkage long compat_sys_truncate(const char __user *, compat_off_t); | ||
| 540 | asmlinkage long compat_sys_ftruncate(unsigned int, compat_ulong_t); | ||
| 538 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, | 541 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, |
| 539 | compat_ulong_t __user *outp, | 542 | compat_ulong_t __user *outp, |
| 540 | compat_ulong_t __user *exp, | 543 | compat_ulong_t __user *exp, |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 51494e6b5548..33f0280fd533 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
| @@ -77,10 +77,13 @@ static inline void init_completion(struct completion *x) | |||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | extern void wait_for_completion(struct completion *); | 79 | extern void wait_for_completion(struct completion *); |
| 80 | extern void wait_for_completion_io(struct completion *); | ||
| 80 | extern int wait_for_completion_interruptible(struct completion *x); | 81 | extern int wait_for_completion_interruptible(struct completion *x); |
| 81 | extern int wait_for_completion_killable(struct completion *x); | 82 | extern int wait_for_completion_killable(struct completion *x); |
| 82 | extern unsigned long wait_for_completion_timeout(struct completion *x, | 83 | extern unsigned long wait_for_completion_timeout(struct completion *x, |
| 83 | unsigned long timeout); | 84 | unsigned long timeout); |
| 85 | extern unsigned long wait_for_completion_io_timeout(struct completion *x, | ||
| 86 | unsigned long timeout); | ||
| 84 | extern long wait_for_completion_interruptible_timeout( | 87 | extern long wait_for_completion_interruptible_timeout( |
| 85 | struct completion *x, unsigned long timeout); | 88 | struct completion *x, unsigned long timeout); |
| 86 | extern long wait_for_completion_killable_timeout( | 89 | extern long wait_for_completion_killable_timeout( |
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h index 25baa287cff7..6a1101f24cfb 100644 --- a/include/linux/crush/crush.h +++ b/include/linux/crush/crush.h | |||
| @@ -162,6 +162,8 @@ struct crush_map { | |||
| 162 | __u32 choose_local_fallback_tries; | 162 | __u32 choose_local_fallback_tries; |
| 163 | /* choose attempts before giving up */ | 163 | /* choose attempts before giving up */ |
| 164 | __u32 choose_total_tries; | 164 | __u32 choose_total_tries; |
| 165 | /* attempt chooseleaf inner descent once; on failure retry outer descent */ | ||
| 166 | __u32 chooseleaf_descend_once; | ||
| 165 | }; | 167 | }; |
| 166 | 168 | ||
| 167 | 169 | ||
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 3bd46f766751..a975de1ff59f 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
| @@ -51,7 +51,7 @@ struct task_struct; | |||
| 51 | extern void debug_show_all_locks(void); | 51 | extern void debug_show_all_locks(void); |
| 52 | extern void debug_show_held_locks(struct task_struct *task); | 52 | extern void debug_show_held_locks(struct task_struct *task); |
| 53 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); | 53 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); |
| 54 | extern void debug_check_no_locks_held(struct task_struct *task); | 54 | extern void debug_check_no_locks_held(void); |
| 55 | #else | 55 | #else |
| 56 | static inline void debug_show_all_locks(void) | 56 | static inline void debug_show_all_locks(void) |
| 57 | { | 57 | { |
| @@ -67,7 +67,7 @@ debug_check_no_locks_freed(const void *from, unsigned long len) | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | static inline void | 69 | static inline void |
| 70 | debug_check_no_locks_held(struct task_struct *task) | 70 | debug_check_no_locks_held(void) |
| 71 | { | 71 | { |
| 72 | } | 72 | } |
| 73 | #endif | 73 | #endif |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index bf6afa2fc432..1e483fa7afb4 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
| @@ -68,8 +68,8 @@ typedef void (*dm_postsuspend_fn) (struct dm_target *ti); | |||
| 68 | typedef int (*dm_preresume_fn) (struct dm_target *ti); | 68 | typedef int (*dm_preresume_fn) (struct dm_target *ti); |
| 69 | typedef void (*dm_resume_fn) (struct dm_target *ti); | 69 | typedef void (*dm_resume_fn) (struct dm_target *ti); |
| 70 | 70 | ||
| 71 | typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, | 71 | typedef void (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, |
| 72 | unsigned status_flags, char *result, unsigned maxlen); | 72 | unsigned status_flags, char *result, unsigned maxlen); |
| 73 | 73 | ||
| 74 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); | 74 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); |
| 75 | 75 | ||
| @@ -175,6 +175,14 @@ struct target_type { | |||
| 175 | #define DM_TARGET_IMMUTABLE 0x00000004 | 175 | #define DM_TARGET_IMMUTABLE 0x00000004 |
| 176 | #define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE) | 176 | #define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE) |
| 177 | 177 | ||
| 178 | /* | ||
| 179 | * Some targets need to be sent the same WRITE bio severals times so | ||
| 180 | * that they can send copies of it to different devices. This function | ||
| 181 | * examines any supplied bio and returns the number of copies of it the | ||
| 182 | * target requires. | ||
| 183 | */ | ||
| 184 | typedef unsigned (*dm_num_write_bios_fn) (struct dm_target *ti, struct bio *bio); | ||
| 185 | |||
| 178 | struct dm_target { | 186 | struct dm_target { |
| 179 | struct dm_table *table; | 187 | struct dm_table *table; |
| 180 | struct target_type *type; | 188 | struct target_type *type; |
| @@ -187,26 +195,26 @@ struct dm_target { | |||
| 187 | uint32_t max_io_len; | 195 | uint32_t max_io_len; |
| 188 | 196 | ||
| 189 | /* | 197 | /* |
| 190 | * A number of zero-length barrier requests that will be submitted | 198 | * A number of zero-length barrier bios that will be submitted |
| 191 | * to the target for the purpose of flushing cache. | 199 | * to the target for the purpose of flushing cache. |
| 192 | * | 200 | * |
| 193 | * The request number can be accessed with dm_bio_get_target_request_nr. | 201 | * The bio number can be accessed with dm_bio_get_target_bio_nr. |
| 194 | * It is a responsibility of the target driver to remap these requests | 202 | * It is a responsibility of the target driver to remap these bios |
| 195 | * to the real underlying devices. | 203 | * to the real underlying devices. |
| 196 | */ | 204 | */ |
| 197 | unsigned num_flush_requests; | 205 | unsigned num_flush_bios; |
| 198 | 206 | ||
| 199 | /* | 207 | /* |
| 200 | * The number of discard requests that will be submitted to the target. | 208 | * The number of discard bios that will be submitted to the target. |
| 201 | * The request number can be accessed with dm_bio_get_target_request_nr. | 209 | * The bio number can be accessed with dm_bio_get_target_bio_nr. |
| 202 | */ | 210 | */ |
| 203 | unsigned num_discard_requests; | 211 | unsigned num_discard_bios; |
| 204 | 212 | ||
| 205 | /* | 213 | /* |
| 206 | * The number of WRITE SAME requests that will be submitted to the target. | 214 | * The number of WRITE SAME bios that will be submitted to the target. |
| 207 | * The request number can be accessed with dm_bio_get_target_request_nr. | 215 | * The bio number can be accessed with dm_bio_get_target_bio_nr. |
| 208 | */ | 216 | */ |
| 209 | unsigned num_write_same_requests; | 217 | unsigned num_write_same_bios; |
| 210 | 218 | ||
| 211 | /* | 219 | /* |
| 212 | * The minimum number of extra bytes allocated in each bio for the | 220 | * The minimum number of extra bytes allocated in each bio for the |
| @@ -214,6 +222,13 @@ struct dm_target { | |||
| 214 | */ | 222 | */ |
| 215 | unsigned per_bio_data_size; | 223 | unsigned per_bio_data_size; |
| 216 | 224 | ||
| 225 | /* | ||
| 226 | * If defined, this function is called to find out how many | ||
| 227 | * duplicate bios should be sent to the target when writing | ||
| 228 | * data. | ||
| 229 | */ | ||
| 230 | dm_num_write_bios_fn num_write_bios; | ||
| 231 | |||
| 217 | /* target specific data */ | 232 | /* target specific data */ |
| 218 | void *private; | 233 | void *private; |
| 219 | 234 | ||
| @@ -233,10 +248,10 @@ struct dm_target { | |||
| 233 | bool discards_supported:1; | 248 | bool discards_supported:1; |
| 234 | 249 | ||
| 235 | /* | 250 | /* |
| 236 | * Set if the target required discard request to be split | 251 | * Set if the target required discard bios to be split |
| 237 | * on max_io_len boundary. | 252 | * on max_io_len boundary. |
| 238 | */ | 253 | */ |
| 239 | bool split_discard_requests:1; | 254 | bool split_discard_bios:1; |
| 240 | 255 | ||
| 241 | /* | 256 | /* |
| 242 | * Set if this target does not return zeroes on discarded blocks. | 257 | * Set if this target does not return zeroes on discarded blocks. |
| @@ -261,7 +276,7 @@ struct dm_target_io { | |||
| 261 | struct dm_io *io; | 276 | struct dm_io *io; |
| 262 | struct dm_target *ti; | 277 | struct dm_target *ti; |
| 263 | union map_info info; | 278 | union map_info info; |
| 264 | unsigned target_request_nr; | 279 | unsigned target_bio_nr; |
| 265 | struct bio clone; | 280 | struct bio clone; |
| 266 | }; | 281 | }; |
| 267 | 282 | ||
| @@ -275,9 +290,9 @@ static inline struct bio *dm_bio_from_per_bio_data(void *data, size_t data_size) | |||
| 275 | return (struct bio *)((char *)data + data_size + offsetof(struct dm_target_io, clone)); | 290 | return (struct bio *)((char *)data + data_size + offsetof(struct dm_target_io, clone)); |
| 276 | } | 291 | } |
| 277 | 292 | ||
| 278 | static inline unsigned dm_bio_get_target_request_nr(const struct bio *bio) | 293 | static inline unsigned dm_bio_get_target_bio_nr(const struct bio *bio) |
| 279 | { | 294 | { |
| 280 | return container_of(bio, struct dm_target_io, clone)->target_request_nr; | 295 | return container_of(bio, struct dm_target_io, clone)->target_bio_nr; |
| 281 | } | 296 | } |
| 282 | 297 | ||
| 283 | int dm_register_target(struct target_type *t); | 298 | int dm_register_target(struct target_type *t); |
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h index 47d9d376e4e7..f486d636b82e 100644 --- a/include/linux/dm-kcopyd.h +++ b/include/linux/dm-kcopyd.h | |||
| @@ -21,11 +21,34 @@ | |||
| 21 | 21 | ||
| 22 | #define DM_KCOPYD_IGNORE_ERROR 1 | 22 | #define DM_KCOPYD_IGNORE_ERROR 1 |
| 23 | 23 | ||
| 24 | struct dm_kcopyd_throttle { | ||
| 25 | unsigned throttle; | ||
| 26 | unsigned num_io_jobs; | ||
| 27 | unsigned io_period; | ||
| 28 | unsigned total_period; | ||
| 29 | unsigned last_jiffies; | ||
| 30 | }; | ||
| 31 | |||
| 32 | /* | ||
| 33 | * kcopyd clients that want to support throttling must pass an initialised | ||
| 34 | * dm_kcopyd_throttle struct into dm_kcopyd_client_create(). | ||
| 35 | * Two or more clients may share the same instance of this struct between | ||
| 36 | * them if they wish to be throttled as a group. | ||
| 37 | * | ||
| 38 | * This macro also creates a corresponding module parameter to configure | ||
| 39 | * the amount of throttling. | ||
| 40 | */ | ||
| 41 | #define DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(name, description) \ | ||
| 42 | static struct dm_kcopyd_throttle dm_kcopyd_throttle = { 100, 0, 0, 0, 0 }; \ | ||
| 43 | module_param_named(name, dm_kcopyd_throttle.throttle, uint, 0644); \ | ||
| 44 | MODULE_PARM_DESC(name, description) | ||
| 45 | |||
| 24 | /* | 46 | /* |
| 25 | * To use kcopyd you must first create a dm_kcopyd_client object. | 47 | * To use kcopyd you must first create a dm_kcopyd_client object. |
| 48 | * throttle can be NULL if you don't want any throttling. | ||
| 26 | */ | 49 | */ |
| 27 | struct dm_kcopyd_client; | 50 | struct dm_kcopyd_client; |
| 28 | struct dm_kcopyd_client *dm_kcopyd_client_create(void); | 51 | struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *throttle); |
| 29 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); | 52 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); |
| 30 | 53 | ||
| 31 | /* | 54 | /* |
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 3d754a394e92..9978b614a1aa 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h | |||
| @@ -119,8 +119,10 @@ struct dma_buf { | |||
| 119 | struct file *file; | 119 | struct file *file; |
| 120 | struct list_head attachments; | 120 | struct list_head attachments; |
| 121 | const struct dma_buf_ops *ops; | 121 | const struct dma_buf_ops *ops; |
| 122 | /* mutex to serialize list manipulation and attach/detach */ | 122 | /* mutex to serialize list manipulation, attach/detach and vmap/unmap */ |
| 123 | struct mutex lock; | 123 | struct mutex lock; |
| 124 | unsigned vmapping_counter; | ||
| 125 | void *vmap_ptr; | ||
| 124 | void *priv; | 126 | void *priv; |
| 125 | }; | 127 | }; |
| 126 | 128 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index f5939999cb65..91ac8da25020 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -1001,6 +1001,22 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx); | |||
| 1001 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); | 1001 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); |
| 1002 | struct dma_chan *net_dma_find_channel(void); | 1002 | struct dma_chan *net_dma_find_channel(void); |
| 1003 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) | 1003 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) |
| 1004 | #define dma_request_slave_channel_compat(mask, x, y, dev, name) \ | ||
| 1005 | __dma_request_slave_channel_compat(&(mask), x, y, dev, name) | ||
| 1006 | |||
| 1007 | static inline struct dma_chan | ||
| 1008 | *__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn, | ||
| 1009 | void *fn_param, struct device *dev, | ||
| 1010 | char *name) | ||
| 1011 | { | ||
| 1012 | struct dma_chan *chan; | ||
| 1013 | |||
| 1014 | chan = dma_request_slave_channel(dev, name); | ||
| 1015 | if (chan) | ||
| 1016 | return chan; | ||
| 1017 | |||
| 1018 | return __dma_request_channel(mask, fn, fn_param); | ||
| 1019 | } | ||
| 1004 | 1020 | ||
| 1005 | /* --- Helper iov-locking functions --- */ | 1021 | /* --- Helper iov-locking functions --- */ |
| 1006 | 1022 | ||
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h index 41766de66e33..481ab2345d6b 100644 --- a/include/linux/dw_dmac.h +++ b/include/linux/dw_dmac.h | |||
| @@ -27,7 +27,6 @@ | |||
| 27 | */ | 27 | */ |
| 28 | struct dw_dma_slave { | 28 | struct dw_dma_slave { |
| 29 | struct device *dma_dev; | 29 | struct device *dma_dev; |
| 30 | const char *bus_id; | ||
| 31 | u32 cfg_hi; | 30 | u32 cfg_hi; |
| 32 | u32 cfg_lo; | 31 | u32 cfg_lo; |
| 33 | u8 src_master; | 32 | u8 src_master; |
| @@ -60,9 +59,6 @@ struct dw_dma_platform_data { | |||
| 60 | unsigned short block_size; | 59 | unsigned short block_size; |
| 61 | unsigned char nr_masters; | 60 | unsigned char nr_masters; |
| 62 | unsigned char data_width[4]; | 61 | unsigned char data_width[4]; |
| 63 | |||
| 64 | struct dw_dma_slave *sd; | ||
| 65 | unsigned int sd_count; | ||
| 66 | }; | 62 | }; |
| 67 | 63 | ||
| 68 | /* bursts size */ | 64 | /* bursts size */ |
| @@ -114,6 +110,5 @@ void dw_dma_cyclic_stop(struct dma_chan *chan); | |||
| 114 | dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan); | 110 | dma_addr_t dw_dma_get_src_addr(struct dma_chan *chan); |
| 115 | 111 | ||
| 116 | dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan); | 112 | dma_addr_t dw_dma_get_dst_addr(struct dma_chan *chan); |
| 117 | bool dw_dma_generic_filter(struct dma_chan *chan, void *param); | ||
| 118 | 113 | ||
| 119 | #endif /* DW_DMAC_H */ | 114 | #endif /* DW_DMAC_H */ |
diff --git a/include/linux/edac.h b/include/linux/edac.h index 1b8c02b36f76..4fd4999ccb5b 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | 14 | ||
| 15 | #include <linux/atomic.h> | 15 | #include <linux/atomic.h> |
| 16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
| 17 | #include <linux/kobject.h> | ||
| 18 | #include <linux/completion.h> | 17 | #include <linux/completion.h> |
| 19 | #include <linux/workqueue.h> | 18 | #include <linux/workqueue.h> |
| 20 | #include <linux/debugfs.h> | 19 | #include <linux/debugfs.h> |
| @@ -48,8 +47,17 @@ static inline void opstate_init(void) | |||
| 48 | return; | 47 | return; |
| 49 | } | 48 | } |
| 50 | 49 | ||
| 50 | /* Max length of a DIMM label*/ | ||
| 51 | #define EDAC_MC_LABEL_LEN 31 | 51 | #define EDAC_MC_LABEL_LEN 31 |
| 52 | #define MC_PROC_NAME_MAX_LEN 7 | 52 | |
| 53 | /* Maximum size of the location string */ | ||
| 54 | #define LOCATION_SIZE 80 | ||
| 55 | |||
| 56 | /* Defines the maximum number of labels that can be reported */ | ||
| 57 | #define EDAC_MAX_LABELS 8 | ||
| 58 | |||
| 59 | /* String used to join two or more labels */ | ||
| 60 | #define OTHER_LABEL " or " | ||
| 53 | 61 | ||
| 54 | /** | 62 | /** |
| 55 | * enum dev_type - describe the type of memory DRAM chips used at the stick | 63 | * enum dev_type - describe the type of memory DRAM chips used at the stick |
| @@ -101,8 +109,24 @@ enum hw_event_mc_err_type { | |||
| 101 | HW_EVENT_ERR_CORRECTED, | 109 | HW_EVENT_ERR_CORRECTED, |
| 102 | HW_EVENT_ERR_UNCORRECTED, | 110 | HW_EVENT_ERR_UNCORRECTED, |
| 103 | HW_EVENT_ERR_FATAL, | 111 | HW_EVENT_ERR_FATAL, |
| 112 | HW_EVENT_ERR_INFO, | ||
| 104 | }; | 113 | }; |
| 105 | 114 | ||
| 115 | static inline char *mc_event_error_type(const unsigned int err_type) | ||
| 116 | { | ||
| 117 | switch (err_type) { | ||
| 118 | case HW_EVENT_ERR_CORRECTED: | ||
| 119 | return "Corrected"; | ||
| 120 | case HW_EVENT_ERR_UNCORRECTED: | ||
| 121 | return "Uncorrected"; | ||
| 122 | case HW_EVENT_ERR_FATAL: | ||
| 123 | return "Fatal"; | ||
| 124 | default: | ||
| 125 | case HW_EVENT_ERR_INFO: | ||
| 126 | return "Info"; | ||
| 127 | } | ||
| 128 | } | ||
| 129 | |||
| 106 | /** | 130 | /** |
| 107 | * enum mem_type - memory types. For a more detailed reference, please see | 131 | * enum mem_type - memory types. For a more detailed reference, please see |
| 108 | * http://en.wikipedia.org/wiki/DRAM | 132 | * http://en.wikipedia.org/wiki/DRAM |
| @@ -376,6 +400,9 @@ enum scrub_type { | |||
| 376 | * @EDAC_MC_LAYER_CHANNEL: memory layer is named "channel" | 400 | * @EDAC_MC_LAYER_CHANNEL: memory layer is named "channel" |
| 377 | * @EDAC_MC_LAYER_SLOT: memory layer is named "slot" | 401 | * @EDAC_MC_LAYER_SLOT: memory layer is named "slot" |
| 378 | * @EDAC_MC_LAYER_CHIP_SELECT: memory layer is named "chip select" | 402 | * @EDAC_MC_LAYER_CHIP_SELECT: memory layer is named "chip select" |
| 403 | * @EDAC_MC_LAYER_ALL_MEM: memory layout is unknown. All memory is mapped | ||
| 404 | * as a single memory area. This is used when | ||
| 405 | * retrieving errors from a firmware driven driver. | ||
| 379 | * | 406 | * |
| 380 | * This enum is used by the drivers to tell edac_mc_sysfs what name should | 407 | * This enum is used by the drivers to tell edac_mc_sysfs what name should |
| 381 | * be used when describing a memory stick location. | 408 | * be used when describing a memory stick location. |
| @@ -385,6 +412,7 @@ enum edac_mc_layer_type { | |||
| 385 | EDAC_MC_LAYER_CHANNEL, | 412 | EDAC_MC_LAYER_CHANNEL, |
| 386 | EDAC_MC_LAYER_SLOT, | 413 | EDAC_MC_LAYER_SLOT, |
| 387 | EDAC_MC_LAYER_CHIP_SELECT, | 414 | EDAC_MC_LAYER_CHIP_SELECT, |
| 415 | EDAC_MC_LAYER_ALL_MEM, | ||
| 388 | }; | 416 | }; |
| 389 | 417 | ||
| 390 | /** | 418 | /** |
| @@ -551,6 +579,46 @@ struct errcount_attribute_data { | |||
| 551 | int layer0, layer1, layer2; | 579 | int layer0, layer1, layer2; |
| 552 | }; | 580 | }; |
| 553 | 581 | ||
| 582 | /** | ||
| 583 | * edac_raw_error_desc - Raw error report structure | ||
| 584 | * @grain: minimum granularity for an error report, in bytes | ||
| 585 | * @error_count: number of errors of the same type | ||
| 586 | * @top_layer: top layer of the error (layer[0]) | ||
| 587 | * @mid_layer: middle layer of the error (layer[1]) | ||
| 588 | * @low_layer: low layer of the error (layer[2]) | ||
| 589 | * @page_frame_number: page where the error happened | ||
| 590 | * @offset_in_page: page offset | ||
| 591 | * @syndrome: syndrome of the error (or 0 if unknown or if | ||
| 592 | * the syndrome is not applicable) | ||
| 593 | * @msg: error message | ||
| 594 | * @location: location of the error | ||
| 595 | * @label: label of the affected DIMM(s) | ||
| 596 | * @other_detail: other driver-specific detail about the error | ||
| 597 | * @enable_per_layer_report: if false, the error affects all layers | ||
| 598 | * (typically, a memory controller error) | ||
| 599 | */ | ||
| 600 | struct edac_raw_error_desc { | ||
| 601 | /* | ||
| 602 | * NOTE: everything before grain won't be cleaned by | ||
| 603 | * edac_raw_error_desc_clean() | ||
| 604 | */ | ||
| 605 | char location[LOCATION_SIZE]; | ||
| 606 | char label[(EDAC_MC_LABEL_LEN + 1 + sizeof(OTHER_LABEL)) * EDAC_MAX_LABELS]; | ||
| 607 | long grain; | ||
| 608 | |||
| 609 | /* the vars below and grain will be cleaned on every new error report */ | ||
| 610 | u16 error_count; | ||
| 611 | int top_layer; | ||
| 612 | int mid_layer; | ||
| 613 | int low_layer; | ||
| 614 | unsigned long page_frame_number; | ||
| 615 | unsigned long offset_in_page; | ||
| 616 | unsigned long syndrome; | ||
| 617 | const char *msg; | ||
| 618 | const char *other_detail; | ||
| 619 | bool enable_per_layer_report; | ||
| 620 | }; | ||
| 621 | |||
| 554 | /* MEMORY controller information structure | 622 | /* MEMORY controller information structure |
| 555 | */ | 623 | */ |
| 556 | struct mem_ctl_info { | 624 | struct mem_ctl_info { |
| @@ -630,7 +698,6 @@ struct mem_ctl_info { | |||
| 630 | const char *mod_ver; | 698 | const char *mod_ver; |
| 631 | const char *ctl_name; | 699 | const char *ctl_name; |
| 632 | const char *dev_name; | 700 | const char *dev_name; |
| 633 | char proc_name[MC_PROC_NAME_MAX_LEN + 1]; | ||
| 634 | void *pvt_info; | 701 | void *pvt_info; |
| 635 | unsigned long start_time; /* mci load start time (in jiffies) */ | 702 | unsigned long start_time; /* mci load start time (in jiffies) */ |
| 636 | 703 | ||
| @@ -659,6 +726,12 @@ struct mem_ctl_info { | |||
| 659 | /* work struct for this MC */ | 726 | /* work struct for this MC */ |
| 660 | struct delayed_work work; | 727 | struct delayed_work work; |
| 661 | 728 | ||
| 729 | /* | ||
| 730 | * Used to report an error - by being at the global struct | ||
| 731 | * makes the memory allocated by the EDAC core | ||
| 732 | */ | ||
| 733 | struct edac_raw_error_desc error_desc; | ||
| 734 | |||
| 662 | /* the internal state of this controller instance */ | 735 | /* the internal state of this controller instance */ |
| 663 | int op_state; | 736 | int op_state; |
| 664 | 737 | ||
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 186620631750..acd0312d46fb 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_ELEVATOR_H | 2 | #define _LINUX_ELEVATOR_H |
| 3 | 3 | ||
| 4 | #include <linux/percpu.h> | 4 | #include <linux/percpu.h> |
| 5 | #include <linux/hashtable.h> | ||
| 5 | 6 | ||
| 6 | #ifdef CONFIG_BLOCK | 7 | #ifdef CONFIG_BLOCK |
| 7 | 8 | ||
| @@ -96,6 +97,8 @@ struct elevator_type | |||
| 96 | struct list_head list; | 97 | struct list_head list; |
| 97 | }; | 98 | }; |
| 98 | 99 | ||
| 100 | #define ELV_HASH_BITS 6 | ||
| 101 | |||
| 99 | /* | 102 | /* |
| 100 | * each queue has an elevator_queue associated with it | 103 | * each queue has an elevator_queue associated with it |
| 101 | */ | 104 | */ |
| @@ -105,8 +108,8 @@ struct elevator_queue | |||
| 105 | void *elevator_data; | 108 | void *elevator_data; |
| 106 | struct kobject kobj; | 109 | struct kobject kobj; |
| 107 | struct mutex sysfs_lock; | 110 | struct mutex sysfs_lock; |
| 108 | struct hlist_head *hash; | ||
| 109 | unsigned int registered:1; | 111 | unsigned int registered:1; |
| 112 | DECLARE_HASHTABLE(hash, ELV_HASH_BITS); | ||
| 110 | }; | 113 | }; |
| 111 | 114 | ||
| 112 | /* | 115 | /* |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 3c3ef19a625a..cf5d2af61b81 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #include <linux/wait.h> | 13 | #include <linux/wait.h> |
| 14 | 14 | ||
| 15 | /* | 15 | /* |
| 16 | * CAREFUL: Check include/asm-generic/fcntl.h when defining | 16 | * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining |
| 17 | * new flags, since they might collide with O_* ones. We want | 17 | * new flags, since they might collide with O_* ones. We want |
| 18 | * to re-use O_* flags that couldn't possibly have a meaning | 18 | * to re-use O_* flags that couldn't possibly have a meaning |
| 19 | * from eventfd, in order to leave a free define-space for | 19 | * from eventfd, in order to leave a free define-space for |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index e70df40d84f6..043a5cf8b5ba 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #ifndef FREEZER_H_INCLUDED | 3 | #ifndef FREEZER_H_INCLUDED |
| 4 | #define FREEZER_H_INCLUDED | 4 | #define FREEZER_H_INCLUDED |
| 5 | 5 | ||
| 6 | #include <linux/debug_locks.h> | ||
| 6 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
| 7 | #include <linux/wait.h> | 8 | #include <linux/wait.h> |
| 8 | #include <linux/atomic.h> | 9 | #include <linux/atomic.h> |
| @@ -48,6 +49,8 @@ extern void thaw_kernel_threads(void); | |||
| 48 | 49 | ||
| 49 | static inline bool try_to_freeze(void) | 50 | static inline bool try_to_freeze(void) |
| 50 | { | 51 | { |
| 52 | if (!(current->flags & PF_NOFREEZE)) | ||
| 53 | debug_check_no_locks_held(); | ||
| 51 | might_sleep(); | 54 | might_sleep(); |
| 52 | if (likely(!freezing(current))) | 55 | if (likely(!freezing(current))) |
| 53 | return false; | 56 | return false; |
diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h index 227c62424f3c..a9df51f5d54c 100644 --- a/include/linux/hashtable.h +++ b/include/linux/hashtable.h | |||
| @@ -115,51 +115,50 @@ static inline void hash_del_rcu(struct hlist_node *node) | |||
| 115 | * hash_for_each - iterate over a hashtable | 115 | * hash_for_each - iterate over a hashtable |
| 116 | * @name: hashtable to iterate | 116 | * @name: hashtable to iterate |
| 117 | * @bkt: integer to use as bucket loop cursor | 117 | * @bkt: integer to use as bucket loop cursor |
| 118 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 119 | * @obj: the type * to use as a loop cursor for each entry | 118 | * @obj: the type * to use as a loop cursor for each entry |
| 120 | * @member: the name of the hlist_node within the struct | 119 | * @member: the name of the hlist_node within the struct |
| 121 | */ | 120 | */ |
| 122 | #define hash_for_each(name, bkt, node, obj, member) \ | 121 | #define hash_for_each(name, bkt, obj, member) \ |
| 123 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | 122 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ |
| 124 | hlist_for_each_entry(obj, node, &name[bkt], member) | 123 | (bkt)++)\ |
| 124 | hlist_for_each_entry(obj, &name[bkt], member) | ||
| 125 | 125 | ||
| 126 | /** | 126 | /** |
| 127 | * hash_for_each_rcu - iterate over a rcu enabled hashtable | 127 | * hash_for_each_rcu - iterate over a rcu enabled hashtable |
| 128 | * @name: hashtable to iterate | 128 | * @name: hashtable to iterate |
| 129 | * @bkt: integer to use as bucket loop cursor | 129 | * @bkt: integer to use as bucket loop cursor |
| 130 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 131 | * @obj: the type * to use as a loop cursor for each entry | 130 | * @obj: the type * to use as a loop cursor for each entry |
| 132 | * @member: the name of the hlist_node within the struct | 131 | * @member: the name of the hlist_node within the struct |
| 133 | */ | 132 | */ |
| 134 | #define hash_for_each_rcu(name, bkt, node, obj, member) \ | 133 | #define hash_for_each_rcu(name, bkt, obj, member) \ |
| 135 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | 134 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ |
| 136 | hlist_for_each_entry_rcu(obj, node, &name[bkt], member) | 135 | (bkt)++)\ |
| 136 | hlist_for_each_entry_rcu(obj, &name[bkt], member) | ||
| 137 | 137 | ||
| 138 | /** | 138 | /** |
| 139 | * hash_for_each_safe - iterate over a hashtable safe against removal of | 139 | * hash_for_each_safe - iterate over a hashtable safe against removal of |
| 140 | * hash entry | 140 | * hash entry |
| 141 | * @name: hashtable to iterate | 141 | * @name: hashtable to iterate |
| 142 | * @bkt: integer to use as bucket loop cursor | 142 | * @bkt: integer to use as bucket loop cursor |
| 143 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 144 | * @tmp: a &struct used for temporary storage | 143 | * @tmp: a &struct used for temporary storage |
| 145 | * @obj: the type * to use as a loop cursor for each entry | 144 | * @obj: the type * to use as a loop cursor for each entry |
| 146 | * @member: the name of the hlist_node within the struct | 145 | * @member: the name of the hlist_node within the struct |
| 147 | */ | 146 | */ |
| 148 | #define hash_for_each_safe(name, bkt, node, tmp, obj, member) \ | 147 | #define hash_for_each_safe(name, bkt, tmp, obj, member) \ |
| 149 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | 148 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ |
| 150 | hlist_for_each_entry_safe(obj, node, tmp, &name[bkt], member) | 149 | (bkt)++)\ |
| 150 | hlist_for_each_entry_safe(obj, tmp, &name[bkt], member) | ||
| 151 | 151 | ||
| 152 | /** | 152 | /** |
| 153 | * hash_for_each_possible - iterate over all possible objects hashing to the | 153 | * hash_for_each_possible - iterate over all possible objects hashing to the |
| 154 | * same bucket | 154 | * same bucket |
| 155 | * @name: hashtable to iterate | 155 | * @name: hashtable to iterate |
| 156 | * @obj: the type * to use as a loop cursor for each entry | 156 | * @obj: the type * to use as a loop cursor for each entry |
| 157 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 158 | * @member: the name of the hlist_node within the struct | 157 | * @member: the name of the hlist_node within the struct |
| 159 | * @key: the key of the objects to iterate over | 158 | * @key: the key of the objects to iterate over |
| 160 | */ | 159 | */ |
| 161 | #define hash_for_each_possible(name, obj, node, member, key) \ | 160 | #define hash_for_each_possible(name, obj, member, key) \ |
| 162 | hlist_for_each_entry(obj, node, &name[hash_min(key, HASH_BITS(name))], member) | 161 | hlist_for_each_entry(obj, &name[hash_min(key, HASH_BITS(name))], member) |
| 163 | 162 | ||
| 164 | /** | 163 | /** |
| 165 | * hash_for_each_possible_rcu - iterate over all possible objects hashing to the | 164 | * hash_for_each_possible_rcu - iterate over all possible objects hashing to the |
| @@ -167,25 +166,24 @@ static inline void hash_del_rcu(struct hlist_node *node) | |||
| 167 | * in a rcu enabled hashtable | 166 | * in a rcu enabled hashtable |
| 168 | * @name: hashtable to iterate | 167 | * @name: hashtable to iterate |
| 169 | * @obj: the type * to use as a loop cursor for each entry | 168 | * @obj: the type * to use as a loop cursor for each entry |
| 170 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 171 | * @member: the name of the hlist_node within the struct | 169 | * @member: the name of the hlist_node within the struct |
| 172 | * @key: the key of the objects to iterate over | 170 | * @key: the key of the objects to iterate over |
| 173 | */ | 171 | */ |
| 174 | #define hash_for_each_possible_rcu(name, obj, node, member, key) \ | 172 | #define hash_for_each_possible_rcu(name, obj, member, key) \ |
| 175 | hlist_for_each_entry_rcu(obj, node, &name[hash_min(key, HASH_BITS(name))], member) | 173 | hlist_for_each_entry_rcu(obj, &name[hash_min(key, HASH_BITS(name))],\ |
| 174 | member) | ||
| 176 | 175 | ||
| 177 | /** | 176 | /** |
| 178 | * hash_for_each_possible_safe - iterate over all possible objects hashing to the | 177 | * hash_for_each_possible_safe - iterate over all possible objects hashing to the |
| 179 | * same bucket safe against removals | 178 | * same bucket safe against removals |
| 180 | * @name: hashtable to iterate | 179 | * @name: hashtable to iterate |
| 181 | * @obj: the type * to use as a loop cursor for each entry | 180 | * @obj: the type * to use as a loop cursor for each entry |
| 182 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 183 | * @tmp: a &struct used for temporary storage | 181 | * @tmp: a &struct used for temporary storage |
| 184 | * @member: the name of the hlist_node within the struct | 182 | * @member: the name of the hlist_node within the struct |
| 185 | * @key: the key of the objects to iterate over | 183 | * @key: the key of the objects to iterate over |
| 186 | */ | 184 | */ |
| 187 | #define hash_for_each_possible_safe(name, obj, node, tmp, member, key) \ | 185 | #define hash_for_each_possible_safe(name, obj, tmp, member, key) \ |
| 188 | hlist_for_each_entry_safe(obj, node, tmp, \ | 186 | hlist_for_each_entry_safe(obj, tmp,\ |
| 189 | &name[hash_min(key, HASH_BITS(name))], member) | 187 | &name[hash_min(key, HASH_BITS(name))], member) |
| 190 | 188 | ||
| 191 | 189 | ||
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h index 56fae865e272..0dca785288cf 100644 --- a/include/linux/hsi/hsi.h +++ b/include/linux/hsi/hsi.h | |||
| @@ -121,9 +121,9 @@ static inline int hsi_register_board_info(struct hsi_board_info const *info, | |||
| 121 | * @device: Driver model representation of the device | 121 | * @device: Driver model representation of the device |
| 122 | * @tx_cfg: HSI TX configuration | 122 | * @tx_cfg: HSI TX configuration |
| 123 | * @rx_cfg: HSI RX configuration | 123 | * @rx_cfg: HSI RX configuration |
| 124 | * @e_handler: Callback for handling port events (RX Wake High/Low) | 124 | * e_handler: Callback for handling port events (RX Wake High/Low) |
| 125 | * @pclaimed: Keeps tracks if the clients claimed its associated HSI port | 125 | * pclaimed: Keeps tracks if the clients claimed its associated HSI port |
| 126 | * @nb: Notifier block for port events | 126 | * nb: Notifier block for port events |
| 127 | */ | 127 | */ |
| 128 | struct hsi_client { | 128 | struct hsi_client { |
| 129 | struct device device; | 129 | struct device device; |
diff --git a/include/linux/idr.h b/include/linux/idr.h index e5eb125effe6..a6f38b5c34e4 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
| @@ -17,69 +17,40 @@ | |||
| 17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 18 | #include <linux/rcupdate.h> | 18 | #include <linux/rcupdate.h> |
| 19 | 19 | ||
| 20 | #if BITS_PER_LONG == 32 | 20 | /* |
| 21 | # define IDR_BITS 5 | 21 | * We want shallower trees and thus more bits covered at each layer. 8 |
| 22 | # define IDR_FULL 0xfffffffful | 22 | * bits gives us large enough first layer for most use cases and maximum |
| 23 | /* We can only use two of the bits in the top level because there is | 23 | * tree depth of 4. Each idr_layer is slightly larger than 2k on 64bit and |
| 24 | only one possible bit in the top level (5 bits * 7 levels = 35 | 24 | * 1k on 32bit. |
| 25 | bits, but you only use 31 bits in the id). */ | 25 | */ |
| 26 | # define TOP_LEVEL_FULL (IDR_FULL >> 30) | 26 | #define IDR_BITS 8 |
| 27 | #elif BITS_PER_LONG == 64 | ||
| 28 | # define IDR_BITS 6 | ||
| 29 | # define IDR_FULL 0xfffffffffffffffful | ||
| 30 | /* We can only use two of the bits in the top level because there is | ||
| 31 | only one possible bit in the top level (6 bits * 6 levels = 36 | ||
| 32 | bits, but you only use 31 bits in the id). */ | ||
| 33 | # define TOP_LEVEL_FULL (IDR_FULL >> 62) | ||
| 34 | #else | ||
| 35 | # error "BITS_PER_LONG is not 32 or 64" | ||
| 36 | #endif | ||
| 37 | |||
| 38 | #define IDR_SIZE (1 << IDR_BITS) | 27 | #define IDR_SIZE (1 << IDR_BITS) |
| 39 | #define IDR_MASK ((1 << IDR_BITS)-1) | 28 | #define IDR_MASK ((1 << IDR_BITS)-1) |
| 40 | 29 | ||
| 41 | #define MAX_IDR_SHIFT (sizeof(int)*8 - 1) | ||
| 42 | #define MAX_IDR_BIT (1U << MAX_IDR_SHIFT) | ||
| 43 | #define MAX_IDR_MASK (MAX_IDR_BIT - 1) | ||
| 44 | |||
| 45 | /* Leave the possibility of an incomplete final layer */ | ||
| 46 | #define MAX_IDR_LEVEL ((MAX_IDR_SHIFT + IDR_BITS - 1) / IDR_BITS) | ||
| 47 | |||
| 48 | /* Number of id_layer structs to leave in free list */ | ||
| 49 | #define MAX_IDR_FREE (MAX_IDR_LEVEL * 2) | ||
| 50 | |||
| 51 | struct idr_layer { | 30 | struct idr_layer { |
| 52 | unsigned long bitmap; /* A zero bit means "space here" */ | 31 | int prefix; /* the ID prefix of this idr_layer */ |
| 32 | DECLARE_BITMAP(bitmap, IDR_SIZE); /* A zero bit means "space here" */ | ||
| 53 | struct idr_layer __rcu *ary[1<<IDR_BITS]; | 33 | struct idr_layer __rcu *ary[1<<IDR_BITS]; |
| 54 | int count; /* When zero, we can release it */ | 34 | int count; /* When zero, we can release it */ |
| 55 | int layer; /* distance from leaf */ | 35 | int layer; /* distance from leaf */ |
| 56 | struct rcu_head rcu_head; | 36 | struct rcu_head rcu_head; |
| 57 | }; | 37 | }; |
| 58 | 38 | ||
| 59 | struct idr { | 39 | struct idr { |
| 60 | struct idr_layer __rcu *top; | 40 | struct idr_layer __rcu *hint; /* the last layer allocated from */ |
| 61 | struct idr_layer *id_free; | 41 | struct idr_layer __rcu *top; |
| 62 | int layers; /* only valid without concurrent changes */ | 42 | struct idr_layer *id_free; |
| 63 | int id_free_cnt; | 43 | int layers; /* only valid w/o concurrent changes */ |
| 64 | spinlock_t lock; | 44 | int id_free_cnt; |
| 45 | spinlock_t lock; | ||
| 65 | }; | 46 | }; |
| 66 | 47 | ||
| 67 | #define IDR_INIT(name) \ | 48 | #define IDR_INIT(name) \ |
| 68 | { \ | 49 | { \ |
| 69 | .top = NULL, \ | 50 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ |
| 70 | .id_free = NULL, \ | ||
| 71 | .layers = 0, \ | ||
| 72 | .id_free_cnt = 0, \ | ||
| 73 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ | ||
| 74 | } | 51 | } |
| 75 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) | 52 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) |
| 76 | 53 | ||
| 77 | /* Actions to be taken after a call to _idr_sub_alloc */ | ||
| 78 | #define IDR_NEED_TO_GROW -2 | ||
| 79 | #define IDR_NOMORE_SPACE -3 | ||
| 80 | |||
| 81 | #define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) | ||
| 82 | |||
| 83 | /** | 54 | /** |
| 84 | * DOC: idr sync | 55 | * DOC: idr sync |
| 85 | * idr synchronization (stolen from radix-tree.h) | 56 | * idr synchronization (stolen from radix-tree.h) |
| @@ -101,19 +72,90 @@ struct idr { | |||
| 101 | * This is what we export. | 72 | * This is what we export. |
| 102 | */ | 73 | */ |
| 103 | 74 | ||
| 104 | void *idr_find(struct idr *idp, int id); | 75 | void *idr_find_slowpath(struct idr *idp, int id); |
| 105 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); | 76 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); |
| 106 | int idr_get_new(struct idr *idp, void *ptr, int *id); | ||
| 107 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 77 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
| 78 | void idr_preload(gfp_t gfp_mask); | ||
| 79 | int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); | ||
| 108 | int idr_for_each(struct idr *idp, | 80 | int idr_for_each(struct idr *idp, |
| 109 | int (*fn)(int id, void *p, void *data), void *data); | 81 | int (*fn)(int id, void *p, void *data), void *data); |
| 110 | void *idr_get_next(struct idr *idp, int *nextid); | 82 | void *idr_get_next(struct idr *idp, int *nextid); |
| 111 | void *idr_replace(struct idr *idp, void *ptr, int id); | 83 | void *idr_replace(struct idr *idp, void *ptr, int id); |
| 112 | void idr_remove(struct idr *idp, int id); | 84 | void idr_remove(struct idr *idp, int id); |
| 113 | void idr_remove_all(struct idr *idp); | 85 | void idr_free(struct idr *idp, int id); |
| 114 | void idr_destroy(struct idr *idp); | 86 | void idr_destroy(struct idr *idp); |
| 115 | void idr_init(struct idr *idp); | 87 | void idr_init(struct idr *idp); |
| 116 | 88 | ||
| 89 | /** | ||
| 90 | * idr_preload_end - end preload section started with idr_preload() | ||
| 91 | * | ||
| 92 | * Each idr_preload() should be matched with an invocation of this | ||
| 93 | * function. See idr_preload() for details. | ||
| 94 | */ | ||
| 95 | static inline void idr_preload_end(void) | ||
| 96 | { | ||
| 97 | preempt_enable(); | ||
| 98 | } | ||
| 99 | |||
| 100 | /** | ||
| 101 | * idr_find - return pointer for given id | ||
| 102 | * @idp: idr handle | ||
| 103 | * @id: lookup key | ||
| 104 | * | ||
| 105 | * Return the pointer given the id it has been registered with. A %NULL | ||
| 106 | * return indicates that @id is not valid or you passed %NULL in | ||
| 107 | * idr_get_new(). | ||
| 108 | * | ||
| 109 | * This function can be called under rcu_read_lock(), given that the leaf | ||
| 110 | * pointers lifetimes are correctly managed. | ||
| 111 | */ | ||
| 112 | static inline void *idr_find(struct idr *idr, int id) | ||
| 113 | { | ||
| 114 | struct idr_layer *hint = rcu_dereference_raw(idr->hint); | ||
| 115 | |||
| 116 | if (hint && (id & ~IDR_MASK) == hint->prefix) | ||
| 117 | return rcu_dereference_raw(hint->ary[id & IDR_MASK]); | ||
| 118 | |||
| 119 | return idr_find_slowpath(idr, id); | ||
| 120 | } | ||
| 121 | |||
| 122 | /** | ||
| 123 | * idr_get_new - allocate new idr entry | ||
| 124 | * @idp: idr handle | ||
| 125 | * @ptr: pointer you want associated with the id | ||
| 126 | * @id: pointer to the allocated handle | ||
| 127 | * | ||
| 128 | * Simple wrapper around idr_get_new_above() w/ @starting_id of zero. | ||
| 129 | */ | ||
| 130 | static inline int idr_get_new(struct idr *idp, void *ptr, int *id) | ||
| 131 | { | ||
| 132 | return idr_get_new_above(idp, ptr, 0, id); | ||
| 133 | } | ||
| 134 | |||
| 135 | /** | ||
| 136 | * idr_for_each_entry - iterate over an idr's elements of a given type | ||
| 137 | * @idp: idr handle | ||
| 138 | * @entry: the type * to use as cursor | ||
| 139 | * @id: id entry's key | ||
| 140 | */ | ||
| 141 | #define idr_for_each_entry(idp, entry, id) \ | ||
| 142 | for (id = 0, entry = (typeof(entry))idr_get_next((idp), &(id)); \ | ||
| 143 | entry != NULL; \ | ||
| 144 | ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) | ||
| 145 | |||
| 146 | void __idr_remove_all(struct idr *idp); /* don't use */ | ||
| 147 | |||
| 148 | /** | ||
| 149 | * idr_remove_all - remove all ids from the given idr tree | ||
| 150 | * @idp: idr handle | ||
| 151 | * | ||
| 152 | * If you're trying to destroy @idp, calling idr_destroy() is enough. | ||
| 153 | * This is going away. Don't use. | ||
| 154 | */ | ||
| 155 | static inline void __deprecated idr_remove_all(struct idr *idp) | ||
| 156 | { | ||
| 157 | __idr_remove_all(idp); | ||
| 158 | } | ||
| 117 | 159 | ||
| 118 | /* | 160 | /* |
| 119 | * IDA - IDR based id allocator, use when translation from id to | 161 | * IDA - IDR based id allocator, use when translation from id to |
| @@ -141,7 +183,6 @@ struct ida { | |||
| 141 | 183 | ||
| 142 | int ida_pre_get(struct ida *ida, gfp_t gfp_mask); | 184 | int ida_pre_get(struct ida *ida, gfp_t gfp_mask); |
| 143 | int ida_get_new_above(struct ida *ida, int starting_id, int *p_id); | 185 | int ida_get_new_above(struct ida *ida, int starting_id, int *p_id); |
| 144 | int ida_get_new(struct ida *ida, int *p_id); | ||
| 145 | void ida_remove(struct ida *ida, int id); | 186 | void ida_remove(struct ida *ida, int id); |
| 146 | void ida_destroy(struct ida *ida); | 187 | void ida_destroy(struct ida *ida); |
| 147 | void ida_init(struct ida *ida); | 188 | void ida_init(struct ida *ida); |
| @@ -150,17 +191,18 @@ int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end, | |||
| 150 | gfp_t gfp_mask); | 191 | gfp_t gfp_mask); |
| 151 | void ida_simple_remove(struct ida *ida, unsigned int id); | 192 | void ida_simple_remove(struct ida *ida, unsigned int id); |
| 152 | 193 | ||
| 153 | void __init idr_init_cache(void); | ||
| 154 | |||
| 155 | /** | 194 | /** |
| 156 | * idr_for_each_entry - iterate over an idr's elements of a given type | 195 | * ida_get_new - allocate new ID |
| 157 | * @idp: idr handle | 196 | * @ida: idr handle |
| 158 | * @entry: the type * to use as cursor | 197 | * @p_id: pointer to the allocated handle |
| 159 | * @id: id entry's key | 198 | * |
| 199 | * Simple wrapper around ida_get_new_above() w/ @starting_id of zero. | ||
| 160 | */ | 200 | */ |
| 161 | #define idr_for_each_entry(idp, entry, id) \ | 201 | static inline int ida_get_new(struct ida *ida, int *p_id) |
| 162 | for (id = 0, entry = (typeof(entry))idr_get_next((idp), &(id)); \ | 202 | { |
| 163 | entry != NULL; \ | 203 | return ida_get_new_above(ida, 0, p_id); |
| 164 | ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) | 204 | } |
| 205 | |||
| 206 | void __init idr_init_cache(void); | ||
| 165 | 207 | ||
| 166 | #endif /* __IDR_H__ */ | 208 | #endif /* __IDR_H__ */ |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 4648d8021244..cfd21e3d5506 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
| @@ -216,11 +216,10 @@ static inline struct hlist_head *team_port_index_hash(struct team *team, | |||
| 216 | static inline struct team_port *team_get_port_by_index(struct team *team, | 216 | static inline struct team_port *team_get_port_by_index(struct team *team, |
| 217 | int port_index) | 217 | int port_index) |
| 218 | { | 218 | { |
| 219 | struct hlist_node *p; | ||
| 220 | struct team_port *port; | 219 | struct team_port *port; |
| 221 | struct hlist_head *head = team_port_index_hash(team, port_index); | 220 | struct hlist_head *head = team_port_index_hash(team, port_index); |
| 222 | 221 | ||
| 223 | hlist_for_each_entry(port, p, head, hlist) | 222 | hlist_for_each_entry(port, head, hlist) |
| 224 | if (port->index == port_index) | 223 | if (port->index == port_index) |
| 225 | return port; | 224 | return port; |
| 226 | return NULL; | 225 | return NULL; |
| @@ -228,11 +227,10 @@ static inline struct team_port *team_get_port_by_index(struct team *team, | |||
| 228 | static inline struct team_port *team_get_port_by_index_rcu(struct team *team, | 227 | static inline struct team_port *team_get_port_by_index_rcu(struct team *team, |
| 229 | int port_index) | 228 | int port_index) |
| 230 | { | 229 | { |
| 231 | struct hlist_node *p; | ||
| 232 | struct team_port *port; | 230 | struct team_port *port; |
| 233 | struct hlist_head *head = team_port_index_hash(team, port_index); | 231 | struct hlist_head *head = team_port_index_hash(team, port_index); |
| 234 | 232 | ||
| 235 | hlist_for_each_entry_rcu(port, p, head, hlist) | 233 | hlist_for_each_entry_rcu(port, head, hlist) |
| 236 | if (port->index == port_index) | 234 | if (port->index == port_index) |
| 237 | return port; | 235 | return port; |
| 238 | return NULL; | 236 | return NULL; |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 1487e7906bbd..1f9f56e28851 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
| @@ -35,10 +35,6 @@ | |||
| 35 | 35 | ||
| 36 | #include <uapi/linux/ipmi.h> | 36 | #include <uapi/linux/ipmi.h> |
| 37 | 37 | ||
| 38 | |||
| 39 | /* | ||
| 40 | * The in-kernel interface. | ||
| 41 | */ | ||
| 42 | #include <linux/list.h> | 38 | #include <linux/list.h> |
| 43 | #include <linux/proc_fs.h> | 39 | #include <linux/proc_fs.h> |
| 44 | 40 | ||
diff --git a/include/linux/irqchip/metag-ext.h b/include/linux/irqchip/metag-ext.h new file mode 100644 index 000000000000..697af0fe7c5a --- /dev/null +++ b/include/linux/irqchip/metag-ext.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012 Imagination Technologies | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _LINUX_IRQCHIP_METAG_EXT_H_ | ||
| 6 | #define _LINUX_IRQCHIP_METAG_EXT_H_ | ||
| 7 | |||
| 8 | struct irq_data; | ||
| 9 | struct platform_device; | ||
| 10 | |||
| 11 | /* called from core irq code at init */ | ||
| 12 | int init_external_IRQ(void); | ||
| 13 | |||
| 14 | /* | ||
| 15 | * called from SoC init_irq() callback to dynamically indicate the lack of | ||
| 16 | * HWMASKEXT registers. | ||
| 17 | */ | ||
| 18 | void meta_intc_no_mask(void); | ||
| 19 | |||
| 20 | /* | ||
| 21 | * These allow SoCs to specialise the interrupt controller from their init_irq | ||
| 22 | * callbacks. | ||
| 23 | */ | ||
| 24 | |||
| 25 | extern struct irq_chip meta_intc_edge_chip; | ||
| 26 | extern struct irq_chip meta_intc_level_chip; | ||
| 27 | |||
| 28 | /* this should be called in the mask callback */ | ||
| 29 | void meta_intc_mask_irq_simple(struct irq_data *data); | ||
| 30 | /* this should be called in the unmask callback */ | ||
| 31 | void meta_intc_unmask_irq_simple(struct irq_data *data); | ||
| 32 | |||
| 33 | #endif /* _LINUX_IRQCHIP_METAG_EXT_H_ */ | ||
diff --git a/include/linux/irqchip/metag.h b/include/linux/irqchip/metag.h new file mode 100644 index 000000000000..4ebdfb3101ab --- /dev/null +++ b/include/linux/irqchip/metag.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Imagination Technologies | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _LINUX_IRQCHIP_METAG_H_ | ||
| 6 | #define _LINUX_IRQCHIP_METAG_H_ | ||
| 7 | |||
| 8 | #include <linux/errno.h> | ||
| 9 | |||
| 10 | #ifdef CONFIG_METAG_PERFCOUNTER_IRQS | ||
| 11 | extern int init_internal_IRQ(void); | ||
| 12 | extern int internal_irq_map(unsigned int hw); | ||
| 13 | #else | ||
| 14 | static inline int init_internal_IRQ(void) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | static inline int internal_irq_map(unsigned int hw) | ||
| 19 | { | ||
| 20 | return -EINVAL; | ||
| 21 | } | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #endif /* _LINUX_IRQCHIP_METAG_H_ */ | ||
diff --git a/include/linux/list.h b/include/linux/list.h index cc6d2aa6b415..d991cc147c98 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -666,54 +666,49 @@ static inline void hlist_move_list(struct hlist_head *old, | |||
| 666 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ | 666 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ |
| 667 | pos = n) | 667 | pos = n) |
| 668 | 668 | ||
| 669 | #define hlist_entry_safe(ptr, type, member) \ | ||
| 670 | (ptr) ? hlist_entry(ptr, type, member) : NULL | ||
| 671 | |||
| 669 | /** | 672 | /** |
| 670 | * hlist_for_each_entry - iterate over list of given type | 673 | * hlist_for_each_entry - iterate over list of given type |
| 671 | * @tpos: the type * to use as a loop cursor. | 674 | * @pos: the type * to use as a loop cursor. |
| 672 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 673 | * @head: the head for your list. | 675 | * @head: the head for your list. |
| 674 | * @member: the name of the hlist_node within the struct. | 676 | * @member: the name of the hlist_node within the struct. |
| 675 | */ | 677 | */ |
| 676 | #define hlist_for_each_entry(tpos, pos, head, member) \ | 678 | #define hlist_for_each_entry(pos, head, member) \ |
| 677 | for (pos = (head)->first; \ | 679 | for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\ |
| 678 | pos && \ | 680 | pos; \ |
| 679 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 681 | pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) |
| 680 | pos = pos->next) | ||
| 681 | 682 | ||
| 682 | /** | 683 | /** |
| 683 | * hlist_for_each_entry_continue - iterate over a hlist continuing after current point | 684 | * hlist_for_each_entry_continue - iterate over a hlist continuing after current point |
| 684 | * @tpos: the type * to use as a loop cursor. | 685 | * @pos: the type * to use as a loop cursor. |
| 685 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 686 | * @member: the name of the hlist_node within the struct. | 686 | * @member: the name of the hlist_node within the struct. |
| 687 | */ | 687 | */ |
| 688 | #define hlist_for_each_entry_continue(tpos, pos, member) \ | 688 | #define hlist_for_each_entry_continue(pos, member) \ |
| 689 | for (pos = (pos)->next; \ | 689 | for (pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member);\ |
| 690 | pos && \ | 690 | pos; \ |
| 691 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 691 | pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) |
| 692 | pos = pos->next) | ||
| 693 | 692 | ||
| 694 | /** | 693 | /** |
| 695 | * hlist_for_each_entry_from - iterate over a hlist continuing from current point | 694 | * hlist_for_each_entry_from - iterate over a hlist continuing from current point |
| 696 | * @tpos: the type * to use as a loop cursor. | 695 | * @pos: the type * to use as a loop cursor. |
| 697 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 698 | * @member: the name of the hlist_node within the struct. | 696 | * @member: the name of the hlist_node within the struct. |
| 699 | */ | 697 | */ |
| 700 | #define hlist_for_each_entry_from(tpos, pos, member) \ | 698 | #define hlist_for_each_entry_from(pos, member) \ |
| 701 | for (; pos && \ | 699 | for (; pos; \ |
| 702 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 700 | pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) |
| 703 | pos = pos->next) | ||
| 704 | 701 | ||
| 705 | /** | 702 | /** |
| 706 | * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 703 | * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
| 707 | * @tpos: the type * to use as a loop cursor. | 704 | * @pos: the type * to use as a loop cursor. |
| 708 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 709 | * @n: another &struct hlist_node to use as temporary storage | 705 | * @n: another &struct hlist_node to use as temporary storage |
| 710 | * @head: the head for your list. | 706 | * @head: the head for your list. |
| 711 | * @member: the name of the hlist_node within the struct. | 707 | * @member: the name of the hlist_node within the struct. |
| 712 | */ | 708 | */ |
| 713 | #define hlist_for_each_entry_safe(tpos, pos, n, head, member) \ | 709 | #define hlist_for_each_entry_safe(pos, n, head, member) \ |
| 714 | for (pos = (head)->first; \ | 710 | for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\ |
| 715 | pos && ({ n = pos->next; 1; }) && \ | 711 | pos && ({ n = pos->member.next; 1; }); \ |
| 716 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 712 | pos = hlist_entry_safe(n, typeof(*pos), member)) |
| 717 | pos = n) | ||
| 718 | 713 | ||
| 719 | #endif | 714 | #endif |
diff --git a/include/linux/llist.h b/include/linux/llist.h index d0ab98f73d38..a5199f6d0e82 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h | |||
| @@ -125,31 +125,6 @@ static inline void init_llist_head(struct llist_head *list) | |||
| 125 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) | 125 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) |
| 126 | 126 | ||
| 127 | /** | 127 | /** |
| 128 | * llist_for_each_entry_safe - iterate safely against remove over some entries | ||
| 129 | * of lock-less list of given type. | ||
| 130 | * @pos: the type * to use as a loop cursor. | ||
| 131 | * @n: another type * to use as a temporary storage. | ||
| 132 | * @node: the fist entry of deleted list entries. | ||
| 133 | * @member: the name of the llist_node with the struct. | ||
| 134 | * | ||
| 135 | * In general, some entries of the lock-less list can be traversed | ||
| 136 | * safely only after being removed from list, so start with an entry | ||
| 137 | * instead of list head. This variant allows removal of entries | ||
| 138 | * as we iterate. | ||
| 139 | * | ||
| 140 | * If being used on entries deleted from lock-less list directly, the | ||
| 141 | * traverse order is from the newest to the oldest added entry. If | ||
| 142 | * you want to traverse from the oldest to the newest, you must | ||
| 143 | * reverse the order by yourself before traversing. | ||
| 144 | */ | ||
| 145 | #define llist_for_each_entry_safe(pos, n, node, member) \ | ||
| 146 | for ((pos) = llist_entry((node), typeof(*(pos)), member), \ | ||
| 147 | (n) = (pos)->member.next; \ | ||
| 148 | &(pos)->member != NULL; \ | ||
| 149 | (pos) = llist_entry(n, typeof(*(pos)), member), \ | ||
| 150 | (n) = (&(pos)->member != NULL) ? (pos)->member.next : NULL) | ||
| 151 | |||
| 152 | /** | ||
| 153 | * llist_empty - tests whether a lock-less list is empty | 128 | * llist_empty - tests whether a lock-less list is empty |
| 154 | * @head: the list to test | 129 | * @head: the list to test |
| 155 | * | 130 | * |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 0e62d84f9f7f..dcaad79f54ed 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -212,7 +212,8 @@ int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout) | |||
| 212 | __be32 nlmclnt_grant(const struct sockaddr *addr, | 212 | __be32 nlmclnt_grant(const struct sockaddr *addr, |
| 213 | const struct nlm_lock *lock); | 213 | const struct nlm_lock *lock); |
| 214 | void nlmclnt_recovery(struct nlm_host *); | 214 | void nlmclnt_recovery(struct nlm_host *); |
| 215 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); | 215 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *, |
| 216 | struct nlm_rqst *); | ||
| 216 | void nlmclnt_next_cookie(struct nlm_cookie *); | 217 | void nlmclnt_next_cookie(struct nlm_cookie *); |
| 217 | 218 | ||
| 218 | /* | 219 | /* |
diff --git a/include/linux/lzo.h b/include/linux/lzo.h index d793497ec1ca..a0848d9377e5 100644 --- a/include/linux/lzo.h +++ b/include/linux/lzo.h | |||
| @@ -4,28 +4,28 @@ | |||
| 4 | * LZO Public Kernel Interface | 4 | * LZO Public Kernel Interface |
| 5 | * A mini subset of the LZO real-time data compression library | 5 | * A mini subset of the LZO real-time data compression library |
| 6 | * | 6 | * |
| 7 | * Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com> | 7 | * Copyright (C) 1996-2012 Markus F.X.J. Oberhumer <markus@oberhumer.com> |
| 8 | * | 8 | * |
| 9 | * The full LZO package can be found at: | 9 | * The full LZO package can be found at: |
| 10 | * http://www.oberhumer.com/opensource/lzo/ | 10 | * http://www.oberhumer.com/opensource/lzo/ |
| 11 | * | 11 | * |
| 12 | * Changed for kernel use by: | 12 | * Changed for Linux kernel use by: |
| 13 | * Nitin Gupta <nitingupta910@gmail.com> | 13 | * Nitin Gupta <nitingupta910@gmail.com> |
| 14 | * Richard Purdie <rpurdie@openedhand.com> | 14 | * Richard Purdie <rpurdie@openedhand.com> |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *)) | 17 | #define LZO1X_1_MEM_COMPRESS (8192 * sizeof(unsigned short)) |
| 18 | #define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS | 18 | #define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS |
| 19 | 19 | ||
| 20 | #define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3) | 20 | #define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3) |
| 21 | 21 | ||
| 22 | /* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */ | 22 | /* This requires 'wrkmem' of size LZO1X_1_MEM_COMPRESS */ |
| 23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, | 23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, |
| 24 | unsigned char *dst, size_t *dst_len, void *wrkmem); | 24 | unsigned char *dst, size_t *dst_len, void *wrkmem); |
| 25 | 25 | ||
| 26 | /* safe decompression with overrun testing */ | 26 | /* safe decompression with overrun testing */ |
| 27 | int lzo1x_decompress_safe(const unsigned char *src, size_t src_len, | 27 | int lzo1x_decompress_safe(const unsigned char *src, size_t src_len, |
| 28 | unsigned char *dst, size_t *dst_len); | 28 | unsigned char *dst, size_t *dst_len); |
| 29 | 29 | ||
| 30 | /* | 30 | /* |
| 31 | * Return values (< 0 = Error) | 31 | * Return values (< 0 = Error) |
| @@ -40,5 +40,6 @@ int lzo1x_decompress_safe(const unsigned char *src, size_t src_len, | |||
| 40 | #define LZO_E_EOF_NOT_FOUND (-7) | 40 | #define LZO_E_EOF_NOT_FOUND (-7) |
| 41 | #define LZO_E_INPUT_NOT_CONSUMED (-8) | 41 | #define LZO_E_INPUT_NOT_CONSUMED (-8) |
| 42 | #define LZO_E_NOT_YET_IMPLEMENTED (-9) | 42 | #define LZO_E_NOT_YET_IMPLEMENTED (-9) |
| 43 | #define LZO_E_INVALID_ARGUMENT (-10) | ||
| 43 | 44 | ||
| 44 | #endif | 45 | #endif |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 3e5ecb2d790e..f388203db7e8 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
| @@ -42,7 +42,6 @@ struct memblock { | |||
| 42 | 42 | ||
| 43 | extern struct memblock memblock; | 43 | extern struct memblock memblock; |
| 44 | extern int memblock_debug; | 44 | extern int memblock_debug; |
| 45 | extern struct movablemem_map movablemem_map; | ||
| 46 | 45 | ||
| 47 | #define memblock_dbg(fmt, ...) \ | 46 | #define memblock_dbg(fmt, ...) \ |
| 48 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 47 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| @@ -61,7 +60,6 @@ int memblock_reserve(phys_addr_t base, phys_addr_t size); | |||
| 61 | void memblock_trim_memory(phys_addr_t align); | 60 | void memblock_trim_memory(phys_addr_t align); |
| 62 | 61 | ||
| 63 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 62 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 64 | |||
| 65 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, | 63 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, |
| 66 | unsigned long *out_end_pfn, int *out_nid); | 64 | unsigned long *out_end_pfn, int *out_nid); |
| 67 | 65 | ||
diff --git a/include/linux/mfd/lp8788.h b/include/linux/mfd/lp8788.h index 2a32b16f79cb..786bf6679a28 100644 --- a/include/linux/mfd/lp8788.h +++ b/include/linux/mfd/lp8788.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
| 18 | #include <linux/irqdomain.h> | 18 | #include <linux/irqdomain.h> |
| 19 | #include <linux/pwm.h> | ||
| 19 | #include <linux/regmap.h> | 20 | #include <linux/regmap.h> |
| 20 | 21 | ||
| 21 | #define LP8788_DEV_BUCK "lp8788-buck" | 22 | #define LP8788_DEV_BUCK "lp8788-buck" |
| @@ -124,11 +125,6 @@ enum lp8788_bl_ramp_step { | |||
| 124 | LP8788_RAMP_65538us, | 125 | LP8788_RAMP_65538us, |
| 125 | }; | 126 | }; |
| 126 | 127 | ||
| 127 | enum lp8788_bl_pwm_polarity { | ||
| 128 | LP8788_PWM_ACTIVE_HIGH, | ||
| 129 | LP8788_PWM_ACTIVE_LOW, | ||
| 130 | }; | ||
| 131 | |||
| 132 | enum lp8788_isink_scale { | 128 | enum lp8788_isink_scale { |
| 133 | LP8788_ISINK_SCALE_100mA, | 129 | LP8788_ISINK_SCALE_100mA, |
| 134 | LP8788_ISINK_SCALE_120mA, | 130 | LP8788_ISINK_SCALE_120mA, |
| @@ -229,16 +225,6 @@ struct lp8788_charger_platform_data { | |||
| 229 | }; | 225 | }; |
| 230 | 226 | ||
| 231 | /* | 227 | /* |
| 232 | * struct lp8788_bl_pwm_data | ||
| 233 | * @pwm_set_intensity : set duty of pwm | ||
| 234 | * @pwm_get_intensity : get current duty of pwm | ||
| 235 | */ | ||
| 236 | struct lp8788_bl_pwm_data { | ||
| 237 | void (*pwm_set_intensity) (int brightness, int max_brightness); | ||
| 238 | int (*pwm_get_intensity) (int max_brightness); | ||
| 239 | }; | ||
| 240 | |||
| 241 | /* | ||
| 242 | * struct lp8788_backlight_platform_data | 228 | * struct lp8788_backlight_platform_data |
| 243 | * @name : backlight driver name. (default: "lcd-backlight") | 229 | * @name : backlight driver name. (default: "lcd-backlight") |
| 244 | * @initial_brightness : initial value of backlight brightness | 230 | * @initial_brightness : initial value of backlight brightness |
| @@ -248,8 +234,8 @@ struct lp8788_bl_pwm_data { | |||
| 248 | * @rise_time : brightness ramp up step time | 234 | * @rise_time : brightness ramp up step time |
| 249 | * @fall_time : brightness ramp down step time | 235 | * @fall_time : brightness ramp down step time |
| 250 | * @pwm_pol : pwm polarity setting when bl_mode is pwm based | 236 | * @pwm_pol : pwm polarity setting when bl_mode is pwm based |
| 251 | * @pwm_data : platform specific pwm generation functions | 237 | * @period_ns : platform specific pwm period value. unit is nano. |
| 252 | * only valid when bl_mode is pwm based | 238 | Only valid when bl_mode is LP8788_BL_COMB_PWM_BASED |
| 253 | */ | 239 | */ |
| 254 | struct lp8788_backlight_platform_data { | 240 | struct lp8788_backlight_platform_data { |
| 255 | char *name; | 241 | char *name; |
| @@ -259,8 +245,8 @@ struct lp8788_backlight_platform_data { | |||
| 259 | enum lp8788_bl_full_scale_current full_scale; | 245 | enum lp8788_bl_full_scale_current full_scale; |
| 260 | enum lp8788_bl_ramp_step rise_time; | 246 | enum lp8788_bl_ramp_step rise_time; |
| 261 | enum lp8788_bl_ramp_step fall_time; | 247 | enum lp8788_bl_ramp_step fall_time; |
| 262 | enum lp8788_bl_pwm_polarity pwm_pol; | 248 | enum pwm_polarity pwm_pol; |
| 263 | struct lp8788_bl_pwm_data pwm_data; | 249 | unsigned int period_ns; |
| 264 | }; | 250 | }; |
| 265 | 251 | ||
| 266 | /* | 252 | /* |
diff --git a/include/linux/mm.h b/include/linux/mm.h index e7c3f9a0111a..7acc9dc73c9f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -115,6 +115,8 @@ extern unsigned int kobjsize(const void *objp); | |||
| 115 | # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ | 115 | # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ |
| 116 | #elif defined(CONFIG_PARISC) | 116 | #elif defined(CONFIG_PARISC) |
| 117 | # define VM_GROWSUP VM_ARCH_1 | 117 | # define VM_GROWSUP VM_ARCH_1 |
| 118 | #elif defined(CONFIG_METAG) | ||
| 119 | # define VM_GROWSUP VM_ARCH_1 | ||
| 118 | #elif defined(CONFIG_IA64) | 120 | #elif defined(CONFIG_IA64) |
| 119 | # define VM_GROWSUP VM_ARCH_1 | 121 | # define VM_GROWSUP VM_ARCH_1 |
| 120 | #elif !defined(CONFIG_MMU) | 122 | #elif !defined(CONFIG_MMU) |
| @@ -1333,24 +1335,6 @@ extern void free_bootmem_with_active_regions(int nid, | |||
| 1333 | unsigned long max_low_pfn); | 1335 | unsigned long max_low_pfn); |
| 1334 | extern void sparse_memory_present_with_active_regions(int nid); | 1336 | extern void sparse_memory_present_with_active_regions(int nid); |
| 1335 | 1337 | ||
| 1336 | #define MOVABLEMEM_MAP_MAX MAX_NUMNODES | ||
| 1337 | struct movablemem_entry { | ||
| 1338 | unsigned long start_pfn; /* start pfn of memory segment */ | ||
| 1339 | unsigned long end_pfn; /* end pfn of memory segment (exclusive) */ | ||
| 1340 | }; | ||
| 1341 | |||
| 1342 | struct movablemem_map { | ||
| 1343 | bool acpi; /* true if using SRAT info */ | ||
| 1344 | int nr_map; | ||
| 1345 | struct movablemem_entry map[MOVABLEMEM_MAP_MAX]; | ||
| 1346 | nodemask_t numa_nodes_hotplug; /* on which nodes we specify memory */ | ||
| 1347 | nodemask_t numa_nodes_kernel; /* on which nodes kernel resides in */ | ||
| 1348 | }; | ||
| 1349 | |||
| 1350 | extern void __init insert_movablemem_map(unsigned long start_pfn, | ||
| 1351 | unsigned long end_pfn); | ||
| 1352 | extern int __init movablemem_map_overlap(unsigned long start_pfn, | ||
| 1353 | unsigned long end_pfn); | ||
| 1354 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ | 1338 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ |
| 1355 | 1339 | ||
| 1356 | #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ | 1340 | #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index fed3def62818..779cf7c4a3d1 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -33,8 +33,7 @@ struct ieee1394_device_id { | |||
| 33 | __u32 model_id; | 33 | __u32 model_id; |
| 34 | __u32 specifier_id; | 34 | __u32 specifier_id; |
| 35 | __u32 version; | 35 | __u32 version; |
| 36 | kernel_ulong_t driver_data | 36 | kernel_ulong_t driver_data; |
| 37 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 38 | }; | 37 | }; |
| 39 | 38 | ||
| 40 | 39 | ||
| @@ -148,8 +147,7 @@ struct hid_device_id { | |||
| 148 | __u16 group; | 147 | __u16 group; |
| 149 | __u32 vendor; | 148 | __u32 vendor; |
| 150 | __u32 product; | 149 | __u32 product; |
| 151 | kernel_ulong_t driver_data | 150 | kernel_ulong_t driver_data; |
| 152 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 153 | }; | 151 | }; |
| 154 | 152 | ||
| 155 | /* s390 CCW devices */ | 153 | /* s390 CCW devices */ |
| @@ -173,8 +171,6 @@ struct ccw_device_id { | |||
| 173 | struct ap_device_id { | 171 | struct ap_device_id { |
| 174 | __u16 match_flags; /* which fields to match against */ | 172 | __u16 match_flags; /* which fields to match against */ |
| 175 | __u8 dev_type; /* device type */ | 173 | __u8 dev_type; /* device type */ |
| 176 | __u8 pad1; | ||
| 177 | __u32 pad2; | ||
| 178 | kernel_ulong_t driver_info; | 174 | kernel_ulong_t driver_info; |
| 179 | }; | 175 | }; |
| 180 | 176 | ||
| @@ -184,13 +180,10 @@ struct ap_device_id { | |||
| 184 | struct css_device_id { | 180 | struct css_device_id { |
| 185 | __u8 match_flags; | 181 | __u8 match_flags; |
| 186 | __u8 type; /* subchannel type */ | 182 | __u8 type; /* subchannel type */ |
| 187 | __u16 pad2; | ||
| 188 | __u32 pad3; | ||
| 189 | kernel_ulong_t driver_data; | 183 | kernel_ulong_t driver_data; |
| 190 | }; | 184 | }; |
| 191 | 185 | ||
| 192 | #define ACPI_ID_LEN 16 /* only 9 bytes needed here, 16 bytes are used */ | 186 | #define ACPI_ID_LEN 9 |
| 193 | /* to workaround crosscompile issues */ | ||
| 194 | 187 | ||
| 195 | struct acpi_device_id { | 188 | struct acpi_device_id { |
| 196 | __u8 id[ACPI_ID_LEN]; | 189 | __u8 id[ACPI_ID_LEN]; |
| @@ -231,11 +224,7 @@ struct of_device_id | |||
| 231 | char name[32]; | 224 | char name[32]; |
| 232 | char type[32]; | 225 | char type[32]; |
| 233 | char compatible[128]; | 226 | char compatible[128]; |
| 234 | #ifdef __KERNEL__ | ||
| 235 | const void *data; | 227 | const void *data; |
| 236 | #else | ||
| 237 | kernel_ulong_t data; | ||
| 238 | #endif | ||
| 239 | }; | 228 | }; |
| 240 | 229 | ||
| 241 | /* VIO */ | 230 | /* VIO */ |
| @@ -260,24 +249,14 @@ struct pcmcia_device_id { | |||
| 260 | /* for pseudo multi-function devices */ | 249 | /* for pseudo multi-function devices */ |
| 261 | __u8 device_no; | 250 | __u8 device_no; |
| 262 | 251 | ||
| 263 | __u32 prod_id_hash[4] | 252 | __u32 prod_id_hash[4]; |
| 264 | __attribute__((aligned(sizeof(__u32)))); | ||
| 265 | 253 | ||
| 266 | /* not matched against in kernelspace*/ | 254 | /* not matched against in kernelspace*/ |
| 267 | #ifdef __KERNEL__ | ||
| 268 | const char * prod_id[4]; | 255 | const char * prod_id[4]; |
| 269 | #else | ||
| 270 | kernel_ulong_t prod_id[4] | ||
| 271 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 272 | #endif | ||
| 273 | 256 | ||
| 274 | /* not matched against */ | 257 | /* not matched against */ |
| 275 | kernel_ulong_t driver_info; | 258 | kernel_ulong_t driver_info; |
| 276 | #ifdef __KERNEL__ | ||
| 277 | char * cisfile; | 259 | char * cisfile; |
| 278 | #else | ||
| 279 | kernel_ulong_t cisfile; | ||
| 280 | #endif | ||
| 281 | }; | 260 | }; |
| 282 | 261 | ||
| 283 | #define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001 | 262 | #define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001 |
| @@ -373,8 +352,7 @@ struct sdio_device_id { | |||
| 373 | __u8 class; /* Standard interface or SDIO_ANY_ID */ | 352 | __u8 class; /* Standard interface or SDIO_ANY_ID */ |
| 374 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ | 353 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ |
| 375 | __u16 device; /* Device ID or SDIO_ANY_ID */ | 354 | __u16 device; /* Device ID or SDIO_ANY_ID */ |
| 376 | kernel_ulong_t driver_data /* Data private to the driver */ | 355 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 377 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 378 | }; | 356 | }; |
| 379 | 357 | ||
| 380 | /* SSB core, see drivers/ssb/ */ | 358 | /* SSB core, see drivers/ssb/ */ |
| @@ -420,8 +398,7 @@ struct virtio_device_id { | |||
| 420 | */ | 398 | */ |
| 421 | struct hv_vmbus_device_id { | 399 | struct hv_vmbus_device_id { |
| 422 | __u8 guid[16]; | 400 | __u8 guid[16]; |
| 423 | kernel_ulong_t driver_data /* Data private to the driver */ | 401 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 424 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 425 | }; | 402 | }; |
| 426 | 403 | ||
| 427 | /* rpmsg */ | 404 | /* rpmsg */ |
| @@ -440,8 +417,7 @@ struct rpmsg_device_id { | |||
| 440 | 417 | ||
| 441 | struct i2c_device_id { | 418 | struct i2c_device_id { |
| 442 | char name[I2C_NAME_SIZE]; | 419 | char name[I2C_NAME_SIZE]; |
| 443 | kernel_ulong_t driver_data /* Data private to the driver */ | 420 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 444 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 445 | }; | 421 | }; |
| 446 | 422 | ||
| 447 | /* spi */ | 423 | /* spi */ |
| @@ -451,8 +427,7 @@ struct i2c_device_id { | |||
| 451 | 427 | ||
| 452 | struct spi_device_id { | 428 | struct spi_device_id { |
| 453 | char name[SPI_NAME_SIZE]; | 429 | char name[SPI_NAME_SIZE]; |
| 454 | kernel_ulong_t driver_data /* Data private to the driver */ | 430 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 455 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 456 | }; | 431 | }; |
| 457 | 432 | ||
| 458 | /* dmi */ | 433 | /* dmi */ |
| @@ -484,15 +459,6 @@ struct dmi_strmatch { | |||
| 484 | char substr[79]; | 459 | char substr[79]; |
| 485 | }; | 460 | }; |
| 486 | 461 | ||
| 487 | #ifndef __KERNEL__ | ||
| 488 | struct dmi_system_id { | ||
| 489 | kernel_ulong_t callback; | ||
| 490 | kernel_ulong_t ident; | ||
| 491 | struct dmi_strmatch matches[4]; | ||
| 492 | kernel_ulong_t driver_data | ||
| 493 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 494 | }; | ||
| 495 | #else | ||
| 496 | struct dmi_system_id { | 462 | struct dmi_system_id { |
| 497 | int (*callback)(const struct dmi_system_id *); | 463 | int (*callback)(const struct dmi_system_id *); |
| 498 | const char *ident; | 464 | const char *ident; |
| @@ -506,7 +472,6 @@ struct dmi_system_id { | |||
| 506 | * error: storage size of '__mod_dmi_device_table' isn't known | 472 | * error: storage size of '__mod_dmi_device_table' isn't known |
| 507 | */ | 473 | */ |
| 508 | #define dmi_device_id dmi_system_id | 474 | #define dmi_device_id dmi_system_id |
| 509 | #endif | ||
| 510 | 475 | ||
| 511 | #define DMI_MATCH(a, b) { a, b } | 476 | #define DMI_MATCH(a, b) { a, b } |
| 512 | 477 | ||
| @@ -515,8 +480,7 @@ struct dmi_system_id { | |||
| 515 | 480 | ||
| 516 | struct platform_device_id { | 481 | struct platform_device_id { |
| 517 | char name[PLATFORM_NAME_SIZE]; | 482 | char name[PLATFORM_NAME_SIZE]; |
| 518 | kernel_ulong_t driver_data | 483 | kernel_ulong_t driver_data; |
| 519 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 520 | }; | 484 | }; |
| 521 | 485 | ||
| 522 | #define MDIO_MODULE_PREFIX "mdio:" | 486 | #define MDIO_MODULE_PREFIX "mdio:" |
| @@ -572,11 +536,7 @@ struct isapnp_device_id { | |||
| 572 | struct amba_id { | 536 | struct amba_id { |
| 573 | unsigned int id; | 537 | unsigned int id; |
| 574 | unsigned int mask; | 538 | unsigned int mask; |
| 575 | #ifndef __KERNEL__ | ||
| 576 | kernel_ulong_t data; | ||
| 577 | #else | ||
| 578 | void *data; | 539 | void *data; |
| 579 | #endif | ||
| 580 | }; | 540 | }; |
| 581 | 541 | ||
| 582 | /* | 542 | /* |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index f6eb4332ac92..4b02512e421c 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
| @@ -245,6 +245,7 @@ struct map_info { | |||
| 245 | unsigned long pfow_base; | 245 | unsigned long pfow_base; |
| 246 | unsigned long map_priv_1; | 246 | unsigned long map_priv_1; |
| 247 | unsigned long map_priv_2; | 247 | unsigned long map_priv_2; |
| 248 | struct device_node *device_node; | ||
| 248 | void *fldrv_priv; | 249 | void *fldrv_priv; |
| 249 | struct mtd_chip_driver *fldrv; | 250 | struct mtd_chip_driver *fldrv; |
| 250 | }; | 251 | }; |
| @@ -328,7 +329,7 @@ static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word | |||
| 328 | 329 | ||
| 329 | static inline map_word map_word_load(struct map_info *map, const void *ptr) | 330 | static inline map_word map_word_load(struct map_info *map, const void *ptr) |
| 330 | { | 331 | { |
| 331 | map_word r = {{0} }; | 332 | map_word r; |
| 332 | 333 | ||
| 333 | if (map_bankwidth_is_1(map)) | 334 | if (map_bankwidth_is_1(map)) |
| 334 | r.x[0] = *(unsigned char *)ptr; | 335 | r.x[0] = *(unsigned char *)ptr; |
| @@ -342,6 +343,8 @@ static inline map_word map_word_load(struct map_info *map, const void *ptr) | |||
| 342 | #endif | 343 | #endif |
| 343 | else if (map_bankwidth_is_large(map)) | 344 | else if (map_bankwidth_is_large(map)) |
| 344 | memcpy(r.x, ptr, map->bankwidth); | 345 | memcpy(r.x, ptr, map->bankwidth); |
| 346 | else | ||
| 347 | BUG(); | ||
| 345 | 348 | ||
| 346 | return r; | 349 | return r; |
| 347 | } | 350 | } |
| @@ -391,7 +394,7 @@ static inline map_word map_word_ff(struct map_info *map) | |||
| 391 | 394 | ||
| 392 | static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) | 395 | static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) |
| 393 | { | 396 | { |
| 394 | map_word uninitialized_var(r); | 397 | map_word r; |
| 395 | 398 | ||
| 396 | if (map_bankwidth_is_1(map)) | 399 | if (map_bankwidth_is_1(map)) |
| 397 | r.x[0] = __raw_readb(map->virt + ofs); | 400 | r.x[0] = __raw_readb(map->virt + ofs); |
| @@ -425,6 +428,8 @@ static inline void inline_map_write(struct map_info *map, const map_word datum, | |||
| 425 | #endif | 428 | #endif |
| 426 | else if (map_bankwidth_is_large(map)) | 429 | else if (map_bankwidth_is_large(map)) |
| 427 | memcpy_toio(map->virt+ofs, datum.x, map->bankwidth); | 430 | memcpy_toio(map->virt+ofs, datum.x, map->bankwidth); |
| 431 | else | ||
| 432 | BUG(); | ||
| 428 | mb(); | 433 | mb(); |
| 429 | } | 434 | } |
| 430 | 435 | ||
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 13441ddac33d..4b993d358dad 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -233,6 +233,7 @@ struct nfs4_layoutget_args { | |||
| 233 | struct inode *inode; | 233 | struct inode *inode; |
| 234 | struct nfs_open_context *ctx; | 234 | struct nfs_open_context *ctx; |
| 235 | nfs4_stateid stateid; | 235 | nfs4_stateid stateid; |
| 236 | unsigned long timestamp; | ||
| 236 | struct nfs4_layoutdriver_data layout; | 237 | struct nfs4_layoutdriver_data layout; |
| 237 | }; | 238 | }; |
| 238 | 239 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 31717bd287fd..f11c1c2609d5 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2802,6 +2802,7 @@ | |||
| 2802 | #define PCI_DEVICE_ID_INTEL_JAKETOWN_UBOX 0x3ce0 | 2802 | #define PCI_DEVICE_ID_INTEL_JAKETOWN_UBOX 0x3ce0 |
| 2803 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f | 2803 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f |
| 2804 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 | 2804 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 |
| 2805 | #define PCI_DEVICE_ID_INTEL_5100_19 0x65f3 | ||
| 2805 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 | 2806 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 |
| 2806 | #define PCI_DEVICE_ID_INTEL_5100_22 0x65f6 | 2807 | #define PCI_DEVICE_ID_INTEL_5100_22 0x65f6 |
| 2807 | #define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030 | 2808 | #define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030 |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 2381c973d897..a089a3c447fc 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
| @@ -176,9 +176,8 @@ pid_t pid_vnr(struct pid *pid); | |||
| 176 | 176 | ||
| 177 | #define do_each_pid_task(pid, type, task) \ | 177 | #define do_each_pid_task(pid, type, task) \ |
| 178 | do { \ | 178 | do { \ |
| 179 | struct hlist_node *pos___; \ | ||
| 180 | if ((pid) != NULL) \ | 179 | if ((pid) != NULL) \ |
| 181 | hlist_for_each_entry_rcu((task), pos___, \ | 180 | hlist_for_each_entry_rcu((task), \ |
| 182 | &(pid)->tasks[type], pids[type].node) { | 181 | &(pid)->tasks[type], pids[type].node) { |
| 183 | 182 | ||
| 184 | /* | 183 | /* |
diff --git a/include/linux/platform_data/elm.h b/include/linux/platform_data/elm.h new file mode 100644 index 000000000000..1bd5244d1dcd --- /dev/null +++ b/include/linux/platform_data/elm.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* | ||
| 2 | * BCH Error Location Module | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ | ||
| 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 | */ | ||
| 17 | |||
| 18 | #ifndef __ELM_H | ||
| 19 | #define __ELM_H | ||
| 20 | |||
| 21 | enum bch_ecc { | ||
| 22 | BCH4_ECC = 0, | ||
| 23 | BCH8_ECC, | ||
| 24 | }; | ||
| 25 | |||
| 26 | /* ELM support 8 error syndrome process */ | ||
| 27 | #define ERROR_VECTOR_MAX 8 | ||
| 28 | |||
| 29 | #define BCH8_ECC_OOB_BYTES 13 | ||
| 30 | #define BCH4_ECC_OOB_BYTES 7 | ||
| 31 | /* RBL requires 14 byte even though BCH8 uses only 13 byte */ | ||
| 32 | #define BCH8_SIZE (BCH8_ECC_OOB_BYTES + 1) | ||
| 33 | /* Uses 1 extra byte to handle erased pages */ | ||
| 34 | #define BCH4_SIZE (BCH4_ECC_OOB_BYTES + 1) | ||
| 35 | |||
| 36 | /** | ||
| 37 | * struct elm_errorvec - error vector for elm | ||
| 38 | * @error_reported: set true for vectors error is reported | ||
| 39 | * @error_uncorrectable: number of uncorrectable errors | ||
| 40 | * @error_count: number of correctable errors in the sector | ||
| 41 | * @error_loc: buffer for error location | ||
| 42 | * | ||
| 43 | */ | ||
| 44 | struct elm_errorvec { | ||
| 45 | bool error_reported; | ||
| 46 | bool error_uncorrectable; | ||
| 47 | int error_count; | ||
| 48 | int error_loc[ERROR_VECTOR_MAX]; | ||
| 49 | }; | ||
| 50 | |||
| 51 | void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc, | ||
| 52 | struct elm_errorvec *err_vec); | ||
| 53 | void elm_config(struct device *dev, enum bch_ecc bch_type); | ||
| 54 | #endif /* __ELM_H */ | ||
diff --git a/include/linux/platform_data/exynos_thermal.h b/include/linux/platform_data/exynos_thermal.h index a7bdb2f63b73..da7e6274b175 100644 --- a/include/linux/platform_data/exynos_thermal.h +++ b/include/linux/platform_data/exynos_thermal.h | |||
| @@ -53,6 +53,8 @@ struct freq_clip_table { | |||
| 53 | * struct exynos_tmu_platform_data | 53 | * struct exynos_tmu_platform_data |
| 54 | * @threshold: basic temperature for generating interrupt | 54 | * @threshold: basic temperature for generating interrupt |
| 55 | * 25 <= threshold <= 125 [unit: degree Celsius] | 55 | * 25 <= threshold <= 125 [unit: degree Celsius] |
| 56 | * @threshold_falling: differntial value for setting threshold | ||
| 57 | * of temperature falling interrupt. | ||
| 56 | * @trigger_levels: array for each interrupt levels | 58 | * @trigger_levels: array for each interrupt levels |
| 57 | * [unit: degree Celsius] | 59 | * [unit: degree Celsius] |
| 58 | * 0: temperature for trigger_level0 interrupt | 60 | * 0: temperature for trigger_level0 interrupt |
| @@ -97,6 +99,7 @@ struct freq_clip_table { | |||
| 97 | */ | 99 | */ |
| 98 | struct exynos_tmu_platform_data { | 100 | struct exynos_tmu_platform_data { |
| 99 | u8 threshold; | 101 | u8 threshold; |
| 102 | u8 threshold_falling; | ||
| 100 | u8 trigger_levels[4]; | 103 | u8 trigger_levels[4]; |
| 101 | bool trigger_level0_en; | 104 | bool trigger_level0_en; |
| 102 | bool trigger_level1_en; | 105 | bool trigger_level1_en; |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index c92dd28eaa6c..8089e35d47ac 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -445,8 +445,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 445 | 445 | ||
| 446 | /** | 446 | /** |
| 447 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 447 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
| 448 | * @tpos: the type * to use as a loop cursor. | 448 | * @pos: the type * to use as a loop cursor. |
| 449 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 450 | * @head: the head for your list. | 449 | * @head: the head for your list. |
| 451 | * @member: the name of the hlist_node within the struct. | 450 | * @member: the name of the hlist_node within the struct. |
| 452 | * | 451 | * |
| @@ -454,16 +453,16 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 454 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() | 453 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() |
| 455 | * as long as the traversal is guarded by rcu_read_lock(). | 454 | * as long as the traversal is guarded by rcu_read_lock(). |
| 456 | */ | 455 | */ |
| 457 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | 456 | #define hlist_for_each_entry_rcu(pos, head, member) \ |
| 458 | for (pos = rcu_dereference_raw(hlist_first_rcu(head)); \ | 457 | for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\ |
| 459 | pos && \ | 458 | typeof(*(pos)), member); \ |
| 460 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 459 | pos; \ |
| 461 | pos = rcu_dereference_raw(hlist_next_rcu(pos))) | 460 | pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\ |
| 461 | &(pos)->member)), typeof(*(pos)), member)) | ||
| 462 | 462 | ||
| 463 | /** | 463 | /** |
| 464 | * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type | 464 | * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type |
| 465 | * @tpos: the type * to use as a loop cursor. | 465 | * @pos: the type * to use as a loop cursor. |
| 466 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 467 | * @head: the head for your list. | 466 | * @head: the head for your list. |
| 468 | * @member: the name of the hlist_node within the struct. | 467 | * @member: the name of the hlist_node within the struct. |
| 469 | * | 468 | * |
| @@ -471,35 +470,36 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 471 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() | 470 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() |
| 472 | * as long as the traversal is guarded by rcu_read_lock(). | 471 | * as long as the traversal is guarded by rcu_read_lock(). |
| 473 | */ | 472 | */ |
| 474 | #define hlist_for_each_entry_rcu_bh(tpos, pos, head, member) \ | 473 | #define hlist_for_each_entry_rcu_bh(pos, head, member) \ |
| 475 | for (pos = rcu_dereference_bh((head)->first); \ | 474 | for (pos = hlist_entry_safe(rcu_dereference_bh(hlist_first_rcu(head)),\ |
| 476 | pos && \ | 475 | typeof(*(pos)), member); \ |
| 477 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 476 | pos; \ |
| 478 | pos = rcu_dereference_bh(pos->next)) | 477 | pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu(\ |
| 478 | &(pos)->member)), typeof(*(pos)), member)) | ||
| 479 | 479 | ||
| 480 | /** | 480 | /** |
| 481 | * hlist_for_each_entry_continue_rcu - iterate over a hlist continuing after current point | 481 | * hlist_for_each_entry_continue_rcu - iterate over a hlist continuing after current point |
| 482 | * @tpos: the type * to use as a loop cursor. | 482 | * @pos: the type * to use as a loop cursor. |
| 483 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 484 | * @member: the name of the hlist_node within the struct. | 483 | * @member: the name of the hlist_node within the struct. |
| 485 | */ | 484 | */ |
| 486 | #define hlist_for_each_entry_continue_rcu(tpos, pos, member) \ | 485 | #define hlist_for_each_entry_continue_rcu(pos, member) \ |
| 487 | for (pos = rcu_dereference((pos)->next); \ | 486 | for (pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ |
| 488 | pos && \ | 487 | typeof(*(pos)), member); \ |
| 489 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 488 | pos; \ |
| 490 | pos = rcu_dereference(pos->next)) | 489 | pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ |
| 490 | typeof(*(pos)), member)) | ||
| 491 | 491 | ||
| 492 | /** | 492 | /** |
| 493 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point | 493 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point |
| 494 | * @tpos: the type * to use as a loop cursor. | 494 | * @pos: the type * to use as a loop cursor. |
| 495 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 496 | * @member: the name of the hlist_node within the struct. | 495 | * @member: the name of the hlist_node within the struct. |
| 497 | */ | 496 | */ |
| 498 | #define hlist_for_each_entry_continue_rcu_bh(tpos, pos, member) \ | 497 | #define hlist_for_each_entry_continue_rcu_bh(pos, member) \ |
| 499 | for (pos = rcu_dereference_bh((pos)->next); \ | 498 | for (pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ |
| 500 | pos && \ | 499 | typeof(*(pos)), member); \ |
| 501 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 500 | pos; \ |
| 502 | pos = rcu_dereference_bh(pos->next)) | 501 | pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ |
| 502 | typeof(*(pos)), member)) | ||
| 503 | 503 | ||
| 504 | 504 | ||
| 505 | #endif /* __KERNEL__ */ | 505 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 4bd6c06eb28e..2d8bdaef9611 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -231,6 +231,41 @@ size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
| 231 | */ | 231 | */ |
| 232 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) | 232 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) |
| 233 | 233 | ||
| 234 | /* | ||
| 235 | * sg page iterator | ||
| 236 | * | ||
| 237 | * Iterates over sg entries page-by-page. On each successful iteration, | ||
| 238 | * @piter->page points to the current page, @piter->sg to the sg holding this | ||
| 239 | * page and @piter->sg_pgoffset to the page's page offset within the sg. The | ||
| 240 | * iteration will stop either when a maximum number of sg entries was reached | ||
| 241 | * or a terminating sg (sg_last(sg) == true) was reached. | ||
| 242 | */ | ||
| 243 | struct sg_page_iter { | ||
| 244 | struct page *page; /* current page */ | ||
| 245 | struct scatterlist *sg; /* sg holding the page */ | ||
| 246 | unsigned int sg_pgoffset; /* page offset within the sg */ | ||
| 247 | |||
| 248 | /* these are internal states, keep away */ | ||
| 249 | unsigned int __nents; /* remaining sg entries */ | ||
| 250 | int __pg_advance; /* nr pages to advance at the | ||
| 251 | * next step */ | ||
| 252 | }; | ||
| 253 | |||
| 254 | bool __sg_page_iter_next(struct sg_page_iter *piter); | ||
| 255 | void __sg_page_iter_start(struct sg_page_iter *piter, | ||
| 256 | struct scatterlist *sglist, unsigned int nents, | ||
| 257 | unsigned long pgoffset); | ||
| 258 | |||
| 259 | /** | ||
| 260 | * for_each_sg_page - iterate over the pages of the given sg list | ||
| 261 | * @sglist: sglist to iterate over | ||
| 262 | * @piter: page iterator to hold current page, sg, sg_pgoffset | ||
| 263 | * @nents: maximum number of sg entries to iterate over | ||
| 264 | * @pgoffset: starting page offset | ||
| 265 | */ | ||
| 266 | #define for_each_sg_page(sglist, piter, nents, pgoffset) \ | ||
| 267 | for (__sg_page_iter_start((piter), (sglist), (nents), (pgoffset)); \ | ||
| 268 | __sg_page_iter_next(piter);) | ||
| 234 | 269 | ||
| 235 | /* | 270 | /* |
| 236 | * Mapping sg iterator | 271 | * Mapping sg iterator |
| @@ -258,11 +293,11 @@ struct sg_mapping_iter { | |||
| 258 | void *addr; /* pointer to the mapped area */ | 293 | void *addr; /* pointer to the mapped area */ |
| 259 | size_t length; /* length of the mapped area */ | 294 | size_t length; /* length of the mapped area */ |
| 260 | size_t consumed; /* number of consumed bytes */ | 295 | size_t consumed; /* number of consumed bytes */ |
| 296 | struct sg_page_iter piter; /* page iterator */ | ||
| 261 | 297 | ||
| 262 | /* these are internal states, keep away */ | 298 | /* these are internal states, keep away */ |
| 263 | struct scatterlist *__sg; /* current entry */ | 299 | unsigned int __offset; /* offset within page */ |
| 264 | unsigned int __nents; /* nr of remaining entries */ | 300 | unsigned int __remaining; /* remaining bytes on page */ |
| 265 | unsigned int __offset; /* offset within sg */ | ||
| 266 | unsigned int __flags; | 301 | unsigned int __flags; |
| 267 | }; | 302 | }; |
| 268 | 303 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6853bf947fde..d35d2b6ddbfb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -346,11 +346,6 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | |||
| 346 | extern void set_dumpable(struct mm_struct *mm, int value); | 346 | extern void set_dumpable(struct mm_struct *mm, int value); |
| 347 | extern int get_dumpable(struct mm_struct *mm); | 347 | extern int get_dumpable(struct mm_struct *mm); |
| 348 | 348 | ||
| 349 | /* get/set_dumpable() values */ | ||
| 350 | #define SUID_DUMPABLE_DISABLED 0 | ||
| 351 | #define SUID_DUMPABLE_ENABLED 1 | ||
| 352 | #define SUID_DUMPABLE_SAFE 2 | ||
| 353 | |||
| 354 | /* mm flags */ | 349 | /* mm flags */ |
| 355 | /* dumpable bits */ | 350 | /* dumpable bits */ |
| 356 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | 351 | #define MMF_DUMPABLE 0 /* core dump is permitted */ |
diff --git a/include/linux/stmp3xxx_rtc_wdt.h b/include/linux/stmp3xxx_rtc_wdt.h new file mode 100644 index 000000000000..1dd12c96231b --- /dev/null +++ b/include/linux/stmp3xxx_rtc_wdt.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | /* | ||
| 2 | * stmp3xxx_rtc_wdt.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K. | ||
| 5 | * | ||
| 6 | * This file is released under the GPLv2. | ||
| 7 | */ | ||
| 8 | #ifndef __LINUX_STMP3XXX_RTC_WDT_H | ||
| 9 | #define __LINUX_STMP3XXX_RTC_WDT_H | ||
| 10 | |||
| 11 | struct stmp3xxx_wdt_pdata { | ||
| 12 | void (*wdt_set_timeout)(struct device *dev, u32 timeout); | ||
| 13 | }; | ||
| 14 | |||
| 15 | #endif /* __LINUX_STMP3XXX_RTC_WDT_H */ | ||
diff --git a/include/linux/sunrpc/addr.h b/include/linux/sunrpc/addr.h new file mode 100644 index 000000000000..07d8e53bedfc --- /dev/null +++ b/include/linux/sunrpc/addr.h | |||
| @@ -0,0 +1,170 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/linux/sunrpc/addr.h | ||
| 3 | * | ||
| 4 | * Various routines for copying and comparing sockaddrs and for | ||
| 5 | * converting them to and from presentation format. | ||
| 6 | */ | ||
| 7 | #ifndef _LINUX_SUNRPC_ADDR_H | ||
| 8 | #define _LINUX_SUNRPC_ADDR_H | ||
| 9 | |||
| 10 | #include <linux/socket.h> | ||
| 11 | #include <linux/in.h> | ||
| 12 | #include <linux/in6.h> | ||
| 13 | #include <net/ipv6.h> | ||
| 14 | |||
| 15 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); | ||
| 16 | size_t rpc_pton(struct net *, const char *, const size_t, | ||
| 17 | struct sockaddr *, const size_t); | ||
| 18 | char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); | ||
| 19 | size_t rpc_uaddr2sockaddr(struct net *, const char *, const size_t, | ||
| 20 | struct sockaddr *, const size_t); | ||
| 21 | |||
| 22 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) | ||
| 23 | { | ||
| 24 | switch (sap->sa_family) { | ||
| 25 | case AF_INET: | ||
| 26 | return ntohs(((struct sockaddr_in *)sap)->sin_port); | ||
| 27 | case AF_INET6: | ||
| 28 | return ntohs(((struct sockaddr_in6 *)sap)->sin6_port); | ||
| 29 | } | ||
| 30 | return 0; | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline void rpc_set_port(struct sockaddr *sap, | ||
| 34 | const unsigned short port) | ||
| 35 | { | ||
| 36 | switch (sap->sa_family) { | ||
| 37 | case AF_INET: | ||
| 38 | ((struct sockaddr_in *)sap)->sin_port = htons(port); | ||
| 39 | break; | ||
| 40 | case AF_INET6: | ||
| 41 | ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); | ||
| 42 | break; | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | #define IPV6_SCOPE_DELIMITER '%' | ||
| 47 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") | ||
| 48 | |||
| 49 | static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1, | ||
| 50 | const struct sockaddr *sap2) | ||
| 51 | { | ||
| 52 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
| 53 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
| 54 | |||
| 55 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline bool __rpc_copy_addr4(struct sockaddr *dst, | ||
| 59 | const struct sockaddr *src) | ||
| 60 | { | ||
| 61 | const struct sockaddr_in *ssin = (struct sockaddr_in *) src; | ||
| 62 | struct sockaddr_in *dsin = (struct sockaddr_in *) dst; | ||
| 63 | |||
| 64 | dsin->sin_family = ssin->sin_family; | ||
| 65 | dsin->sin_addr.s_addr = ssin->sin_addr.s_addr; | ||
| 66 | return true; | ||
| 67 | } | ||
| 68 | |||
| 69 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 70 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 71 | const struct sockaddr *sap2) | ||
| 72 | { | ||
| 73 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
| 74 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
| 75 | |||
| 76 | if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr)) | ||
| 77 | return false; | ||
| 78 | else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL) | ||
| 79 | return sin1->sin6_scope_id == sin2->sin6_scope_id; | ||
| 80 | |||
| 81 | return true; | ||
| 82 | } | ||
| 83 | |||
| 84 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 85 | const struct sockaddr *src) | ||
| 86 | { | ||
| 87 | const struct sockaddr_in6 *ssin6 = (const struct sockaddr_in6 *) src; | ||
| 88 | struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst; | ||
| 89 | |||
| 90 | dsin6->sin6_family = ssin6->sin6_family; | ||
| 91 | dsin6->sin6_addr = ssin6->sin6_addr; | ||
| 92 | dsin6->sin6_scope_id = ssin6->sin6_scope_id; | ||
| 93 | return true; | ||
| 94 | } | ||
| 95 | #else /* !(IS_ENABLED(CONFIG_IPV6) */ | ||
| 96 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 97 | const struct sockaddr *sap2) | ||
| 98 | { | ||
| 99 | return false; | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 103 | const struct sockaddr *src) | ||
| 104 | { | ||
| 105 | return false; | ||
| 106 | } | ||
| 107 | #endif /* !(IS_ENABLED(CONFIG_IPV6) */ | ||
| 108 | |||
| 109 | /** | ||
| 110 | * rpc_cmp_addr - compare the address portion of two sockaddrs. | ||
| 111 | * @sap1: first sockaddr | ||
| 112 | * @sap2: second sockaddr | ||
| 113 | * | ||
| 114 | * Just compares the family and address portion. Ignores port, but | ||
| 115 | * compares the scope if it's a link-local address. | ||
| 116 | * | ||
| 117 | * Returns true if the addrs are equal, false if they aren't. | ||
| 118 | */ | ||
| 119 | static inline bool rpc_cmp_addr(const struct sockaddr *sap1, | ||
| 120 | const struct sockaddr *sap2) | ||
| 121 | { | ||
| 122 | if (sap1->sa_family == sap2->sa_family) { | ||
| 123 | switch (sap1->sa_family) { | ||
| 124 | case AF_INET: | ||
| 125 | return __rpc_cmp_addr4(sap1, sap2); | ||
| 126 | case AF_INET6: | ||
| 127 | return __rpc_cmp_addr6(sap1, sap2); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | return false; | ||
| 131 | } | ||
| 132 | |||
| 133 | /** | ||
| 134 | * rpc_copy_addr - copy the address portion of one sockaddr to another | ||
| 135 | * @dst: destination sockaddr | ||
| 136 | * @src: source sockaddr | ||
| 137 | * | ||
| 138 | * Just copies the address portion and family. Ignores port, scope, etc. | ||
| 139 | * Caller is responsible for making certain that dst is large enough to hold | ||
| 140 | * the address in src. Returns true if address family is supported. Returns | ||
| 141 | * false otherwise. | ||
| 142 | */ | ||
| 143 | static inline bool rpc_copy_addr(struct sockaddr *dst, | ||
| 144 | const struct sockaddr *src) | ||
| 145 | { | ||
| 146 | switch (src->sa_family) { | ||
| 147 | case AF_INET: | ||
| 148 | return __rpc_copy_addr4(dst, src); | ||
| 149 | case AF_INET6: | ||
| 150 | return __rpc_copy_addr6(dst, src); | ||
| 151 | } | ||
| 152 | return false; | ||
| 153 | } | ||
| 154 | |||
| 155 | /** | ||
| 156 | * rpc_get_scope_id - return scopeid for a given sockaddr | ||
| 157 | * @sa: sockaddr to get scopeid from | ||
| 158 | * | ||
| 159 | * Returns the value of the sin6_scope_id for AF_INET6 addrs, or 0 if | ||
| 160 | * not an AF_INET6 address. | ||
| 161 | */ | ||
| 162 | static inline u32 rpc_get_scope_id(const struct sockaddr *sa) | ||
| 163 | { | ||
| 164 | if (sa->sa_family != AF_INET6) | ||
| 165 | return 0; | ||
| 166 | |||
| 167 | return ((struct sockaddr_in6 *) sa)->sin6_scope_id; | ||
| 168 | } | ||
| 169 | |||
| 170 | #endif /* _LINUX_SUNRPC_ADDR_H */ | ||
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 5dc9ee4d616e..303399b1ba59 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -83,6 +83,10 @@ struct cache_detail { | |||
| 83 | int (*cache_upcall)(struct cache_detail *, | 83 | int (*cache_upcall)(struct cache_detail *, |
| 84 | struct cache_head *); | 84 | struct cache_head *); |
| 85 | 85 | ||
| 86 | void (*cache_request)(struct cache_detail *cd, | ||
| 87 | struct cache_head *ch, | ||
| 88 | char **bpp, int *blen); | ||
| 89 | |||
| 86 | int (*cache_parse)(struct cache_detail *, | 90 | int (*cache_parse)(struct cache_detail *, |
| 87 | char *buf, int len); | 91 | char *buf, int len); |
| 88 | 92 | ||
| @@ -157,11 +161,7 @@ sunrpc_cache_update(struct cache_detail *detail, | |||
| 157 | struct cache_head *new, struct cache_head *old, int hash); | 161 | struct cache_head *new, struct cache_head *old, int hash); |
| 158 | 162 | ||
| 159 | extern int | 163 | extern int |
| 160 | sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h, | 164 | sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h); |
| 161 | void (*cache_request)(struct cache_detail *, | ||
| 162 | struct cache_head *, | ||
| 163 | char **, | ||
| 164 | int *)); | ||
| 165 | 165 | ||
| 166 | 166 | ||
| 167 | extern void cache_clean_deferred(void *owner); | 167 | extern void cache_clean_deferred(void *owner); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 34206b84d8da..2cf4ffaa3cd4 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -160,162 +160,11 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | |||
| 160 | int rpc_protocol(struct rpc_clnt *); | 160 | int rpc_protocol(struct rpc_clnt *); |
| 161 | struct net * rpc_net_ns(struct rpc_clnt *); | 161 | struct net * rpc_net_ns(struct rpc_clnt *); |
| 162 | size_t rpc_max_payload(struct rpc_clnt *); | 162 | size_t rpc_max_payload(struct rpc_clnt *); |
| 163 | unsigned long rpc_get_timeout(struct rpc_clnt *clnt); | ||
| 163 | void rpc_force_rebind(struct rpc_clnt *); | 164 | void rpc_force_rebind(struct rpc_clnt *); |
| 164 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 165 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 165 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 166 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
| 166 | int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); | 167 | int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 167 | 168 | ||
| 168 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); | ||
| 169 | size_t rpc_pton(struct net *, const char *, const size_t, | ||
| 170 | struct sockaddr *, const size_t); | ||
| 171 | char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); | ||
| 172 | size_t rpc_uaddr2sockaddr(struct net *, const char *, const size_t, | ||
| 173 | struct sockaddr *, const size_t); | ||
| 174 | |||
| 175 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) | ||
| 176 | { | ||
| 177 | switch (sap->sa_family) { | ||
| 178 | case AF_INET: | ||
| 179 | return ntohs(((struct sockaddr_in *)sap)->sin_port); | ||
| 180 | case AF_INET6: | ||
| 181 | return ntohs(((struct sockaddr_in6 *)sap)->sin6_port); | ||
| 182 | } | ||
| 183 | return 0; | ||
| 184 | } | ||
| 185 | |||
| 186 | static inline void rpc_set_port(struct sockaddr *sap, | ||
| 187 | const unsigned short port) | ||
| 188 | { | ||
| 189 | switch (sap->sa_family) { | ||
| 190 | case AF_INET: | ||
| 191 | ((struct sockaddr_in *)sap)->sin_port = htons(port); | ||
| 192 | break; | ||
| 193 | case AF_INET6: | ||
| 194 | ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); | ||
| 195 | break; | ||
| 196 | } | ||
| 197 | } | ||
| 198 | |||
| 199 | #define IPV6_SCOPE_DELIMITER '%' | ||
| 200 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") | ||
| 201 | |||
| 202 | static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1, | ||
| 203 | const struct sockaddr *sap2) | ||
| 204 | { | ||
| 205 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
| 206 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
| 207 | |||
| 208 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
| 209 | } | ||
| 210 | |||
| 211 | static inline bool __rpc_copy_addr4(struct sockaddr *dst, | ||
| 212 | const struct sockaddr *src) | ||
| 213 | { | ||
| 214 | const struct sockaddr_in *ssin = (struct sockaddr_in *) src; | ||
| 215 | struct sockaddr_in *dsin = (struct sockaddr_in *) dst; | ||
| 216 | |||
| 217 | dsin->sin_family = ssin->sin_family; | ||
| 218 | dsin->sin_addr.s_addr = ssin->sin_addr.s_addr; | ||
| 219 | return true; | ||
| 220 | } | ||
| 221 | |||
| 222 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 223 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 224 | const struct sockaddr *sap2) | ||
| 225 | { | ||
| 226 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
| 227 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
| 228 | |||
| 229 | if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr)) | ||
| 230 | return false; | ||
| 231 | else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL) | ||
| 232 | return sin1->sin6_scope_id == sin2->sin6_scope_id; | ||
| 233 | |||
| 234 | return true; | ||
| 235 | } | ||
| 236 | |||
| 237 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 238 | const struct sockaddr *src) | ||
| 239 | { | ||
| 240 | const struct sockaddr_in6 *ssin6 = (const struct sockaddr_in6 *) src; | ||
| 241 | struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst; | ||
| 242 | |||
| 243 | dsin6->sin6_family = ssin6->sin6_family; | ||
| 244 | dsin6->sin6_addr = ssin6->sin6_addr; | ||
| 245 | return true; | ||
| 246 | } | ||
| 247 | #else /* !(IS_ENABLED(CONFIG_IPV6) */ | ||
| 248 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 249 | const struct sockaddr *sap2) | ||
| 250 | { | ||
| 251 | return false; | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 255 | const struct sockaddr *src) | ||
| 256 | { | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif /* !(IS_ENABLED(CONFIG_IPV6) */ | ||
| 260 | |||
| 261 | /** | ||
| 262 | * rpc_cmp_addr - compare the address portion of two sockaddrs. | ||
| 263 | * @sap1: first sockaddr | ||
| 264 | * @sap2: second sockaddr | ||
| 265 | * | ||
| 266 | * Just compares the family and address portion. Ignores port, scope, etc. | ||
| 267 | * Returns true if the addrs are equal, false if they aren't. | ||
| 268 | */ | ||
| 269 | static inline bool rpc_cmp_addr(const struct sockaddr *sap1, | ||
| 270 | const struct sockaddr *sap2) | ||
| 271 | { | ||
| 272 | if (sap1->sa_family == sap2->sa_family) { | ||
| 273 | switch (sap1->sa_family) { | ||
| 274 | case AF_INET: | ||
| 275 | return __rpc_cmp_addr4(sap1, sap2); | ||
| 276 | case AF_INET6: | ||
| 277 | return __rpc_cmp_addr6(sap1, sap2); | ||
| 278 | } | ||
| 279 | } | ||
| 280 | return false; | ||
| 281 | } | ||
| 282 | |||
| 283 | /** | ||
| 284 | * rpc_copy_addr - copy the address portion of one sockaddr to another | ||
| 285 | * @dst: destination sockaddr | ||
| 286 | * @src: source sockaddr | ||
| 287 | * | ||
| 288 | * Just copies the address portion and family. Ignores port, scope, etc. | ||
| 289 | * Caller is responsible for making certain that dst is large enough to hold | ||
| 290 | * the address in src. Returns true if address family is supported. Returns | ||
| 291 | * false otherwise. | ||
| 292 | */ | ||
| 293 | static inline bool rpc_copy_addr(struct sockaddr *dst, | ||
| 294 | const struct sockaddr *src) | ||
| 295 | { | ||
| 296 | switch (src->sa_family) { | ||
| 297 | case AF_INET: | ||
| 298 | return __rpc_copy_addr4(dst, src); | ||
| 299 | case AF_INET6: | ||
| 300 | return __rpc_copy_addr6(dst, src); | ||
| 301 | } | ||
| 302 | return false; | ||
| 303 | } | ||
| 304 | |||
| 305 | /** | ||
| 306 | * rpc_get_scope_id - return scopeid for a given sockaddr | ||
| 307 | * @sa: sockaddr to get scopeid from | ||
| 308 | * | ||
| 309 | * Returns the value of the sin6_scope_id for AF_INET6 addrs, or 0 if | ||
| 310 | * not an AF_INET6 address. | ||
| 311 | */ | ||
| 312 | static inline u32 rpc_get_scope_id(const struct sockaddr *sa) | ||
| 313 | { | ||
| 314 | if (sa->sa_family != AF_INET6) | ||
| 315 | return 0; | ||
| 316 | |||
| 317 | return ((struct sockaddr_in6 *) sa)->sin6_scope_id; | ||
| 318 | } | ||
| 319 | |||
| 320 | #endif /* __KERNEL__ */ | 169 | #endif /* __KERNEL__ */ |
| 321 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 170 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 676ddf53b3ee..1f0216b9a6c9 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -50,6 +50,7 @@ struct svc_pool { | |||
| 50 | unsigned int sp_nrthreads; /* # of threads in pool */ | 50 | unsigned int sp_nrthreads; /* # of threads in pool */ |
| 51 | struct list_head sp_all_threads; /* all server threads */ | 51 | struct list_head sp_all_threads; /* all server threads */ |
| 52 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ | 52 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ |
| 53 | int sp_task_pending;/* has pending task */ | ||
| 53 | } ____cacheline_aligned_in_smp; | 54 | } ____cacheline_aligned_in_smp; |
| 54 | 55 | ||
| 55 | /* | 56 | /* |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 63988990bd36..15f9204ee70b 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -56,7 +56,7 @@ struct xdr_buf { | |||
| 56 | struct kvec head[1], /* RPC header + non-page data */ | 56 | struct kvec head[1], /* RPC header + non-page data */ |
| 57 | tail[1]; /* Appended after page data */ | 57 | tail[1]; /* Appended after page data */ |
| 58 | 58 | ||
| 59 | struct page ** pages; /* Array of contiguous pages */ | 59 | struct page ** pages; /* Array of pages */ |
| 60 | unsigned int page_base, /* Start of page data */ | 60 | unsigned int page_base, /* Start of page data */ |
| 61 | page_len, /* Length of page data */ | 61 | page_len, /* Length of page data */ |
| 62 | flags; /* Flags for data disposition */ | 62 | flags; /* Flags for data disposition */ |
| @@ -152,6 +152,7 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) | |||
| 152 | extern void xdr_shift_buf(struct xdr_buf *, size_t); | 152 | extern void xdr_shift_buf(struct xdr_buf *, size_t); |
| 153 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); | 153 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); |
| 154 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); | 154 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); |
| 155 | extern void xdr_buf_trim(struct xdr_buf *, unsigned int); | ||
| 155 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); | 156 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); |
| 156 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); | 157 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
| 157 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); | 158 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index fe82022478e7..f0bd7f90a90d 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
| @@ -74,6 +74,8 @@ enum thermal_trend { | |||
| 74 | THERMAL_TREND_STABLE, /* temperature is stable */ | 74 | THERMAL_TREND_STABLE, /* temperature is stable */ |
| 75 | THERMAL_TREND_RAISING, /* temperature is raising */ | 75 | THERMAL_TREND_RAISING, /* temperature is raising */ |
| 76 | THERMAL_TREND_DROPPING, /* temperature is dropping */ | 76 | THERMAL_TREND_DROPPING, /* temperature is dropping */ |
| 77 | THERMAL_TREND_RAISE_FULL, /* apply highest cooling action */ | ||
| 78 | THERMAL_TREND_DROP_FULL, /* apply lowest cooling action */ | ||
| 77 | }; | 79 | }; |
| 78 | 80 | ||
| 79 | /* Events supported by Thermal Netlink */ | 81 | /* Events supported by Thermal Netlink */ |
| @@ -121,6 +123,7 @@ struct thermal_zone_device_ops { | |||
| 121 | int (*set_trip_hyst) (struct thermal_zone_device *, int, | 123 | int (*set_trip_hyst) (struct thermal_zone_device *, int, |
| 122 | unsigned long); | 124 | unsigned long); |
| 123 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); | 125 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); |
| 126 | int (*set_emul_temp) (struct thermal_zone_device *, unsigned long); | ||
| 124 | int (*get_trend) (struct thermal_zone_device *, int, | 127 | int (*get_trend) (struct thermal_zone_device *, int, |
| 125 | enum thermal_trend *); | 128 | enum thermal_trend *); |
| 126 | int (*notify) (struct thermal_zone_device *, int, | 129 | int (*notify) (struct thermal_zone_device *, int, |
| @@ -163,6 +166,7 @@ struct thermal_zone_device { | |||
| 163 | int polling_delay; | 166 | int polling_delay; |
| 164 | int temperature; | 167 | int temperature; |
| 165 | int last_temperature; | 168 | int last_temperature; |
| 169 | int emul_temperature; | ||
| 166 | int passive; | 170 | int passive; |
| 167 | unsigned int forced_passive; | 171 | unsigned int forced_passive; |
| 168 | const struct thermal_zone_device_ops *ops; | 172 | const struct thermal_zone_device_ops *ops; |
| @@ -244,9 +248,11 @@ int thermal_register_governor(struct thermal_governor *); | |||
| 244 | void thermal_unregister_governor(struct thermal_governor *); | 248 | void thermal_unregister_governor(struct thermal_governor *); |
| 245 | 249 | ||
| 246 | #ifdef CONFIG_NET | 250 | #ifdef CONFIG_NET |
| 247 | extern int thermal_generate_netlink_event(u32 orig, enum events event); | 251 | extern int thermal_generate_netlink_event(struct thermal_zone_device *tz, |
| 252 | enum events event); | ||
| 248 | #else | 253 | #else |
| 249 | static inline int thermal_generate_netlink_event(u32 orig, enum events event) | 254 | static int thermal_generate_netlink_event(struct thermal_zone_device *tz, |
| 255 | enum events event) | ||
| 250 | { | 256 | { |
| 251 | return 0; | 257 | return 0; |
| 252 | } | 258 | } |
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index 3a9df2f43be6..2a3038ee17a3 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h | |||
| @@ -118,6 +118,13 @@ static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool noway | |||
| 118 | set_bit(WDOG_NO_WAY_OUT, &wdd->status); | 118 | set_bit(WDOG_NO_WAY_OUT, &wdd->status); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | /* Use the following function to check if a timeout value is invalid */ | ||
| 122 | static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t) | ||
| 123 | { | ||
| 124 | return ((wdd->max_timeout != 0) && | ||
| 125 | (t < wdd->min_timeout || t > wdd->max_timeout)); | ||
| 126 | } | ||
| 127 | |||
| 121 | /* Use the following functions to manipulate watchdog driver specific data */ | 128 | /* Use the following functions to manipulate watchdog driver specific data */ |
| 122 | static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) | 129 | static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) |
| 123 | { | 130 | { |
| @@ -130,6 +137,8 @@ static inline void *watchdog_get_drvdata(struct watchdog_device *wdd) | |||
| 130 | } | 137 | } |
| 131 | 138 | ||
| 132 | /* drivers/watchdog/watchdog_core.c */ | 139 | /* drivers/watchdog/watchdog_core.c */ |
| 140 | extern int watchdog_init_timeout(struct watchdog_device *wdd, | ||
| 141 | unsigned int timeout_parm, struct device *dev); | ||
| 133 | extern int watchdog_register_device(struct watchdog_device *); | 142 | extern int watchdog_register_device(struct watchdog_device *); |
| 134 | extern void watchdog_unregister_device(struct watchdog_device *); | 143 | extern void watchdog_unregister_device(struct watchdog_device *); |
| 135 | 144 | ||
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index b82a83aba311..9a9367c0c076 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -87,9 +87,9 @@ int inode_wait(void *); | |||
| 87 | void writeback_inodes_sb(struct super_block *, enum wb_reason reason); | 87 | void writeback_inodes_sb(struct super_block *, enum wb_reason reason); |
| 88 | void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, | 88 | void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, |
| 89 | enum wb_reason reason); | 89 | enum wb_reason reason); |
| 90 | int writeback_inodes_sb_if_idle(struct super_block *, enum wb_reason reason); | 90 | int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); |
| 91 | int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr, | 91 | int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, |
| 92 | enum wb_reason reason); | 92 | enum wb_reason reason); |
| 93 | void sync_inodes_sb(struct super_block *); | 93 | void sync_inodes_sb(struct super_block *); |
| 94 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, | 94 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, |
| 95 | enum wb_reason reason); | 95 | enum wb_reason reason); |
