diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bio.h | 10 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 6 | ||||
| -rw-r--r-- | include/linux/compiler-gcc.h | 8 | ||||
| -rw-r--r-- | include/linux/compiler.h | 6 | ||||
| -rw-r--r-- | include/linux/pci.h | 10 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 2 | 
6 files changed, 29 insertions, 13 deletions
| diff --git a/include/linux/bio.h b/include/linux/bio.h index 59ffaa68b11b..23ddf4b46a9b 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -71,7 +71,8 @@ static inline bool bio_has_data(struct bio *bio)  {  	if (bio &&  	    bio->bi_iter.bi_size && -	    bio_op(bio) != REQ_OP_DISCARD) +	    bio_op(bio) != REQ_OP_DISCARD && +	    bio_op(bio) != REQ_OP_SECURE_ERASE)  		return true;  	return false; @@ -79,7 +80,9 @@ static inline bool bio_has_data(struct bio *bio)  static inline bool bio_no_advance_iter(struct bio *bio)  { -	return bio_op(bio) == REQ_OP_DISCARD || bio_op(bio) == REQ_OP_WRITE_SAME; +	return bio_op(bio) == REQ_OP_DISCARD || +	       bio_op(bio) == REQ_OP_SECURE_ERASE || +	       bio_op(bio) == REQ_OP_WRITE_SAME;  }  static inline bool bio_is_rw(struct bio *bio) @@ -199,6 +202,9 @@ static inline unsigned bio_segments(struct bio *bio)  	if (bio_op(bio) == REQ_OP_DISCARD)  		return 1; +	if (bio_op(bio) == REQ_OP_SECURE_ERASE) +		return 1; +  	if (bio_op(bio) == REQ_OP_WRITE_SAME)  		return 1; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 2c210b6a7bcf..e79055c8b577 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -882,7 +882,7 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)  static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,  						     int op)  { -	if (unlikely(op == REQ_OP_DISCARD)) +	if (unlikely(op == REQ_OP_DISCARD || op == REQ_OP_SECURE_ERASE))  		return min(q->limits.max_discard_sectors, UINT_MAX >> 9);  	if (unlikely(op == REQ_OP_WRITE_SAME)) @@ -913,7 +913,9 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq,  	if (unlikely(rq->cmd_type != REQ_TYPE_FS))  		return q->limits.max_hw_sectors; -	if (!q->limits.chunk_sectors || (req_op(rq) == REQ_OP_DISCARD)) +	if (!q->limits.chunk_sectors || +	    req_op(rq) == REQ_OP_DISCARD || +	    req_op(rq) == REQ_OP_SECURE_ERASE)  		return blk_queue_get_max_sectors(q, req_op(rq));  	return min(blk_max_size_offset(q, offset), diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index e2949397c19b..8dbc8929a6a0 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -242,7 +242,11 @@   */  #define asm_volatile_goto(x...)	do { asm goto(x); asm (""); } while (0) -#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP +/* + * sparse (__CHECKER__) pretends to be gcc, but can't do constant + * folding in __builtin_bswap*() (yet), so don't set these for it. + */ +#if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__)  #if GCC_VERSION >= 40400  #define __HAVE_BUILTIN_BSWAP32__  #define __HAVE_BUILTIN_BSWAP64__ @@ -250,7 +254,7 @@  #if GCC_VERSION >= 40800  #define __HAVE_BUILTIN_BSWAP16__  #endif -#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */  #if GCC_VERSION >= 50000  #define KASAN_ABI_VERSION 4 diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 1bb954842725..436aa4e42221 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -527,13 +527,13 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s   * object's lifetime is managed by something other than RCU.  That   * "something other" might be reference counting or simple immortality.   * - * The seemingly unused void * variable is to validate @p is indeed a pointer - * type. All pointer types silently cast to void *. + * The seemingly unused size_t variable is to validate @p is indeed a pointer + * type by making sure it can be dereferenced.   */  #define lockless_dereference(p) \  ({ \  	typeof(p) _________p1 = READ_ONCE(p); \ -	__maybe_unused const void * const _________p2 = _________p1; \ +	size_t __maybe_unused __size_of_ptr = sizeof(*(p)); \  	smp_read_barrier_depends(); /* Dependency order vs. p above. */ \  	(_________p1); \  }) diff --git a/include/linux/pci.h b/include/linux/pci.h index 2599a980340f..fbc1fa625c3e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1251,10 +1251,12 @@ resource_size_t pcibios_iov_resource_alignment(struct pci_dev *dev, int resno);  int pci_set_vga_state(struct pci_dev *pdev, bool decode,  		      unsigned int command_bits, u32 flags); -#define PCI_IRQ_NOLEGACY	(1 << 0) /* don't use legacy interrupts */ -#define PCI_IRQ_NOMSI		(1 << 1) /* don't use MSI interrupts */ -#define PCI_IRQ_NOMSIX		(1 << 2) /* don't use MSI-X interrupts */ -#define PCI_IRQ_NOAFFINITY	(1 << 3) /* don't auto-assign affinity */ +#define PCI_IRQ_LEGACY		(1 << 0) /* allow legacy interrupts */ +#define PCI_IRQ_MSI		(1 << 1) /* allow MSI interrupts */ +#define PCI_IRQ_MSIX		(1 << 2) /* allow MSI-X interrupts */ +#define PCI_IRQ_AFFINITY	(1 << 3) /* auto-assign affinity */ +#define PCI_IRQ_ALL_TYPES \ +	(PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX)  /* kmem_cache style wrapper around pci_alloc_consistent() */ diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 697e160c78d0..a4f7203a9017 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -42,6 +42,8 @@ extern int proc_dostring(struct ctl_table *, int,  			 void __user *, size_t *, loff_t *);  extern int proc_dointvec(struct ctl_table *, int,  			 void __user *, size_t *, loff_t *); +extern int proc_douintvec(struct ctl_table *, int, +			 void __user *, size_t *, loff_t *);  extern int proc_dointvec_minmax(struct ctl_table *, int,  				void __user *, size_t *, loff_t *);  extern int proc_dointvec_jiffies(struct ctl_table *, int, |