diff options
| author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2016-05-17 21:12:50 -0400 |
|---|---|---|
| committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2016-05-17 21:12:50 -0400 |
| commit | e7ca7f9fa2cda220ba807620c992ce77c33a32ea (patch) | |
| tree | fb8a6c1abc638c5a79645f4b9f44ece7c67187b4 /include/linux | |
| parent | 5f0dfb7a9bcc8139958f59ecb9bbd7e738ae702d (diff) | |
| parent | d65c8fff867a6450c58ce31572e883148a445ddf (diff) | |
Merge branch 'fixes' into misc
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fscrypto.h | 9 | ||||
| -rw-r--r-- | include/linux/mm.h | 64 | ||||
| -rw-r--r-- | include/linux/pmem.h | 22 | ||||
| -rw-r--r-- | include/linux/seq_file.h | 13 | ||||
| -rw-r--r-- | include/linux/usb_usual.h | 2 |
5 files changed, 30 insertions, 80 deletions
diff --git a/include/linux/fscrypto.h b/include/linux/fscrypto.h index cd91f75de49b..6027f6bbb061 100644 --- a/include/linux/fscrypto.h +++ b/include/linux/fscrypto.h | |||
| @@ -263,9 +263,9 @@ static inline void fscrypt_set_d_op(struct dentry *dentry) | |||
| 263 | extern struct kmem_cache *fscrypt_info_cachep; | 263 | extern struct kmem_cache *fscrypt_info_cachep; |
| 264 | int fscrypt_initialize(void); | 264 | int fscrypt_initialize(void); |
| 265 | 265 | ||
| 266 | extern struct fscrypt_ctx *fscrypt_get_ctx(struct inode *); | 266 | extern struct fscrypt_ctx *fscrypt_get_ctx(struct inode *, gfp_t); |
| 267 | extern void fscrypt_release_ctx(struct fscrypt_ctx *); | 267 | extern void fscrypt_release_ctx(struct fscrypt_ctx *); |
| 268 | extern struct page *fscrypt_encrypt_page(struct inode *, struct page *); | 268 | extern struct page *fscrypt_encrypt_page(struct inode *, struct page *, gfp_t); |
| 269 | extern int fscrypt_decrypt_page(struct page *); | 269 | extern int fscrypt_decrypt_page(struct page *); |
| 270 | extern void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *, struct bio *); | 270 | extern void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *, struct bio *); |
| 271 | extern void fscrypt_pullback_bio_page(struct page **, bool); | 271 | extern void fscrypt_pullback_bio_page(struct page **, bool); |
| @@ -299,7 +299,8 @@ extern int fscrypt_fname_usr_to_disk(struct inode *, const struct qstr *, | |||
| 299 | #endif | 299 | #endif |
| 300 | 300 | ||
| 301 | /* crypto.c */ | 301 | /* crypto.c */ |
| 302 | static inline struct fscrypt_ctx *fscrypt_notsupp_get_ctx(struct inode *i) | 302 | static inline struct fscrypt_ctx *fscrypt_notsupp_get_ctx(struct inode *i, |
| 303 | gfp_t f) | ||
| 303 | { | 304 | { |
| 304 | return ERR_PTR(-EOPNOTSUPP); | 305 | return ERR_PTR(-EOPNOTSUPP); |
| 305 | } | 306 | } |
| @@ -310,7 +311,7 @@ static inline void fscrypt_notsupp_release_ctx(struct fscrypt_ctx *c) | |||
| 310 | } | 311 | } |
| 311 | 312 | ||
| 312 | static inline struct page *fscrypt_notsupp_encrypt_page(struct inode *i, | 313 | static inline struct page *fscrypt_notsupp_encrypt_page(struct inode *i, |
| 313 | struct page *p) | 314 | struct page *p, gfp_t f) |
| 314 | { | 315 | { |
| 315 | return ERR_PTR(-EOPNOTSUPP); | 316 | return ERR_PTR(-EOPNOTSUPP); |
| 316 | } | 317 | } |
diff --git a/include/linux/mm.h b/include/linux/mm.h index ffcff53e3b2b..a55e5be0894f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -1250,78 +1250,20 @@ long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, | |||
| 1250 | unsigned long start, unsigned long nr_pages, | 1250 | unsigned long start, unsigned long nr_pages, |
| 1251 | int write, int force, struct page **pages, | 1251 | int write, int force, struct page **pages, |
| 1252 | struct vm_area_struct **vmas); | 1252 | struct vm_area_struct **vmas); |
| 1253 | long get_user_pages6(unsigned long start, unsigned long nr_pages, | 1253 | long get_user_pages(unsigned long start, unsigned long nr_pages, |
| 1254 | int write, int force, struct page **pages, | 1254 | int write, int force, struct page **pages, |
| 1255 | struct vm_area_struct **vmas); | 1255 | struct vm_area_struct **vmas); |
| 1256 | long get_user_pages_locked6(unsigned long start, unsigned long nr_pages, | 1256 | long get_user_pages_locked(unsigned long start, unsigned long nr_pages, |
| 1257 | int write, int force, struct page **pages, int *locked); | 1257 | int write, int force, struct page **pages, int *locked); |
| 1258 | long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, | 1258 | long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, |
| 1259 | unsigned long start, unsigned long nr_pages, | 1259 | unsigned long start, unsigned long nr_pages, |
| 1260 | int write, int force, struct page **pages, | 1260 | int write, int force, struct page **pages, |
| 1261 | unsigned int gup_flags); | 1261 | unsigned int gup_flags); |
| 1262 | long get_user_pages_unlocked5(unsigned long start, unsigned long nr_pages, | 1262 | long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, |
| 1263 | int write, int force, struct page **pages); | 1263 | int write, int force, struct page **pages); |
| 1264 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 1264 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
| 1265 | struct page **pages); | 1265 | struct page **pages); |
| 1266 | 1266 | ||
| 1267 | /* suppress warnings from use in EXPORT_SYMBOL() */ | ||
| 1268 | #ifndef __DISABLE_GUP_DEPRECATED | ||
| 1269 | #define __gup_deprecated __deprecated | ||
| 1270 | #else | ||
| 1271 | #define __gup_deprecated | ||
| 1272 | #endif | ||
| 1273 | /* | ||
| 1274 | * These macros provide backward-compatibility with the old | ||
| 1275 | * get_user_pages() variants which took tsk/mm. These | ||
| 1276 | * functions/macros provide both compile-time __deprecated so we | ||
| 1277 | * can catch old-style use and not break the build. The actual | ||
| 1278 | * functions also have WARN_ON()s to let us know at runtime if | ||
| 1279 | * the get_user_pages() should have been the "remote" variant. | ||
| 1280 | * | ||
| 1281 | * These are hideous, but temporary. | ||
| 1282 | * | ||
| 1283 | * If you run into one of these __deprecated warnings, look | ||
| 1284 | * at how you are calling get_user_pages(). If you are calling | ||
| 1285 | * it with current/current->mm as the first two arguments, | ||
| 1286 | * simply remove those arguments. The behavior will be the same | ||
| 1287 | * as it is now. If you are calling it on another task, use | ||
| 1288 | * get_user_pages_remote() instead. | ||
| 1289 | * | ||
| 1290 | * Any questions? Ask Dave Hansen <dave@sr71.net> | ||
| 1291 | */ | ||
| 1292 | long | ||
| 1293 | __gup_deprecated | ||
| 1294 | get_user_pages8(struct task_struct *tsk, struct mm_struct *mm, | ||
| 1295 | unsigned long start, unsigned long nr_pages, | ||
| 1296 | int write, int force, struct page **pages, | ||
| 1297 | struct vm_area_struct **vmas); | ||
| 1298 | #define GUP_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, get_user_pages, ...) \ | ||
| 1299 | get_user_pages | ||
| 1300 | #define get_user_pages(...) GUP_MACRO(__VA_ARGS__, \ | ||
| 1301 | get_user_pages8, x, \ | ||
| 1302 | get_user_pages6, x, x, x, x, x)(__VA_ARGS__) | ||
| 1303 | |||
| 1304 | __gup_deprecated | ||
| 1305 | long get_user_pages_locked8(struct task_struct *tsk, struct mm_struct *mm, | ||
| 1306 | unsigned long start, unsigned long nr_pages, | ||
| 1307 | int write, int force, struct page **pages, | ||
| 1308 | int *locked); | ||
| 1309 | #define GUPL_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, get_user_pages_locked, ...) \ | ||
| 1310 | get_user_pages_locked | ||
| 1311 | #define get_user_pages_locked(...) GUPL_MACRO(__VA_ARGS__, \ | ||
| 1312 | get_user_pages_locked8, x, \ | ||
| 1313 | get_user_pages_locked6, x, x, x, x)(__VA_ARGS__) | ||
| 1314 | |||
| 1315 | __gup_deprecated | ||
| 1316 | long get_user_pages_unlocked7(struct task_struct *tsk, struct mm_struct *mm, | ||
| 1317 | unsigned long start, unsigned long nr_pages, | ||
| 1318 | int write, int force, struct page **pages); | ||
| 1319 | #define GUPU_MACRO(_1, _2, _3, _4, _5, _6, _7, get_user_pages_unlocked, ...) \ | ||
| 1320 | get_user_pages_unlocked | ||
| 1321 | #define get_user_pages_unlocked(...) GUPU_MACRO(__VA_ARGS__, \ | ||
| 1322 | get_user_pages_unlocked7, x, \ | ||
| 1323 | get_user_pages_unlocked5, x, x, x, x)(__VA_ARGS__) | ||
| 1324 | |||
| 1325 | /* Container for pinned pfns / pages */ | 1267 | /* Container for pinned pfns / pages */ |
| 1326 | struct frame_vector { | 1268 | struct frame_vector { |
| 1327 | unsigned int nr_allocated; /* Number of frames we have space for */ | 1269 | unsigned int nr_allocated; /* Number of frames we have space for */ |
diff --git a/include/linux/pmem.h b/include/linux/pmem.h index ac6d872ce067..57d146fe44dd 100644 --- a/include/linux/pmem.h +++ b/include/linux/pmem.h | |||
| @@ -72,6 +72,18 @@ static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) | |||
| 72 | } | 72 | } |
| 73 | #endif | 73 | #endif |
| 74 | 74 | ||
| 75 | static inline bool arch_has_pmem_api(void) | ||
| 76 | { | ||
| 77 | return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API); | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline int default_memcpy_from_pmem(void *dst, void __pmem const *src, | ||
| 81 | size_t size) | ||
| 82 | { | ||
| 83 | memcpy(dst, (void __force *) src, size); | ||
| 84 | return 0; | ||
| 85 | } | ||
| 86 | |||
| 75 | /* | 87 | /* |
| 76 | * memcpy_from_pmem - read from persistent memory with error handling | 88 | * memcpy_from_pmem - read from persistent memory with error handling |
| 77 | * @dst: destination buffer | 89 | * @dst: destination buffer |
| @@ -83,12 +95,10 @@ static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) | |||
| 83 | static inline int memcpy_from_pmem(void *dst, void __pmem const *src, | 95 | static inline int memcpy_from_pmem(void *dst, void __pmem const *src, |
| 84 | size_t size) | 96 | size_t size) |
| 85 | { | 97 | { |
| 86 | return arch_memcpy_from_pmem(dst, src, size); | 98 | if (arch_has_pmem_api()) |
| 87 | } | 99 | return arch_memcpy_from_pmem(dst, src, size); |
| 88 | 100 | else | |
| 89 | static inline bool arch_has_pmem_api(void) | 101 | return default_memcpy_from_pmem(dst, src, size); |
| 90 | { | ||
| 91 | return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API); | ||
| 92 | } | 102 | } |
| 93 | 103 | ||
| 94 | /** | 104 | /** |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index dde00defbaa5..f3d45dd42695 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
| @@ -7,13 +7,10 @@ | |||
| 7 | #include <linux/mutex.h> | 7 | #include <linux/mutex.h> |
| 8 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
| 9 | #include <linux/nodemask.h> | 9 | #include <linux/nodemask.h> |
| 10 | #include <linux/fs.h> | ||
| 11 | #include <linux/cred.h> | ||
| 10 | 12 | ||
| 11 | struct seq_operations; | 13 | struct seq_operations; |
| 12 | struct file; | ||
| 13 | struct path; | ||
| 14 | struct inode; | ||
| 15 | struct dentry; | ||
| 16 | struct user_namespace; | ||
| 17 | 14 | ||
| 18 | struct seq_file { | 15 | struct seq_file { |
| 19 | char *buf; | 16 | char *buf; |
| @@ -27,9 +24,7 @@ struct seq_file { | |||
| 27 | struct mutex lock; | 24 | struct mutex lock; |
| 28 | const struct seq_operations *op; | 25 | const struct seq_operations *op; |
| 29 | int poll_event; | 26 | int poll_event; |
| 30 | #ifdef CONFIG_USER_NS | 27 | const struct file *file; |
| 31 | struct user_namespace *user_ns; | ||
| 32 | #endif | ||
| 33 | void *private; | 28 | void *private; |
| 34 | }; | 29 | }; |
| 35 | 30 | ||
| @@ -147,7 +142,7 @@ int seq_release_private(struct inode *, struct file *); | |||
| 147 | static inline struct user_namespace *seq_user_ns(struct seq_file *seq) | 142 | static inline struct user_namespace *seq_user_ns(struct seq_file *seq) |
| 148 | { | 143 | { |
| 149 | #ifdef CONFIG_USER_NS | 144 | #ifdef CONFIG_USER_NS |
| 150 | return seq->user_ns; | 145 | return seq->file->f_cred->user_ns; |
| 151 | #else | 146 | #else |
| 152 | extern struct user_namespace init_user_ns; | 147 | extern struct user_namespace init_user_ns; |
| 153 | return &init_user_ns; | 148 | return &init_user_ns; |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 7f5f78bd15ad..245f57dbbb61 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
| @@ -79,6 +79,8 @@ | |||
| 79 | /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \ | 79 | /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \ |
| 80 | US_FLAG(MAX_SECTORS_240, 0x08000000) \ | 80 | US_FLAG(MAX_SECTORS_240, 0x08000000) \ |
| 81 | /* Sets max_sectors to 240 */ \ | 81 | /* Sets max_sectors to 240 */ \ |
| 82 | US_FLAG(NO_REPORT_LUNS, 0x10000000) \ | ||
| 83 | /* Cannot handle REPORT_LUNS */ \ | ||
| 82 | 84 | ||
| 83 | #define US_FLAG(name, value) US_FL_##name = value , | 85 | #define US_FLAG(name, value) US_FL_##name = value , |
| 84 | enum { US_DO_ALL_FLAGS }; | 86 | enum { US_DO_ALL_FLAGS }; |
