diff options
| author | Dan Williams <dan.j.williams@intel.com> | 2018-04-09 13:50:17 -0400 |
|---|---|---|
| committer | Dan Williams <dan.j.williams@intel.com> | 2018-04-09 13:50:17 -0400 |
| commit | e13e75b86ef2f88e3a47d672dd4c52a293efb95b (patch) | |
| tree | 2617aebd952d1aec09d323f6b2484b93f659e753 /include/linux | |
| parent | 1ed41b5696ccc3ff40a1dee39fe14eff273faf82 (diff) | |
| parent | 976431b02c2ef92ae3f8b6a7d699fc554025e118 (diff) | |
Merge branch 'for-4.17/dax' into libnvdimm-for-next
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dax.h | 42 | ||||
| -rw-r--r-- | include/linux/fs.h | 4 | ||||
| -rw-r--r-- | include/linux/sched/deadline.h | 6 | ||||
| -rw-r--r-- | include/linux/sched/isolation.h | 1 | ||||
| -rw-r--r-- | include/linux/sched/nohz.h | 4 | ||||
| -rw-r--r-- | include/linux/tick.h | 4 | ||||
| -rw-r--r-- | include/linux/wait_bit.h | 70 |
7 files changed, 111 insertions, 20 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index 0185ecdae135..f9eb22ad341e 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h | |||
| @@ -26,18 +26,42 @@ extern struct attribute_group dax_attribute_group; | |||
| 26 | 26 | ||
| 27 | #if IS_ENABLED(CONFIG_DAX) | 27 | #if IS_ENABLED(CONFIG_DAX) |
| 28 | struct dax_device *dax_get_by_host(const char *host); | 28 | struct dax_device *dax_get_by_host(const char *host); |
| 29 | struct dax_device *alloc_dax(void *private, const char *host, | ||
| 30 | const struct dax_operations *ops); | ||
| 29 | void put_dax(struct dax_device *dax_dev); | 31 | void put_dax(struct dax_device *dax_dev); |
| 32 | void kill_dax(struct dax_device *dax_dev); | ||
| 33 | void dax_write_cache(struct dax_device *dax_dev, bool wc); | ||
| 34 | bool dax_write_cache_enabled(struct dax_device *dax_dev); | ||
| 30 | #else | 35 | #else |
| 31 | static inline struct dax_device *dax_get_by_host(const char *host) | 36 | static inline struct dax_device *dax_get_by_host(const char *host) |
| 32 | { | 37 | { |
| 33 | return NULL; | 38 | return NULL; |
| 34 | } | 39 | } |
| 35 | 40 | static inline struct dax_device *alloc_dax(void *private, const char *host, | |
| 41 | const struct dax_operations *ops) | ||
| 42 | { | ||
| 43 | /* | ||
| 44 | * Callers should check IS_ENABLED(CONFIG_DAX) to know if this | ||
| 45 | * NULL is an error or expected. | ||
| 46 | */ | ||
| 47 | return NULL; | ||
| 48 | } | ||
| 36 | static inline void put_dax(struct dax_device *dax_dev) | 49 | static inline void put_dax(struct dax_device *dax_dev) |
| 37 | { | 50 | { |
| 38 | } | 51 | } |
| 52 | static inline void kill_dax(struct dax_device *dax_dev) | ||
| 53 | { | ||
| 54 | } | ||
| 55 | static inline void dax_write_cache(struct dax_device *dax_dev, bool wc) | ||
| 56 | { | ||
| 57 | } | ||
| 58 | static inline bool dax_write_cache_enabled(struct dax_device *dax_dev) | ||
| 59 | { | ||
| 60 | return false; | ||
| 61 | } | ||
| 39 | #endif | 62 | #endif |
| 40 | 63 | ||
| 64 | struct writeback_control; | ||
| 41 | int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); | 65 | int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); |
| 42 | #if IS_ENABLED(CONFIG_FS_DAX) | 66 | #if IS_ENABLED(CONFIG_FS_DAX) |
| 43 | int __bdev_dax_supported(struct super_block *sb, int blocksize); | 67 | int __bdev_dax_supported(struct super_block *sb, int blocksize); |
| @@ -57,6 +81,8 @@ static inline void fs_put_dax(struct dax_device *dax_dev) | |||
| 57 | } | 81 | } |
| 58 | 82 | ||
| 59 | struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev); | 83 | struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev); |
| 84 | int dax_writeback_mapping_range(struct address_space *mapping, | ||
| 85 | struct block_device *bdev, struct writeback_control *wbc); | ||
| 60 | #else | 86 | #else |
| 61 | static inline int bdev_dax_supported(struct super_block *sb, int blocksize) | 87 | static inline int bdev_dax_supported(struct super_block *sb, int blocksize) |
| 62 | { | 88 | { |
| @@ -76,22 +102,23 @@ static inline struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) | |||
| 76 | { | 102 | { |
| 77 | return NULL; | 103 | return NULL; |
| 78 | } | 104 | } |
| 105 | |||
| 106 | static inline int dax_writeback_mapping_range(struct address_space *mapping, | ||
| 107 | struct block_device *bdev, struct writeback_control *wbc) | ||
| 108 | { | ||
| 109 | return -EOPNOTSUPP; | ||
| 110 | } | ||
| 79 | #endif | 111 | #endif |
| 80 | 112 | ||
| 81 | int dax_read_lock(void); | 113 | int dax_read_lock(void); |
| 82 | void dax_read_unlock(int id); | 114 | void dax_read_unlock(int id); |
| 83 | struct dax_device *alloc_dax(void *private, const char *host, | ||
| 84 | const struct dax_operations *ops); | ||
| 85 | bool dax_alive(struct dax_device *dax_dev); | 115 | bool dax_alive(struct dax_device *dax_dev); |
| 86 | void kill_dax(struct dax_device *dax_dev); | ||
| 87 | void *dax_get_private(struct dax_device *dax_dev); | 116 | void *dax_get_private(struct dax_device *dax_dev); |
| 88 | long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages, | 117 | long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages, |
| 89 | void **kaddr, pfn_t *pfn); | 118 | void **kaddr, pfn_t *pfn); |
| 90 | size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, | 119 | size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, |
| 91 | size_t bytes, struct iov_iter *i); | 120 | size_t bytes, struct iov_iter *i); |
| 92 | void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); | 121 | void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); |
| 93 | void dax_write_cache(struct dax_device *dax_dev, bool wc); | ||
| 94 | bool dax_write_cache_enabled(struct dax_device *dax_dev); | ||
| 95 | 122 | ||
| 96 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, | 123 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, |
| 97 | const struct iomap_ops *ops); | 124 | const struct iomap_ops *ops); |
| @@ -121,7 +148,4 @@ static inline bool dax_mapping(struct address_space *mapping) | |||
| 121 | return mapping->host && IS_DAX(mapping->host); | 148 | return mapping->host && IS_DAX(mapping->host); |
| 122 | } | 149 | } |
| 123 | 150 | ||
| 124 | struct writeback_control; | ||
| 125 | int dax_writeback_mapping_range(struct address_space *mapping, | ||
| 126 | struct block_device *bdev, struct writeback_control *wbc); | ||
| 127 | #endif | 151 | #endif |
diff --git a/include/linux/fs.h b/include/linux/fs.h index c6baf767619e..a3bb2aedbc2b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -3130,6 +3130,10 @@ extern int simple_rmdir(struct inode *, struct dentry *); | |||
| 3130 | extern int simple_rename(struct inode *, struct dentry *, | 3130 | extern int simple_rename(struct inode *, struct dentry *, |
| 3131 | struct inode *, struct dentry *, unsigned int); | 3131 | struct inode *, struct dentry *, unsigned int); |
| 3132 | extern int noop_fsync(struct file *, loff_t, loff_t, int); | 3132 | extern int noop_fsync(struct file *, loff_t, loff_t, int); |
| 3133 | extern int noop_set_page_dirty(struct page *page); | ||
| 3134 | extern void noop_invalidatepage(struct page *page, unsigned int offset, | ||
| 3135 | unsigned int length); | ||
| 3136 | extern ssize_t noop_direct_IO(struct kiocb *iocb, struct iov_iter *iter); | ||
| 3133 | extern int simple_empty(struct dentry *); | 3137 | extern int simple_empty(struct dentry *); |
| 3134 | extern int simple_readpage(struct file *file, struct page *page); | 3138 | extern int simple_readpage(struct file *file, struct page *page); |
| 3135 | extern int simple_write_begin(struct file *file, struct address_space *mapping, | 3139 | extern int simple_write_begin(struct file *file, struct address_space *mapping, |
diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h index a5bc8728ead7..0cb034331cbb 100644 --- a/include/linux/sched/deadline.h +++ b/include/linux/sched/deadline.h | |||
| @@ -1,8 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _LINUX_SCHED_DEADLINE_H | ||
| 3 | #define _LINUX_SCHED_DEADLINE_H | ||
| 4 | |||
| 5 | #include <linux/sched.h> | ||
| 6 | 2 | ||
| 7 | /* | 3 | /* |
| 8 | * SCHED_DEADLINE tasks has negative priorities, reflecting | 4 | * SCHED_DEADLINE tasks has negative priorities, reflecting |
| @@ -28,5 +24,3 @@ static inline bool dl_time_before(u64 a, u64 b) | |||
| 28 | { | 24 | { |
| 29 | return (s64)(a - b) < 0; | 25 | return (s64)(a - b) < 0; |
| 30 | } | 26 | } |
| 31 | |||
| 32 | #endif /* _LINUX_SCHED_DEADLINE_H */ | ||
diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h index d849431c8060..4a6582c27dea 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h | |||
| @@ -12,6 +12,7 @@ enum hk_flags { | |||
| 12 | HK_FLAG_SCHED = (1 << 3), | 12 | HK_FLAG_SCHED = (1 << 3), |
| 13 | HK_FLAG_TICK = (1 << 4), | 13 | HK_FLAG_TICK = (1 << 4), |
| 14 | HK_FLAG_DOMAIN = (1 << 5), | 14 | HK_FLAG_DOMAIN = (1 << 5), |
| 15 | HK_FLAG_WQ = (1 << 6), | ||
| 15 | }; | 16 | }; |
| 16 | 17 | ||
| 17 | #ifdef CONFIG_CPU_ISOLATION | 18 | #ifdef CONFIG_CPU_ISOLATION |
diff --git a/include/linux/sched/nohz.h b/include/linux/sched/nohz.h index 3d3a97d9399d..094217273ff9 100644 --- a/include/linux/sched/nohz.h +++ b/include/linux/sched/nohz.h | |||
| @@ -37,8 +37,4 @@ extern void wake_up_nohz_cpu(int cpu); | |||
| 37 | static inline void wake_up_nohz_cpu(int cpu) { } | 37 | static inline void wake_up_nohz_cpu(int cpu) { } |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #ifdef CONFIG_NO_HZ_FULL | ||
| 41 | extern u64 scheduler_tick_max_deferment(void); | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #endif /* _LINUX_SCHED_NOHZ_H */ | 40 | #endif /* _LINUX_SCHED_NOHZ_H */ |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 7cc35921218e..7f8c9a127f5a 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
| @@ -113,7 +113,8 @@ enum tick_dep_bits { | |||
| 113 | 113 | ||
| 114 | #ifdef CONFIG_NO_HZ_COMMON | 114 | #ifdef CONFIG_NO_HZ_COMMON |
| 115 | extern bool tick_nohz_enabled; | 115 | extern bool tick_nohz_enabled; |
| 116 | extern int tick_nohz_tick_stopped(void); | 116 | extern bool tick_nohz_tick_stopped(void); |
| 117 | extern bool tick_nohz_tick_stopped_cpu(int cpu); | ||
| 117 | extern void tick_nohz_idle_enter(void); | 118 | extern void tick_nohz_idle_enter(void); |
| 118 | extern void tick_nohz_idle_exit(void); | 119 | extern void tick_nohz_idle_exit(void); |
| 119 | extern void tick_nohz_irq_exit(void); | 120 | extern void tick_nohz_irq_exit(void); |
| @@ -125,6 +126,7 @@ extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); | |||
| 125 | #else /* !CONFIG_NO_HZ_COMMON */ | 126 | #else /* !CONFIG_NO_HZ_COMMON */ |
| 126 | #define tick_nohz_enabled (0) | 127 | #define tick_nohz_enabled (0) |
| 127 | static inline int tick_nohz_tick_stopped(void) { return 0; } | 128 | static inline int tick_nohz_tick_stopped(void) { return 0; } |
| 129 | static inline int tick_nohz_tick_stopped_cpu(int cpu) { return 0; } | ||
| 128 | static inline void tick_nohz_idle_enter(void) { } | 130 | static inline void tick_nohz_idle_enter(void) { } |
| 129 | static inline void tick_nohz_idle_exit(void) { } | 131 | static inline void tick_nohz_idle_exit(void) { } |
| 130 | 132 | ||
diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 61b39eaf7cad..3fcdb75d69cf 100644 --- a/include/linux/wait_bit.h +++ b/include/linux/wait_bit.h | |||
| @@ -262,4 +262,74 @@ int wait_on_atomic_t(atomic_t *val, wait_atomic_t_action_f action, unsigned mode | |||
| 262 | return out_of_line_wait_on_atomic_t(val, action, mode); | 262 | return out_of_line_wait_on_atomic_t(val, action, mode); |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | extern void init_wait_var_entry(struct wait_bit_queue_entry *wbq_entry, void *var, int flags); | ||
| 266 | extern void wake_up_var(void *var); | ||
| 267 | extern wait_queue_head_t *__var_waitqueue(void *p); | ||
| 268 | |||
| 269 | #define ___wait_var_event(var, condition, state, exclusive, ret, cmd) \ | ||
| 270 | ({ \ | ||
| 271 | __label__ __out; \ | ||
| 272 | struct wait_queue_head *__wq_head = __var_waitqueue(var); \ | ||
| 273 | struct wait_bit_queue_entry __wbq_entry; \ | ||
| 274 | long __ret = ret; /* explicit shadow */ \ | ||
| 275 | \ | ||
| 276 | init_wait_var_entry(&__wbq_entry, var, \ | ||
| 277 | exclusive ? WQ_FLAG_EXCLUSIVE : 0); \ | ||
| 278 | for (;;) { \ | ||
| 279 | long __int = prepare_to_wait_event(__wq_head, \ | ||
| 280 | &__wbq_entry.wq_entry, \ | ||
| 281 | state); \ | ||
| 282 | if (condition) \ | ||
| 283 | break; \ | ||
| 284 | \ | ||
| 285 | if (___wait_is_interruptible(state) && __int) { \ | ||
| 286 | __ret = __int; \ | ||
| 287 | goto __out; \ | ||
| 288 | } \ | ||
| 289 | \ | ||
| 290 | cmd; \ | ||
| 291 | } \ | ||
| 292 | finish_wait(__wq_head, &__wbq_entry.wq_entry); \ | ||
| 293 | __out: __ret; \ | ||
| 294 | }) | ||
| 295 | |||
| 296 | #define __wait_var_event(var, condition) \ | ||
| 297 | ___wait_var_event(var, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ | ||
| 298 | schedule()) | ||
| 299 | |||
| 300 | #define wait_var_event(var, condition) \ | ||
| 301 | do { \ | ||
| 302 | might_sleep(); \ | ||
| 303 | if (condition) \ | ||
| 304 | break; \ | ||
| 305 | __wait_var_event(var, condition); \ | ||
| 306 | } while (0) | ||
| 307 | |||
| 308 | #define __wait_var_event_killable(var, condition) \ | ||
| 309 | ___wait_var_event(var, condition, TASK_KILLABLE, 0, 0, \ | ||
| 310 | schedule()) | ||
| 311 | |||
| 312 | #define wait_var_event_killable(var, condition) \ | ||
| 313 | ({ \ | ||
| 314 | int __ret = 0; \ | ||
| 315 | might_sleep(); \ | ||
| 316 | if (!(condition)) \ | ||
| 317 | __ret = __wait_var_event_killable(var, condition); \ | ||
| 318 | __ret; \ | ||
| 319 | }) | ||
| 320 | |||
| 321 | #define __wait_var_event_timeout(var, condition, timeout) \ | ||
| 322 | ___wait_var_event(var, ___wait_cond_timeout(condition), \ | ||
| 323 | TASK_UNINTERRUPTIBLE, 0, timeout, \ | ||
| 324 | __ret = schedule_timeout(__ret)) | ||
| 325 | |||
| 326 | #define wait_var_event_timeout(var, condition, timeout) \ | ||
| 327 | ({ \ | ||
| 328 | long __ret = timeout; \ | ||
| 329 | might_sleep(); \ | ||
| 330 | if (!___wait_cond_timeout(condition)) \ | ||
| 331 | __ret = __wait_var_event_timeout(var, condition, timeout); \ | ||
| 332 | __ret; \ | ||
| 333 | }) | ||
| 334 | |||
| 265 | #endif /* _LINUX_WAIT_BIT_H */ | 335 | #endif /* _LINUX_WAIT_BIT_H */ |
