diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blkdev.h | 14 | ||||
| -rw-r--r-- | include/linux/cpuidle.h | 4 | ||||
| -rw-r--r-- | include/linux/kernel.h | 12 | ||||
| -rw-r--r-- | include/linux/ktime.h | 7 | ||||
| -rw-r--r-- | include/linux/mmc/card.h | 1 | ||||
| -rw-r--r-- | include/linux/mv643xx_eth.h | 2 | ||||
| -rw-r--r-- | include/linux/nfs_fs.h | 5 | ||||
| -rw-r--r-- | include/linux/nfs_xdr.h | 2 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/xprt.h | 3 | ||||
| -rw-r--r-- | include/linux/time.h | 29 |
11 files changed, 62 insertions, 19 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 4e72a9d48232..4a2ab7c85393 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -601,7 +601,7 @@ static inline void blk_clear_rl_full(struct request_list *rl, bool sync) | |||
| 601 | * it already be started by driver. | 601 | * it already be started by driver. |
| 602 | */ | 602 | */ |
| 603 | #define RQ_NOMERGE_FLAGS \ | 603 | #define RQ_NOMERGE_FLAGS \ |
| 604 | (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) | 604 | (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD) |
| 605 | #define rq_mergeable(rq) \ | 605 | #define rq_mergeable(rq) \ |
| 606 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ | 606 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ |
| 607 | (((rq)->cmd_flags & REQ_DISCARD) || \ | 607 | (((rq)->cmd_flags & REQ_DISCARD) || \ |
| @@ -894,6 +894,8 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable); | |||
| 894 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 894 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
| 895 | 895 | ||
| 896 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 896 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
| 897 | extern int blk_bio_map_sg(struct request_queue *q, struct bio *bio, | ||
| 898 | struct scatterlist *sglist); | ||
| 897 | extern void blk_dump_rq_flags(struct request *, char *); | 899 | extern void blk_dump_rq_flags(struct request *, char *); |
| 898 | extern long nr_blockdev_pages(void); | 900 | extern long nr_blockdev_pages(void); |
| 899 | 901 | ||
| @@ -1139,6 +1141,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector | |||
| 1139 | & (lim->discard_granularity - 1); | 1141 | & (lim->discard_granularity - 1); |
| 1140 | } | 1142 | } |
| 1141 | 1143 | ||
| 1144 | static inline int bdev_discard_alignment(struct block_device *bdev) | ||
| 1145 | { | ||
| 1146 | struct request_queue *q = bdev_get_queue(bdev); | ||
| 1147 | |||
| 1148 | if (bdev != bdev->bd_contains) | ||
| 1149 | return bdev->bd_part->discard_alignment; | ||
| 1150 | |||
| 1151 | return q->limits.discard_alignment; | ||
| 1152 | } | ||
| 1153 | |||
| 1142 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) | 1154 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) |
| 1143 | { | 1155 | { |
| 1144 | if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1) | 1156 | if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1) |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 040b13b5c14a..279b1eaa8b73 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
| @@ -194,6 +194,10 @@ static inline int cpuidle_play_dead(void) {return -ENODEV; } | |||
| 194 | 194 | ||
| 195 | #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED | 195 | #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED |
| 196 | void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a); | 196 | void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a); |
| 197 | #else | ||
| 198 | static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a) | ||
| 199 | { | ||
| 200 | } | ||
| 197 | #endif | 201 | #endif |
| 198 | 202 | ||
| 199 | /****************************** | 203 | /****************************** |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 604382143bcf..594b419b7d20 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -82,10 +82,18 @@ | |||
| 82 | __x - (__x % (y)); \ | 82 | __x - (__x % (y)); \ |
| 83 | } \ | 83 | } \ |
| 84 | ) | 84 | ) |
| 85 | |||
| 86 | /* | ||
| 87 | * Divide positive or negative dividend by positive divisor and round | ||
| 88 | * to closest integer. Result is undefined for negative divisors. | ||
| 89 | */ | ||
| 85 | #define DIV_ROUND_CLOSEST(x, divisor)( \ | 90 | #define DIV_ROUND_CLOSEST(x, divisor)( \ |
| 86 | { \ | 91 | { \ |
| 87 | typeof(divisor) __divisor = divisor; \ | 92 | typeof(x) __x = x; \ |
| 88 | (((x) + ((__divisor) / 2)) / (__divisor)); \ | 93 | typeof(divisor) __d = divisor; \ |
| 94 | (((typeof(x))-1) >= 0 || (__x) >= 0) ? \ | ||
| 95 | (((__x) + ((__d) / 2)) / (__d)) : \ | ||
| 96 | (((__x) - ((__d) / 2)) / (__d)); \ | ||
| 89 | } \ | 97 | } \ |
| 90 | ) | 98 | ) |
| 91 | 99 | ||
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 603bec2913b0..06177ba10a16 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
| @@ -58,13 +58,6 @@ union ktime { | |||
| 58 | 58 | ||
| 59 | typedef union ktime ktime_t; /* Kill this */ | 59 | typedef union ktime ktime_t; /* Kill this */ |
| 60 | 60 | ||
| 61 | #define KTIME_MAX ((s64)~((u64)1 << 63)) | ||
| 62 | #if (BITS_PER_LONG == 64) | ||
| 63 | # define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) | ||
| 64 | #else | ||
| 65 | # define KTIME_SEC_MAX LONG_MAX | ||
| 66 | #endif | ||
| 67 | |||
| 68 | /* | 61 | /* |
| 69 | * ktime_t definitions when using the 64-bit scalar representation: | 62 | * ktime_t definitions when using the 64-bit scalar representation: |
| 70 | */ | 63 | */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 111aca5e97f3..4b27f9f503e4 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -239,6 +239,7 @@ struct mmc_card { | |||
| 239 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ | 239 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ |
| 240 | #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ | 240 | #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ |
| 241 | #define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ | 241 | #define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ |
| 242 | #define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */ | ||
| 242 | /* byte mode */ | 243 | /* byte mode */ |
| 243 | unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ | 244 | unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ |
| 244 | #define MMC_NO_POWER_NOTIFICATION 0 | 245 | #define MMC_NO_POWER_NOTIFICATION 0 |
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h index 51bf8ada6dc0..49258e0ed1c6 100644 --- a/include/linux/mv643xx_eth.h +++ b/include/linux/mv643xx_eth.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #define MV643XX_ETH_SIZE_REG_4 0x2224 | 15 | #define MV643XX_ETH_SIZE_REG_4 0x2224 |
| 16 | #define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290 | 16 | #define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290 |
| 17 | 17 | ||
| 18 | #define MV643XX_TX_CSUM_DEFAULT_LIMIT 0 | ||
| 19 | |||
| 18 | struct mv643xx_eth_shared_platform_data { | 20 | struct mv643xx_eth_shared_platform_data { |
| 19 | struct mbus_dram_target_info *dram; | 21 | struct mbus_dram_target_info *dram; |
| 20 | struct platform_device *shared_smi; | 22 | struct platform_device *shared_smi; |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 1f8fc7f9bcd8..4b03f56e280e 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -265,11 +265,6 @@ static inline const struct nfs_rpc_ops *NFS_PROTO(const struct inode *inode) | |||
| 265 | return NFS_SERVER(inode)->nfs_client->rpc_ops; | 265 | return NFS_SERVER(inode)->nfs_client->rpc_ops; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | static inline __be32 *NFS_COOKIEVERF(const struct inode *inode) | ||
| 269 | { | ||
| 270 | return NFS_I(inode)->cookieverf; | ||
| 271 | } | ||
| 272 | |||
| 273 | static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) | 268 | static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode) |
| 274 | { | 269 | { |
| 275 | struct nfs_server *nfss = NFS_SERVER(inode); | 270 | struct nfs_server *nfss = NFS_SERVER(inode); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index ac7c8ae254f2..be9cf3c7e79e 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -652,7 +652,7 @@ struct nfs_getaclargs { | |||
| 652 | }; | 652 | }; |
| 653 | 653 | ||
| 654 | /* getxattr ACL interface flags */ | 654 | /* getxattr ACL interface flags */ |
| 655 | #define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */ | 655 | #define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */ |
| 656 | struct nfs_getaclres { | 656 | struct nfs_getaclres { |
| 657 | size_t acl_len; | 657 | size_t acl_len; |
| 658 | size_t acl_data_offset; | 658 | size_t acl_data_offset; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index fc3526077348..6b4565c440c8 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2149,7 +2149,7 @@ | |||
| 2149 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 | 2149 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 |
| 2150 | #define PCI_DEVICE_ID_NX2_57800_VF 0x16a9 | 2150 | #define PCI_DEVICE_ID_NX2_57800_VF 0x16a9 |
| 2151 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa | 2151 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa |
| 2152 | #define PCI_DEVICE_ID_NX2_57840_MF 0x16ab | 2152 | #define PCI_DEVICE_ID_NX2_57840_MF 0x16a4 |
| 2153 | #define PCI_DEVICE_ID_NX2_5708S 0x16ac | 2153 | #define PCI_DEVICE_ID_NX2_5708S 0x16ac |
| 2154 | #define PCI_DEVICE_ID_NX2_57840_VF 0x16ad | 2154 | #define PCI_DEVICE_ID_NX2_57840_VF 0x16ad |
| 2155 | #define PCI_DEVICE_ID_NX2_57810_MF 0x16ae | 2155 | #define PCI_DEVICE_ID_NX2_57810_MF 0x16ae |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index cff40aa7db62..bf8c49ff7530 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -114,6 +114,7 @@ struct rpc_xprt_ops { | |||
| 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); | 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
| 115 | int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 115 | int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
| 116 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 116 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
| 117 | void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 117 | void (*rpcbind)(struct rpc_task *task); | 118 | void (*rpcbind)(struct rpc_task *task); |
| 118 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 119 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
| 119 | void (*connect)(struct rpc_task *task); | 120 | void (*connect)(struct rpc_task *task); |
| @@ -281,6 +282,8 @@ void xprt_connect(struct rpc_task *task); | |||
| 281 | void xprt_reserve(struct rpc_task *task); | 282 | void xprt_reserve(struct rpc_task *task); |
| 282 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); | 283 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
| 283 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | 284 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
| 285 | void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 286 | void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | ||
| 284 | int xprt_prepare_transmit(struct rpc_task *task); | 287 | int xprt_prepare_transmit(struct rpc_task *task); |
| 285 | void xprt_transmit(struct rpc_task *task); | 288 | void xprt_transmit(struct rpc_task *task); |
| 286 | void xprt_end_transmit(struct rpc_task *task); | 289 | void xprt_end_transmit(struct rpc_task *task); |
diff --git a/include/linux/time.h b/include/linux/time.h index c81c5e40fcb5..b51e664c83e7 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -107,11 +107,36 @@ static inline struct timespec timespec_sub(struct timespec lhs, | |||
| 107 | return ts_delta; | 107 | return ts_delta; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | #define KTIME_MAX ((s64)~((u64)1 << 63)) | ||
| 111 | #if (BITS_PER_LONG == 64) | ||
| 112 | # define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) | ||
| 113 | #else | ||
| 114 | # define KTIME_SEC_MAX LONG_MAX | ||
| 115 | #endif | ||
| 116 | |||
| 110 | /* | 117 | /* |
| 111 | * Returns true if the timespec is norm, false if denorm: | 118 | * Returns true if the timespec is norm, false if denorm: |
| 112 | */ | 119 | */ |
| 113 | #define timespec_valid(ts) \ | 120 | static inline bool timespec_valid(const struct timespec *ts) |
| 114 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) | 121 | { |
| 122 | /* Dates before 1970 are bogus */ | ||
| 123 | if (ts->tv_sec < 0) | ||
| 124 | return false; | ||
| 125 | /* Can't have more nanoseconds then a second */ | ||
| 126 | if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) | ||
| 127 | return false; | ||
| 128 | return true; | ||
| 129 | } | ||
| 130 | |||
| 131 | static inline bool timespec_valid_strict(const struct timespec *ts) | ||
| 132 | { | ||
| 133 | if (!timespec_valid(ts)) | ||
| 134 | return false; | ||
| 135 | /* Disallow values that could overflow ktime_t */ | ||
| 136 | if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX) | ||
| 137 | return false; | ||
| 138 | return true; | ||
| 139 | } | ||
| 115 | 140 | ||
| 116 | extern void read_persistent_clock(struct timespec *ts); | 141 | extern void read_persistent_clock(struct timespec *ts); |
| 117 | extern void read_boot_clock(struct timespec *ts); | 142 | extern void read_boot_clock(struct timespec *ts); |
