mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 06:02:33 +00:00
scst: Normalize core indentation and line wrapping
Normalize core indentation, operator spacing, pointer placement,
continuation alignment and long declarations, calls and expressions.
Keep changes at existing argument/operator boundaries and retain
literal contents, operand evaluation order and preprocessor branches.
Keep conditional directives at column zero; align their continued
operands independently.
Checkpatch reports SPACING, CODE_INDENT, POINTER_LOCATION. One example:
No space is necessary after a cast
Checkpatch reports SUSPECT_CODE_INDENT:
suspect code indent for conditional statements (24, 40)
Checkpatch reports SPACING, PARENTHESIS_ALIGNMENT, LINE_SPACING. One
example:
spaces preferred around that '|' (ctx:VxV)
Checkpatch reports PARENTHESIS_ALIGNMENT:
Alignment should match open parenthesis
Checkpatch reports SPACING, LONG_LINE. One example:
space required after that ',' (ctx:BxB)
Checkpatch reports LONG_LINE:
line length of 125 exceeds 100 columns
Checkpatch reports OPEN_ENDED_LINE:
Lines should not end with a '('
This commit is contained in:
+85
-78
@@ -38,7 +38,7 @@
|
||||
#include <linux/bio.h>
|
||||
#include <linux/blkdev.h> /* struct request_queue */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 21, 0) || \
|
||||
(defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 8)
|
||||
(defined(RHEL_MAJOR) && RHEL_MAJOR - 0 >= 8)
|
||||
#include <linux/blk-mq.h>
|
||||
#endif
|
||||
#include <linux/bsg-lib.h> /* struct bsg_job */
|
||||
@@ -102,6 +102,7 @@ static __always_inline unsigned long long rdtsc(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define tsc_khz 1000
|
||||
#endif
|
||||
|
||||
@@ -116,6 +117,7 @@ static inline struct bio_set *bioset_create_backport(unsigned int pool_size,
|
||||
WARN_ON_ONCE(flags != 0);
|
||||
return bioset_create(pool_size, front_pad);
|
||||
}
|
||||
|
||||
#define bioset_create bioset_create_backport
|
||||
#define BIOSET_NEED_BVECS 0
|
||||
#endif
|
||||
@@ -139,14 +141,14 @@ static inline void bio_set_dev(struct bio *bio, struct block_device *bdev)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
/*
|
||||
* See also commit 609be1066731 ("block: pass a block_device and opf to
|
||||
* bio_alloc_bioset") # v5.18
|
||||
*/
|
||||
static inline
|
||||
struct bio *bio_alloc_bioset_backport(struct block_device *bdev,
|
||||
unsigned short nr_vecs, unsigned int opf, gfp_t gfp_mask,
|
||||
unsigned short nr_vecs, unsigned int opf, gfp_t gfp_mask,
|
||||
struct bio_set *bs)
|
||||
{
|
||||
/*
|
||||
@@ -169,7 +171,7 @@ struct bio *bio_alloc_bioset_backport(struct block_device *bdev,
|
||||
*/
|
||||
static inline
|
||||
struct bio *bio_alloc_backport(struct block_device *bdev,
|
||||
unsigned short nr_vecs, unsigned int opf, gfp_t gfp_mask)
|
||||
unsigned short nr_vecs, unsigned int opf, gfp_t gfp_mask)
|
||||
{
|
||||
/*
|
||||
* Check that @bdev and @opf parameters are zeros.
|
||||
@@ -198,7 +200,7 @@ enum {
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 2))
|
||||
/*
|
||||
* See also commit 342a72a33407 ("block: Introduce the type blk_opf_t") # v6.0
|
||||
*/
|
||||
@@ -210,7 +212,7 @@ typedef unsigned int blk_opf_t;
|
||||
static inline unsigned int scst_blk_rq_cpu(struct request *rq)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8)
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8)
|
||||
return rq->cpu;
|
||||
#else
|
||||
return blk_mq_rq_cpu(rq);
|
||||
@@ -219,7 +221,7 @@ static inline unsigned int scst_blk_rq_cpu(struct request *rq)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
/*
|
||||
* See also commit e2e530867245 ("blk-mq: remove the done argument to
|
||||
* blk_execute_rq_nowait") # v5.19.
|
||||
@@ -249,7 +251,7 @@ void blk_execute_rq_nowait_backport(struct request *rq, bool at_head)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 2))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(10, 2))
|
||||
static inline unsigned int blk_mq_num_queues(const struct cpumask *mask,
|
||||
unsigned int max_queues)
|
||||
{
|
||||
@@ -274,7 +276,7 @@ static inline unsigned int blk_mq_num_online_queues(unsigned int max_queues)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
/*
|
||||
* See also commit 05bdb9965305 ("block: replace fmode_t with a block-specific
|
||||
* type for block open flags") # v6.5.
|
||||
@@ -294,7 +296,7 @@ struct blk_holder_ops {
|
||||
|
||||
static inline struct block_device *
|
||||
blkdev_get_by_path_backport(const char *path, blk_mode_t mode,
|
||||
void *holder, const struct blk_holder_ops *hops)
|
||||
void *holder, const struct blk_holder_ops *hops)
|
||||
{
|
||||
WARN_ON_ONCE(hops);
|
||||
|
||||
@@ -327,7 +329,7 @@ static inline void blkdev_put_backport(struct block_device *bdev, void *holder)
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(6, 6, 0) >> 8 || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 23)) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 5))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 5))
|
||||
/*
|
||||
* See also commit e719b4d15674 ("block: Provide bdev_open_* functions") # v6.7, v6.6.23.
|
||||
*/
|
||||
@@ -386,14 +388,14 @@ static inline loff_t bdev_nr_bytes_backport(struct block_device *bdev)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
/*
|
||||
* See also commit 44abff2c0b97 ("block: decouple REQ_OP_SECURE_ERASE
|
||||
* from REQ_OP_DISCARD") # v5.19.
|
||||
*/
|
||||
static inline int
|
||||
blkdev_issue_discard_backport(struct block_device *bdev, sector_t sector,
|
||||
sector_t nr_sects, gfp_t gfp_mask)
|
||||
sector_t nr_sects, gfp_t gfp_mask)
|
||||
{
|
||||
return blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, 0);
|
||||
}
|
||||
@@ -415,7 +417,7 @@ blkdev_issue_discard_backport(struct block_device *bdev, sector_t sector,
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(4, 9, 0) >> 8 || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 311)) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 0)) && \
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 0)) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
|
||||
/*
|
||||
@@ -467,7 +469,7 @@ static inline int bdev_validate_blocksize(struct block_device *bdev, int block_s
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) && \
|
||||
(!defined(RHEL_MAJOR) || \
|
||||
RHEL_MAJOR -0 == 7 && RHEL_MINOR -0 < 5) && \
|
||||
RHEL_MAJOR - 0 == 7 && RHEL_MINOR - 0 < 5) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
|
||||
static inline void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len)
|
||||
@@ -558,8 +560,9 @@ static inline ssize_t debugfs_attr_read(struct file *file, char __user *buf,
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
static inline ssize_t debugfs_attr_write(struct file *file,
|
||||
const char __user *buf, size_t len, loff_t *ppos)
|
||||
const char __user *buf, size_t len, loff_t *ppos)
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
@@ -762,7 +765,7 @@ kernel_write_backport(struct file *file, const void *buf, size_t count,
|
||||
/* <linux/iocontext.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 21, 0) || \
|
||||
(defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 8)
|
||||
(defined(RHEL_MAJOR) && RHEL_MAJOR - 0 >= 8)
|
||||
|
||||
static inline struct io_context *
|
||||
scst_get_task_io_context(struct task_struct *task,
|
||||
@@ -804,7 +807,7 @@ static inline u32 int_sqrt64(u64 x)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 6))
|
||||
static inline long get_user_pages_backport(unsigned long start,
|
||||
unsigned long nr_pages,
|
||||
unsigned int gup_flags,
|
||||
@@ -848,6 +851,7 @@ static inline long get_user_pages_backport(unsigned long start,
|
||||
return get_user_pages(start, nr_pages, gup_flags, pages, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define get_user_pages get_user_pages_backport
|
||||
#endif
|
||||
|
||||
@@ -890,7 +894,7 @@ static inline long pin_user_pages_backport(unsigned long start,
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 6))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(7, 6))
|
||||
/*
|
||||
* See also commit 5f256becd868 ("[NET]: Basic network namespace
|
||||
* infrastructure."; v2.6.24). a685e08987d1 ("Delay struct net freeing while
|
||||
@@ -937,7 +941,7 @@ static inline bool list_entry_in_list(const struct list_head *entry)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 1))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(8, 1))
|
||||
/*
|
||||
* See also commit 70b44595eafe ("mm, compaction: use free lists to quickly
|
||||
* locate a migration source") # v5.1.
|
||||
@@ -955,8 +959,8 @@ static inline int list_is_first(const struct list_head *list, const struct list_
|
||||
* keys").
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
(RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 2))
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
(RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 2))
|
||||
static inline void lockdep_register_key(struct lock_class_key *key)
|
||||
{
|
||||
}
|
||||
@@ -972,7 +976,7 @@ static inline void lockdep_unregister_key(struct lock_class_key *key)
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 3))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(8, 3))
|
||||
#undef rwlock_release
|
||||
#define rwlock_release(l, i) lock_release(l, 1, i)
|
||||
#undef mutex_release
|
||||
@@ -998,7 +1002,7 @@ static inline void mempool_destroy_backport(mempool_t *pool)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) && \
|
||||
(!defined(RHEL_MAJOR) || \
|
||||
(RHEL_MAJOR -0 == 7 && RHEL_MINOR -0 < 5)) && \
|
||||
(RHEL_MAJOR - 0 == 7 && RHEL_MINOR - 0 < 5)) && \
|
||||
!defined(_COMPAT_LINUX_MM_H)
|
||||
#if !defined(UEK_KABI_RENAME)
|
||||
/* See also commit a7c3e901a46f ("mm: introduce kv[mz]alloc helpers") # v4.12 */
|
||||
@@ -1069,7 +1073,7 @@ static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) && \
|
||||
(!defined(RHEL_MAJOR) || \
|
||||
RHEL_MAJOR -0 == 7 && RHEL_MINOR -0 < 7) && \
|
||||
RHEL_MAJOR - 0 == 7 && RHEL_MINOR - 0 < 7) && \
|
||||
!defined(CONFIG_SUSE_KERNEL) && \
|
||||
!defined(_COMPAT_LINUX_MM_H) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
@@ -1087,7 +1091,7 @@ static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(5, 10, 0) >> 8 || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 210)) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 0)) && \
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 0)) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
/*
|
||||
@@ -1118,7 +1122,7 @@ static inline void *vcalloc(size_t n, size_t size)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 3))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 3))
|
||||
/*
|
||||
* See also commit e33c267ab70d ("mm: shrinkers: provide shrinkers with
|
||||
* names") # v6.0.
|
||||
@@ -1144,7 +1148,7 @@ register_shrinker_backport(struct shrinker *shrinker, const char *fmt, ...)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(10, 1))
|
||||
#define SCST_NAMESPACE SCST
|
||||
#define SCST_QLA16_NAMESPACE QLA16GB
|
||||
#define SCST_QLA32_NAMESPACE QLA32GB
|
||||
@@ -1173,8 +1177,10 @@ enum nvmefc_fcp_datadir {
|
||||
NVMEFC_FCP_WRITE,
|
||||
NVMEFC_FCP_READ,
|
||||
};
|
||||
|
||||
struct nvme_fc_ersp_iu {
|
||||
};
|
||||
|
||||
struct nvmefc_fcp_req {
|
||||
void *cmdaddr;
|
||||
void *rspaddr;
|
||||
@@ -1214,7 +1220,7 @@ struct nvmefc_fcp_req {
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 9)) && \
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(7, 9)) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
|
||||
/*
|
||||
@@ -1256,9 +1262,9 @@ static __always_inline bool __must_check __must_check_overflow(bool overflow)
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 283)) && \
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(4, 19, 0) >> 8 || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 321)) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 10 || \
|
||||
RHEL_MAJOR -0 == 9 && RHEL_MINOR -0 < 3) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 10 || \
|
||||
RHEL_MAJOR - 0 == 9 && RHEL_MINOR - 0 < 3) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
|
||||
/*
|
||||
@@ -1317,8 +1323,8 @@ static __always_inline size_t __must_check size_add(size_t addend1, size_t adden
|
||||
#define __set_flex_counter(FAM, COUNT) \
|
||||
({ \
|
||||
*_Generic(__flex_counter(FAM), \
|
||||
void *: &(size_t){ 0 }, \
|
||||
default: __flex_counter(FAM)) = (COUNT); \
|
||||
void * : &(size_t){ 0 }, \
|
||||
default : __flex_counter(FAM)) = (COUNT); \
|
||||
})
|
||||
#endif
|
||||
|
||||
@@ -1326,7 +1332,7 @@ static __always_inline size_t __must_check size_add(size_t addend1, size_t adden
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 3))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(8, 3))
|
||||
/*
|
||||
* See also commit 09ed79d6d75f ("percpu_ref: introduce PERCPU_REF_ALLOW_REINIT
|
||||
* flag") # v5.3.
|
||||
@@ -1433,7 +1439,7 @@ static inline unsigned long percpu_ref_read(struct percpu_ref *ref)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) && \
|
||||
(!defined(RHEL_MAJOR) || \
|
||||
RHEL_MAJOR -0 == 7 && RHEL_MINOR -0 < 7)
|
||||
RHEL_MAJOR - 0 == 7 && RHEL_MINOR - 0 < 7)
|
||||
/*
|
||||
* See also commit 546a9d8519ed ("rcu: Export debug_init_rcu_head() and
|
||||
* debug_init_rcu_head()") # v3.16.
|
||||
@@ -1523,7 +1529,7 @@ static inline void kmem_cache_destroy_backport(struct kmem_cache *s)
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
|
||||
static inline struct kmem_cache *kmem_cache_create_usercopy(const char *name,
|
||||
unsigned int size, unsigned int align,
|
||||
unsigned int size, unsigned int align,
|
||||
unsigned long flags,
|
||||
unsigned int useroffset, unsigned int usersize,
|
||||
void (*ctor)(void *))
|
||||
@@ -1562,7 +1568,7 @@ static inline struct kmem_cache *kmem_cache_create_usercopy(const char *name,
|
||||
* Ubuntu uses ABI 999 for custom builds and 1000+ for derivatives;
|
||||
* retain the existing fallback for these independent ABI sequences.
|
||||
*/
|
||||
#define __default_gfp(a,...) a
|
||||
#define __default_gfp(a, ...) a
|
||||
#define default_gfp(...) __default_gfp(__VA_ARGS__ __VA_OPT__(,) GFP_KERNEL)
|
||||
#endif
|
||||
|
||||
@@ -1689,8 +1695,8 @@ static inline struct kmem_cache *kmem_cache_create_usercopy(const char *name,
|
||||
/* <linux/sockptr.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
|
||||
#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4
|
||||
#if !defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 4
|
||||
/* See also commit ba423fdaa589 ("net: add a new sockptr_t type") # v5.9 */
|
||||
static inline void __user *KERNEL_SOCKPTR(void *p)
|
||||
{
|
||||
@@ -1743,7 +1749,7 @@ static inline void *memdup_user_nul(const void __user *src, size_t len)
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(3, 18, 0) >> 8 || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 64)) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 7))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(7, 7))
|
||||
/*
|
||||
* See also commit 30035e45753b ("string: provide strscpy()") # v4.3, v3.18.64.
|
||||
*/
|
||||
@@ -1794,7 +1800,7 @@ static inline ssize_t strscpy(char *dest, const char *src, size_t count)
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(5, 4, 0) >> 8 || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 103)) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 5)) && \
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(8, 5)) && \
|
||||
!defined(UEK_KABI_RENAME)
|
||||
/*
|
||||
* See also commit 2efc459d06f1 ("sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output")
|
||||
@@ -1871,9 +1877,9 @@ struct t10_pi_tuple {
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 154)) && \
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(6, 1, 0) >> 8 || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 84)) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 9 || \
|
||||
RHEL_MAJOR -0 == 9 && RHEL_MINOR -0 < 3) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 9 || \
|
||||
RHEL_MAJOR - 0 == 9 && RHEL_MINOR - 0 < 3) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 17)) && \
|
||||
(!defined(UTS_UBUNTU_RELEASE_ABI) || \
|
||||
@@ -1902,14 +1908,14 @@ static inline int timer_delete_sync(struct timer_list *timer)
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 91)) && \
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(5, 15, 0) >> 8 || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 200)) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 9 || \
|
||||
RHEL_MAJOR -0 == 9 && RHEL_MINOR -0 < 3) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 9 || \
|
||||
RHEL_MAJOR - 0 == 9 && RHEL_MINOR - 0 < 3) && \
|
||||
(!defined(UTS_UBUNTU_RELEASE_ABI) || \
|
||||
((LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(5, 15, 0) >> 8 || \
|
||||
UTS_UBUNTU_RELEASE_ABI -0 < 93) && \
|
||||
UTS_UBUNTU_RELEASE_ABI - 0 < 93) && \
|
||||
(LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(5, 4, 0) >> 8 || \
|
||||
UTS_UBUNTU_RELEASE_ABI -0 < 206)))
|
||||
UTS_UBUNTU_RELEASE_ABI - 0 < 206)))
|
||||
/*
|
||||
* See also commit bb663f0f3c39 ("timers: Rename del_timer() to timer_delete()") # v6.2.
|
||||
* See also commit b086d1e82fcd # v6.1.91.
|
||||
@@ -1984,9 +1990,9 @@ static inline int timer_shutdown(struct timer_list *timer)
|
||||
* timer_container_of()") # v6.16.
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 16, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 9 || \
|
||||
RHEL_MAJOR -0 == 9 && RHEL_MINOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 10 && RHEL_MINOR -0 < 2)
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 9 || \
|
||||
RHEL_MAJOR - 0 == 9 && RHEL_MINOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 10 && RHEL_MINOR - 0 < 2)
|
||||
#define timer_container_of from_timer
|
||||
#endif
|
||||
|
||||
@@ -2013,7 +2019,7 @@ iov_iter_kvec_backport(struct iov_iter *i, unsigned int direction,
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) || \
|
||||
(defined(RHEL_MAJOR) && \
|
||||
(RHEL_MAJOR -0 > 8 || (RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 >= 2)))
|
||||
(RHEL_MAJOR - 0 > 8 || (RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 >= 2)))
|
||||
/*
|
||||
* For iov_iter_kvec() implementations that have a WARN_ON(direction &
|
||||
* ~(READ | WRITE)) statement. See also commit aa563d7bca6e ("iov_iter:
|
||||
@@ -2031,8 +2037,8 @@ iov_iter_kvec_backport(struct iov_iter *i, unsigned int direction,
|
||||
/* <linux/unaligned.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4)
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 4)
|
||||
/* Only use get_unaligned_be24() if reading p - 1 is allowed. */
|
||||
static inline u32 get_unaligned_be24(const u8 *const p)
|
||||
{
|
||||
@@ -2055,6 +2061,7 @@ static inline struct ib_pd *ib_alloc_pd_backport(struct ib_device *device)
|
||||
{
|
||||
return ib_alloc_pd(device);
|
||||
}
|
||||
|
||||
#define ib_alloc_pd(device, flags) \
|
||||
({ \
|
||||
(void)(flags), ib_alloc_pd_backport(device); \
|
||||
@@ -2096,7 +2103,7 @@ static inline u8 driver_byte(u32 result)
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || \
|
||||
(defined(RHEL_RELEASE_CODE) && \
|
||||
RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(8, 3))
|
||||
RHEL_RELEASE_CODE - 0 >= RHEL_RELEASE_VERSION(8, 3))
|
||||
/*
|
||||
* See also patch "[SCSI] bidirectional command support" (commit ID
|
||||
* 6f9a35e2dafa). See also commit ae3d56d81507 ("scsi: remove bidirectional
|
||||
@@ -2110,7 +2117,7 @@ static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) && \
|
||||
(!defined(RHEL_MAJOR) || \
|
||||
RHEL_MAJOR -0 == 7 && RHEL_MINOR -0 < 7)
|
||||
RHEL_MAJOR - 0 == 7 && RHEL_MINOR - 0 < 7)
|
||||
/* See also commit b54197c43db8 ("virtio_scsi: use cmd_size") # v3.16. */
|
||||
static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd)
|
||||
{
|
||||
@@ -2132,7 +2139,7 @@ static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd)
|
||||
* v5.14-rc1).
|
||||
*/
|
||||
static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc,
|
||||
u8 key, u8 asc, u8 ascq)
|
||||
u8 key, u8 asc, u8 ascq)
|
||||
{
|
||||
scsi_build_sense_buffer(desc, scmd->sense_buffer, key, asc, ascq);
|
||||
scmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
|
||||
@@ -2145,8 +2152,8 @@ static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc,
|
||||
!(LINUX_VERSION_CODE >> 8 == KERNEL_VERSION(5, 10, 0) >> 8 && \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 203)) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7) || \
|
||||
RHEL_RELEASE_CODE -0 == RHEL_RELEASE_VERSION(9, 0)) && \
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(8, 7) || \
|
||||
RHEL_RELEASE_CODE - 0 == RHEL_RELEASE_VERSION(9, 0)) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 17) || \
|
||||
!defined(SB_I_SKIP_SYNC))
|
||||
@@ -2171,16 +2178,16 @@ static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \
|
||||
(defined(RHEL_RELEASE_CODE) && \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7)) || \
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(8, 7)) || \
|
||||
(defined(UEK_KABI_RENAME) && \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||
static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
|
||||
{
|
||||
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 7
|
||||
#if defined(RHEL_MAJOR) && RHEL_MAJOR - 0 == 7
|
||||
WARN_ON_ONCE(true);
|
||||
return 0;
|
||||
#else
|
||||
@@ -2209,7 +2216,7 @@ static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd)
|
||||
!(LINUX_VERSION_CODE >> 8 == KERNEL_VERSION(5, 15, 0) >> 8 && \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 136)) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) && \
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 1)) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
/*
|
||||
@@ -2265,7 +2272,7 @@ static inline void scsi_req_init(struct request *rq)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
|
||||
rq->cmd_type = REQ_TYPE_BLOCK_PC;
|
||||
rq->__data_len = 0;
|
||||
rq->__sector = (sector_t) -1;
|
||||
rq->__sector = (sector_t)-1;
|
||||
rq->biotail = NULL;
|
||||
rq->bio = NULL;
|
||||
memset(rq->__cmd, 0, sizeof(rq->__cmd));
|
||||
@@ -2283,9 +2290,9 @@ static inline void scsi_req_init(struct request *rq)
|
||||
* upstream kernel.
|
||||
*/
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) && \
|
||||
!defined(CONFIG_SUSE_KERNEL)) || \
|
||||
(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) && \
|
||||
defined(CONFIG_SUSE_KERNEL))
|
||||
!defined(CONFIG_SUSE_KERNEL)) || \
|
||||
(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) && \
|
||||
defined(CONFIG_SUSE_KERNEL))
|
||||
static inline void *bsg_job_sense(struct fc_bsg_job *job)
|
||||
{
|
||||
return job->req->sense;
|
||||
@@ -2346,9 +2353,9 @@ static inline void *bsg_job_sense(struct bsg_job *job)
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 9 || \
|
||||
RHEL_MAJOR -0 == 9 && RHEL_MINOR -0 < 3) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 9 || \
|
||||
RHEL_MAJOR - 0 == 9 && RHEL_MINOR - 0 < 3) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
/*
|
||||
@@ -2360,8 +2367,8 @@ fc_host_fpin_rcv_backport(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf,
|
||||
u8 event_acknowledge)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 2)
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 2)
|
||||
/*
|
||||
* See also commit c39e0af64bce ("scsi: scsi_transport_fc: Add FPIN fc event
|
||||
* codes") # v5.2
|
||||
@@ -2392,8 +2399,8 @@ static inline int fc_block_rport(struct fc_rport *rport)
|
||||
|
||||
/* See also commit a7dff3ad4787 ("scsi: fc: add FPIN ELS definition") # v5.2 */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
(RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 2)) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
(RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 2)) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
|
||||
#define ELS_FPIN 0x16
|
||||
@@ -2404,8 +2411,8 @@ static inline int fc_block_rport(struct fc_rport *rport)
|
||||
* ELS requests").
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
(RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4)) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
(RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 4)) && \
|
||||
(!defined(UEK_KABI_RENAME) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0))
|
||||
#define ELS_RDP 0x18
|
||||
|
||||
+10
-8
@@ -4034,7 +4034,7 @@ static inline unsigned int scst_cmd_get_cdb_len(const struct scst_cmd *cmd)
|
||||
}
|
||||
|
||||
void scst_cmd_set_ext_cdb(struct scst_cmd *cmd,
|
||||
const u8 *ext_cdb, unsigned int ext_cdb_len, gfp_t gfp_mask);
|
||||
const u8 *ext_cdb, unsigned int ext_cdb_len, gfp_t gfp_mask);
|
||||
|
||||
/* Returns cmd's session */
|
||||
static inline struct scst_session *scst_cmd_get_session(const struct scst_cmd *cmd)
|
||||
@@ -4134,8 +4134,10 @@ static inline s64 scst_cmd_get_data_len(const struct scst_cmd *cmd)
|
||||
/* Returns true, if cmd needs DIF buffer */
|
||||
static inline bool scst_cmd_needs_dif_buf(const struct scst_cmd *cmd)
|
||||
{
|
||||
return (scst_get_dif_action(scst_get_scst_dif_actions(cmd->cmd_dif_actions)) != SCST_DIF_ACTION_NONE) ||
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) != SCST_DIF_ACTION_NONE);
|
||||
return (scst_get_dif_action(scst_get_scst_dif_actions(cmd->cmd_dif_actions)) !=
|
||||
SCST_DIF_ACTION_NONE) ||
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) !=
|
||||
SCST_DIF_ACTION_NONE);
|
||||
}
|
||||
|
||||
/* Returns length of DIF buffer of this cmd */
|
||||
@@ -4883,7 +4885,7 @@ static inline void sg_clear(struct scatterlist *sg)
|
||||
memset(sg, 0, sizeof(*sg));
|
||||
#if defined(CONFIG_DEBUG_SG) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) && \
|
||||
(!defined(RHEL_MAJOR) && RHEL_MAJOR -0 < 8)
|
||||
(!defined(RHEL_MAJOR) && RHEL_MAJOR - 0 < 8)
|
||||
sg->sg_magic = SG_MAGIC;
|
||||
#endif
|
||||
}
|
||||
@@ -4965,7 +4967,7 @@ static inline void scst_put_buf(struct scst_cmd *cmd, void *buf)
|
||||
* !!! only inside code bound to the corresponding data SG cnt! !!!
|
||||
*/
|
||||
static inline u8 *scst_get_dif_buf(struct scst_cmd *cmd, struct scatterlist **psg,
|
||||
int *length)
|
||||
int *length)
|
||||
{
|
||||
u8 *buf;
|
||||
struct scatterlist *sg;
|
||||
@@ -5025,7 +5027,7 @@ static inline int scst_get_sg_buf_first(struct scst_cmd *cmd, u8 **buf,
|
||||
}
|
||||
|
||||
static inline int scst_get_sg_buf_next(struct scst_cmd *cmd, u8 **buf,
|
||||
struct scatterlist *sg, int sg_cnt)
|
||||
struct scatterlist *sg, int sg_cnt)
|
||||
{
|
||||
return __scst_get_buf(cmd, sg_cnt, buf);
|
||||
}
|
||||
@@ -5654,7 +5656,7 @@ __scst_scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 3))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 3))
|
||||
if (WARN_ON_ONCE(sense && sense_len != SCSI_SENSE_BUFFERSIZE))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -5662,7 +5664,7 @@ __scst_scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
return scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense,
|
||||
timeout, retries, opf, /*resid=*/NULL);
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8)
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8)
|
||||
return scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense,
|
||||
/*sshdr=*/NULL, timeout, retries, opf,
|
||||
/*rq_flags=*/0, /*resid=*/NULL);
|
||||
|
||||
@@ -87,7 +87,7 @@ struct scst_event_notify_done {
|
||||
|
||||
#ifdef __KERNEL__
|
||||
void scst_event_queue(uint32_t event_code, const char *issuer_name,
|
||||
struct scst_event_entry *e);
|
||||
struct scst_event_entry *e);
|
||||
#endif
|
||||
|
||||
/*************************************************************
|
||||
@@ -145,6 +145,7 @@ struct scst_event_stpg_descr {
|
||||
uint8_t dg_name[64];
|
||||
uint8_t tg_name[64];
|
||||
};
|
||||
|
||||
struct scst_event_stpg_payload {
|
||||
aligned_u64 stpg_cmd_tag;
|
||||
uint8_t device_name[64];
|
||||
@@ -154,7 +155,7 @@ struct scst_event_stpg_payload {
|
||||
|
||||
#define SCST_EVENT_REG_VIRT_DEV 6
|
||||
struct scst_event_reg_vdev_payload {
|
||||
uint8_t device_name[SCST_MAX_NAME+10];
|
||||
uint8_t device_name[SCST_MAX_NAME + 10];
|
||||
};
|
||||
|
||||
#endif /* __SCST_EVENT_H */
|
||||
|
||||
+10
-8
@@ -71,18 +71,20 @@ enum sgv_clustering_types {
|
||||
sgv_full_clustering,
|
||||
};
|
||||
|
||||
struct sgv_pool *sgv_pool_create_node(const char *name,
|
||||
enum sgv_clustering_types clustering_type, int single_alloc_pages,
|
||||
bool shared, int purge_interval, int nodeid);
|
||||
struct sgv_pool *sgv_pool_create_node(const char *name, enum sgv_clustering_types clustering_type,
|
||||
int single_alloc_pages, bool shared, int purge_interval,
|
||||
int nodeid);
|
||||
static inline struct sgv_pool *sgv_pool_create(const char *name,
|
||||
enum sgv_clustering_types clustered, int single_alloc_pages,
|
||||
bool shared, int purge_interval)
|
||||
enum sgv_clustering_types clustered,
|
||||
int single_alloc_pages, bool shared,
|
||||
int purge_interval)
|
||||
{
|
||||
return sgv_pool_create_node(name, clustered, single_alloc_pages,
|
||||
shared, purge_interval, NUMA_NO_NODE);
|
||||
}
|
||||
|
||||
struct sgv_pool *sgv_pool_create(const char *name,
|
||||
enum sgv_clustering_types clustered, int single_alloc_pages,
|
||||
enum sgv_clustering_types clustered, int single_alloc_pages,
|
||||
bool shared, int purge_interval);
|
||||
void sgv_pool_del(struct sgv_pool *pool);
|
||||
|
||||
@@ -92,11 +94,11 @@ void sgv_pool_put(struct sgv_pool *pool);
|
||||
void sgv_pool_flush(struct sgv_pool *pool);
|
||||
|
||||
void sgv_pool_set_allocator(struct sgv_pool *pool,
|
||||
struct page *(*alloc_pages_fn)(struct scatterlist *, gfp_t, void *),
|
||||
struct page *(*alloc_pages_fn)(struct scatterlist *, gfp_t, void *),
|
||||
void (*free_pages_fn)(struct scatterlist *, int, void *));
|
||||
|
||||
struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size,
|
||||
gfp_t gfp_mask, int flags, int *count,
|
||||
gfp_t gfp_mask, int flags, int *count,
|
||||
struct sgv_pool_obj **sgv, struct scst_mem_lim *mem_lim, void *priv);
|
||||
void sgv_pool_free(struct sgv_pool_obj *obj, struct scst_mem_lim *mem_lim);
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ static int tape_attach(struct scst_device *dev)
|
||||
0 /* Mode Page 0 */,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) || \
|
||||
(defined(RHEL_RELEASE_CODE) && \
|
||||
RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(9, 5))
|
||||
RHEL_RELEASE_CODE - 0 >= RHEL_RELEASE_VERSION(9, 5))
|
||||
0 /* Sub Page */,
|
||||
#endif
|
||||
buffer, buffer_size,
|
||||
|
||||
@@ -46,7 +46,7 @@ static void dev_user_unjam_cmd(struct scst_user_cmd *ucmd, int busy, unsigned lo
|
||||
#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
|
||||
#warning HIGHMEM kernel configurations are not supported by this module, \
|
||||
because nowadays it is not worth the effort. Consider changing \
|
||||
VMSPLIT option or use a 64-bit configuration instead. See README file \
|
||||
VMSPLIT option or use a 64 - bit configuration instead. See README file \
|
||||
for details.
|
||||
#endif
|
||||
#endif
|
||||
@@ -4034,7 +4034,7 @@ static int __init init_scst_user(void)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
dev_user_sysfs_class = class_create(THIS_MODULE, DEV_USER_NAME);
|
||||
#else
|
||||
dev_user_sysfs_class = class_create(DEV_USER_NAME);
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/atomic.h>
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) || \
|
||||
(defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 9)
|
||||
(defined(RHEL_MAJOR) && RHEL_MAJOR - 0 >= 9)
|
||||
#include <linux/blk-integrity.h>
|
||||
#endif
|
||||
#include <linux/kthread.h>
|
||||
@@ -320,12 +320,12 @@ int vdisk_blockio_flush(struct block_device *bdev, gfp_t gfp_mask, bool report_e
|
||||
goto out;
|
||||
} else {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4)
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 4)
|
||||
res = blkdev_issue_flush(bdev, gfp_mask, NULL);
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \
|
||||
RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 6)
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR - 0 < 8 || \
|
||||
RHEL_MAJOR - 0 == 8 && RHEL_MINOR - 0 < 6)
|
||||
res = blkdev_issue_flush(bdev, gfp_mask);
|
||||
#else
|
||||
res = blkdev_issue_flush(bdev);
|
||||
@@ -454,7 +454,7 @@ static int vdisk_check_tp_support(struct scst_vdisk_dev *virt_dev)
|
||||
if (virt_dev->blockio) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
dev_tp = blk_queue_discard(bdev_get_queue(bdev_desc.bdev));
|
||||
#else
|
||||
dev_tp = !!bdev_max_discard_sectors(bdev_desc.bdev);
|
||||
@@ -880,7 +880,7 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev)
|
||||
bi_profile_name = bi->name;
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 6))
|
||||
bi_profile_name = bi->profile->name;
|
||||
#else
|
||||
bi_profile_name = blk_integrity_profile_name(bi);
|
||||
@@ -1820,7 +1820,7 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p)
|
||||
PRINT_ERROR("FORMAT UNIT: too small parameters list header %d (dev %s)",
|
||||
length, dev->virt_name);
|
||||
scst_set_cmd_error(cmd,
|
||||
SCST_LOAD_SENSE(scst_sense_parameter_list_length_invalid));
|
||||
SCST_LOAD_SENSE(scst_sense_parameter_list_length_invalid));
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
@@ -1846,14 +1846,14 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p)
|
||||
PRINT_ERROR("FORMAT UNIT: P_I_INFORMATION must be 0 (dev %s)",
|
||||
dev->virt_name);
|
||||
scst_set_invalid_field_in_parm_list(cmd, 3,
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID | 4);
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID | 4);
|
||||
goto out_put;
|
||||
}
|
||||
if ((buf[3] & 0xF) != 0) {
|
||||
PRINT_ERROR("FORMAT UNIT: PROTECTION INTERVAL EXPONENT %d not supported (dev %s)",
|
||||
buf[3] & 0xF, dev->virt_name);
|
||||
scst_set_invalid_field_in_parm_list(cmd, 3,
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID | 4);
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID | 4);
|
||||
goto out_put;
|
||||
}
|
||||
} else {
|
||||
@@ -1870,7 +1870,7 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p)
|
||||
break;
|
||||
default:
|
||||
scst_set_invalid_field_in_parm_list(cmd, 0,
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID);
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
@@ -1878,7 +1878,7 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p)
|
||||
switch (prot_usage) {
|
||||
default:
|
||||
scst_set_invalid_field_in_parm_list(cmd, 0,
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID);
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
@@ -1889,7 +1889,7 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p)
|
||||
break;
|
||||
default:
|
||||
scst_set_invalid_field_in_parm_list(cmd, 0,
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID);
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
@@ -1903,7 +1903,7 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p)
|
||||
break;
|
||||
default:
|
||||
scst_set_invalid_field_in_parm_list(cmd, 0,
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID);
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
@@ -1920,7 +1920,7 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p)
|
||||
PRINT_ERROR("FORMAT UNIT: DIF type %d not supported (dev %s)",
|
||||
prot_type, dev->virt_name);
|
||||
scst_set_invalid_field_in_cdb(cmd, 1,
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID | 6);
|
||||
SCST_INVAL_FIELD_BIT_OFFS_VALID | 6);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -2436,7 +2436,8 @@ static int vdisk_get_supported_opcodes(struct scst_cmd *cmd,
|
||||
}
|
||||
if (!dev->expl_alua) {
|
||||
(*out_supp_opcodes_cnt)--;
|
||||
sBUG_ON((*out_supp_opcodes)[*out_supp_opcodes_cnt]->od_serv_action != MO_SET_TARGET_PGS);
|
||||
sBUG_ON((*out_supp_opcodes)[*out_supp_opcodes_cnt]->od_serv_action !=
|
||||
MO_SET_TARGET_PGS);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -3042,7 +3043,7 @@ struct bio_vec *vdisk_map_pages_to_bvec(struct bio_vec *bvec, struct page *page,
|
||||
static void fileio_async_complete(struct kiocb *iocb, long ret
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 2))
|
||||
, long ret2
|
||||
#endif
|
||||
)
|
||||
@@ -3123,7 +3124,7 @@ static enum compl_status_e fileio_exec_async(struct vdisk_cmd_params *p)
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) || \
|
||||
(defined(RHEL_RELEASE_CODE) && \
|
||||
RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(8, 2))
|
||||
RHEL_RELEASE_CODE - 0 >= RHEL_RELEASE_VERSION(8, 2))
|
||||
iov_iter_bvec(&iter, dir, p->async.bvec, sg_cnt, total);
|
||||
#else
|
||||
iov_iter_bvec(&iter, ITER_BVEC | dir, p->async.bvec, sg_cnt, total);
|
||||
@@ -3154,7 +3155,7 @@ static enum compl_status_e fileio_exec_async(struct vdisk_cmd_params *p)
|
||||
if (ret != -EIOCBQUEUED) {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 2))
|
||||
fileio_async_complete(iocb, ret, 0);
|
||||
#else
|
||||
fileio_async_complete(iocb, ret);
|
||||
@@ -5091,7 +5092,8 @@ static int vdev_read_dif_tags(struct vdisk_cmd_params *p)
|
||||
EXTRACHECKS_BUG_ON(virt_dev->nullio);
|
||||
|
||||
EXTRACHECKS_BUG_ON(!(cmd->dev->dev_dif_mode & SCST_DIF_MODE_DEV_STORE) ||
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) == SCST_DIF_ACTION_NONE));
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) ==
|
||||
SCST_DIF_ACTION_NONE));
|
||||
|
||||
tags_num = (cmd->bufflen >> cmd->dev->block_shift);
|
||||
if (unlikely(tags_num == 0))
|
||||
@@ -5203,7 +5205,8 @@ static int vdev_write_dif_tags(struct vdisk_cmd_params *p)
|
||||
EXTRACHECKS_BUG_ON(virt_dev->nullio);
|
||||
|
||||
EXTRACHECKS_BUG_ON(!(cmd->dev->dev_dif_mode & SCST_DIF_MODE_DEV_STORE) ||
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) == SCST_DIF_ACTION_NONE));
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) ==
|
||||
SCST_DIF_ACTION_NONE));
|
||||
|
||||
tags_num = (cmd->bufflen >> cmd->dev->block_shift);
|
||||
if (unlikely(tags_num == 0))
|
||||
@@ -5482,7 +5485,8 @@ restart:
|
||||
}
|
||||
|
||||
if ((dev->dev_dif_mode & SCST_DIF_MODE_DEV_STORE) &&
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) != SCST_DIF_ACTION_NONE)) {
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) !=
|
||||
SCST_DIF_ACTION_NONE)) {
|
||||
err = vdev_write_dif_tags(p);
|
||||
if (err != 0)
|
||||
goto out;
|
||||
@@ -5600,7 +5604,8 @@ static void blockio_endio(struct bio *bio)
|
||||
if (op_is_write(bio_op(bio))) {
|
||||
#endif
|
||||
if (error == -ENOSPC) {
|
||||
const struct scst_vdisk_dev *virt_dev = blockio_work->cmd->dev->dh_priv;
|
||||
const struct scst_vdisk_dev *virt_dev =
|
||||
blockio_work->cmd->dev->dh_priv;
|
||||
|
||||
WARN_ON(!virt_dev->thin_provisioned);
|
||||
scst_set_cmd_error(blockio_work->cmd,
|
||||
@@ -5780,7 +5785,8 @@ static void blockio_exec_rw(struct vdisk_cmd_params *p, bool write, bool fua)
|
||||
struct scatterlist *dsg;
|
||||
int dsg_offs, dsg_len;
|
||||
bool dif = virt_dev->blk_integrity &&
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) != SCST_DIF_ACTION_NONE);
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) !=
|
||||
SCST_DIF_ACTION_NONE);
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -5958,7 +5964,8 @@ static void blockio_exec_rw(struct vdisk_cmd_params *p, bool write, bool fua)
|
||||
blk_finish_plug(&plug);
|
||||
|
||||
if ((dev->dev_dif_mode & SCST_DIF_MODE_DEV_STORE) && virt_dev->dif_fd &&
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) != SCST_DIF_ACTION_NONE)) {
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) !=
|
||||
SCST_DIF_ACTION_NONE)) {
|
||||
if (write)
|
||||
vdev_write_dif_tags(p);
|
||||
else
|
||||
@@ -6075,7 +6082,8 @@ enum compl_status_e fileio_exec_read(struct vdisk_cmd_params *p)
|
||||
}
|
||||
|
||||
if ((dev->dev_dif_mode & SCST_DIF_MODE_DEV_STORE) &&
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) != SCST_DIF_ACTION_NONE)) {
|
||||
(scst_get_dif_action(scst_get_dev_dif_actions(cmd->cmd_dif_actions)) !=
|
||||
SCST_DIF_ACTION_NONE)) {
|
||||
err = vdev_read_dif_tags(p);
|
||||
if (err != 0)
|
||||
goto out;
|
||||
@@ -6405,7 +6413,8 @@ static void vdisk_report_registering(const struct scst_vdisk_dev *virt_dev)
|
||||
virt_dev->dif_filename);
|
||||
else if (virt_dev->dif_static_app_tag_combined != SCST_DIF_NO_CHECK_APP_TAG)
|
||||
ret += scnprintf(buf + ret, buf_size - ret, ", DIF STATIC APP TAG %llx",
|
||||
(long long)be64_to_cpu(virt_dev->dif_static_app_tag_combined));
|
||||
(long long)
|
||||
be64_to_cpu(virt_dev->dif_static_app_tag_combined));
|
||||
}
|
||||
|
||||
if (virt_dev->async)
|
||||
@@ -6503,7 +6512,7 @@ static int vdisk_create_bioset(struct scst_vdisk_dev *virt_dev)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 15, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 8))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 8))
|
||||
/*
|
||||
* See also commit 105ca2a2c2ff ("block: split struct bio_integrity_payload") #v6.15.
|
||||
*/
|
||||
|
||||
@@ -1653,7 +1653,8 @@ bool scst_cm_ec_cmd_overlap(struct scst_cmd *ec_cmd, struct scst_cmd *cmd)
|
||||
goto out;
|
||||
|
||||
res = scst_lba1_inside_lba2(cmd->lba, sd->data_descr.dst_lba,
|
||||
sd->data_descr.data_len >> sd->dst_tgt_dev->dev->block_shift);
|
||||
sd->data_descr.data_len >>
|
||||
sd->dst_tgt_dev->dev->block_shift);
|
||||
if (res)
|
||||
goto out;
|
||||
}
|
||||
@@ -2446,7 +2447,8 @@ out_free:
|
||||
static bool scst_cm_is_lun_free(unsigned int lun)
|
||||
{
|
||||
bool res = true;
|
||||
const struct list_head *head = &scst_cm_sess->sess_tgt_dev_list[SESS_TGT_DEV_LIST_HASH_FN(lun)];
|
||||
const struct list_head *head =
|
||||
&scst_cm_sess->sess_tgt_dev_list[SESS_TGT_DEV_LIST_HASH_FN(lun)];
|
||||
struct scst_tgt_dev *tgt_dev;
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -3195,8 +3197,10 @@ skip_fcmd_create:
|
||||
list_for_each_entry(t, &priv->cm_sorted_devs_list, cm_sorted_devs_list_entry) {
|
||||
TRACE_DBG("t %p, cm dev %p", t, t->cm_fcmd->dev);
|
||||
if (tp) {
|
||||
if (((unsigned long)t->cm_fcmd->dev) <= ((unsigned long)tp->cm_fcmd->dev)) {
|
||||
list_for_each_entry(t, &priv->cm_sorted_devs_list, cm_sorted_devs_list_entry) {
|
||||
if (((unsigned long)t->cm_fcmd->dev) <=
|
||||
((unsigned long)tp->cm_fcmd->dev)) {
|
||||
list_for_each_entry(t, &priv->cm_sorted_devs_list,
|
||||
cm_sorted_devs_list_entry) {
|
||||
pr_emerg("%s: t %p, cm dev %p\n",
|
||||
__func__, t,
|
||||
t->cm_fcmd->dev);
|
||||
@@ -3513,7 +3517,8 @@ int scst_cm_parse_descriptors(struct scst_cmd *ec_cmd)
|
||||
break;
|
||||
default:
|
||||
PRINT_WARNING("Not supported target descriptor %x", buf[offs]);
|
||||
scst_set_cmd_error(ec_cmd, SCST_LOAD_SENSE(scst_sense_unsupported_tgt_descr_type));
|
||||
scst_set_cmd_error(ec_cmd,
|
||||
SCST_LOAD_SENSE(scst_sense_unsupported_tgt_descr_type));
|
||||
goto out_free_tgt_descr;
|
||||
}
|
||||
tgt_descrs[i].param_offs = offs;
|
||||
|
||||
+5
-5
@@ -96,7 +96,7 @@ static int scst_dlm_cancel(dlm_lockspace_t *ls, struct scst_lksb *lksb,
|
||||
int res;
|
||||
|
||||
res = dlm_unlock(ls, lksb->lksb.sb_lkid,
|
||||
DLM_LKF_CANCEL | (flags & DLM_LKF_VALBLK),
|
||||
DLM_LKF_CANCEL | (flags & DLM_LKF_VALBLK),
|
||||
&lksb->lksb, lksb);
|
||||
if (res < 0)
|
||||
goto out;
|
||||
@@ -123,7 +123,7 @@ static int scst_dlm_lock_wait(dlm_lockspace_t *ls, int mode,
|
||||
|
||||
init_completion(&lksb->completion);
|
||||
res = dlm_lock(ls, mode, &lksb->lksb, flags,
|
||||
(void *)name, name ? strlen(name) : 0, 0,
|
||||
(void *)name, name ? strlen(name) : 0, 0,
|
||||
scst_dlm_ast, lksb, bast);
|
||||
if (res < 0)
|
||||
goto out;
|
||||
@@ -673,7 +673,7 @@ out:
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) || \
|
||||
(defined(RHEL_RELEASE_CODE) && \
|
||||
RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(7, 5))
|
||||
RHEL_RELEASE_CODE - 0 >= RHEL_RELEASE_VERSION(7, 5))
|
||||
#define HAVE_ITERATE_DIR
|
||||
#endif
|
||||
|
||||
@@ -1404,7 +1404,7 @@ static void scst_copy_to_dlm_work(struct work_struct *work)
|
||||
|
||||
unlock_pr:
|
||||
dlm_lock(ls, DLM_LOCK_NL, &pr_dlm->post_join_lksb.lksb,
|
||||
DLM_LKF_CONVERT, NULL, 0, 0, scst_dlm_post_ast,
|
||||
DLM_LKF_CONVERT, NULL, 0, 0, scst_dlm_post_ast,
|
||||
&pr_dlm->post_join_lksb, scst_dlm_post_bast);
|
||||
|
||||
PRINT_INFO("Finished copying PR state to the DLM");
|
||||
@@ -1467,7 +1467,7 @@ static void scst_copy_from_dlm_work(struct work_struct *work)
|
||||
|
||||
unlock_pr:
|
||||
dlm_lock(ls, DLM_LOCK_NL, &pr_dlm->post_upd_lksb.lksb,
|
||||
DLM_LKF_CONVERT, NULL, 0, 0, scst_dlm_post_ast,
|
||||
DLM_LKF_CONVERT, NULL, 0, 0, scst_dlm_post_ast,
|
||||
&pr_dlm->post_upd_lksb, scst_dlm_post_bast);
|
||||
|
||||
scst_dlm_update_nodeids(pr_dlm);
|
||||
|
||||
@@ -1123,7 +1123,7 @@ int scst_event_init(void)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
scst_event_sysfs_class = class_create(THIS_MODULE, SCST_EVENT_NAME);
|
||||
#else
|
||||
scst_event_sysfs_class = class_create(SCST_EVENT_NAME);
|
||||
|
||||
+928
-809
File diff suppressed because it is too large
Load Diff
@@ -47,7 +47,7 @@
|
||||
#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
|
||||
#warning HIGHMEM kernel configurations are fully supported, but not \
|
||||
recommended for performance reasons. Consider changing VMSPLIT \
|
||||
option or use a 64-bit configuration instead. See README file for \
|
||||
option or use a 64 - bit configuration instead. See README file for \
|
||||
details.
|
||||
#endif
|
||||
|
||||
@@ -675,7 +675,8 @@ void scst_trace_cmds(scst_show_fn show, void *arg)
|
||||
cmd, state_name, scst_get_opcode_name(cmd),
|
||||
(long)(jiffies - cmd->start_time) / HZ,
|
||||
t->name, tgt->tgt_name, sess->sess_name,
|
||||
tgt_dev ? (tgt_dev->acg_dev->acg->acg_name ?: "(default)") : "?",
|
||||
tgt_dev ?
|
||||
(tgt_dev->acg_dev->acg->acg_name ?: "(default)") : "?",
|
||||
cmd->lun, sess->initiator_name, cdb);
|
||||
}
|
||||
spin_unlock_irq(&sess->sess_list_lock);
|
||||
@@ -2135,7 +2136,7 @@ EXPORT_SYMBOL_GPL(scst_get_setup_id);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
static int scst_add(struct device *cdev, struct class_interface *intf)
|
||||
#else
|
||||
static int scst_add(struct device *cdev)
|
||||
@@ -2158,7 +2159,7 @@ static int scst_add(struct device *cdev)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 4))
|
||||
static void scst_remove(struct device *cdev, struct class_interface *intf)
|
||||
#else
|
||||
static void scst_remove(struct device *cdev)
|
||||
@@ -2450,8 +2451,9 @@ static int __init init_scst(void)
|
||||
|
||||
si_meminfo(&si);
|
||||
#if BITS_PER_LONG == 32
|
||||
scst_max_cmd_mem = min((((u64)(si.totalram - si.totalhigh) << PAGE_SHIFT) >> 20) >> 2,
|
||||
(u64)1 << 30);
|
||||
scst_max_cmd_mem =
|
||||
min((((u64)(si.totalram - si.totalhigh) << PAGE_SHIFT) >> 20) >> 2,
|
||||
(u64)1 << 30);
|
||||
#else
|
||||
scst_max_cmd_mem = (((si.totalram - si.totalhigh) << PAGE_SHIFT) >> 20) >> 2;
|
||||
#endif
|
||||
|
||||
+2
-3
@@ -67,9 +67,9 @@ struct sgv_pool_cache_acc {
|
||||
*/
|
||||
struct sgv_pool_alloc_fns {
|
||||
struct page *(*alloc_pages_fn)(struct scatterlist *sg, gfp_t gfp_mask,
|
||||
void *priv);
|
||||
void *priv);
|
||||
void (*free_pages_fn)(struct scatterlist *sg, int sg_count,
|
||||
void *priv);
|
||||
void *priv);
|
||||
}
|
||||
#ifdef CONSTIFY_PLUGIN
|
||||
/* Avoid that the Grsecurity gcc constify_plugin constifies this structure. */
|
||||
@@ -137,7 +137,6 @@ extern bool scst_force_global_sgv_pool;
|
||||
int __init scst_sgv_pools_init(unsigned long mem_hwmark, unsigned long mem_lwmark);
|
||||
void scst_sgv_pools_deinit(void);
|
||||
|
||||
|
||||
void scst_sgv_pool_use_norm(struct scst_tgt_dev *tgt_dev);
|
||||
void scst_sgv_pool_use_norm_clust(struct scst_tgt_dev *tgt_dev);
|
||||
void scst_sgv_pool_use_dma(struct scst_tgt_dev *tgt_dev);
|
||||
|
||||
@@ -40,12 +40,12 @@ static bool scst_no_dlm_pr_is_set(struct scst_device *dev)
|
||||
}
|
||||
|
||||
static void scst_no_dlm_pr_init_reg(struct scst_device *dev,
|
||||
struct scst_dev_registrant *reg)
|
||||
struct scst_dev_registrant *reg)
|
||||
{
|
||||
}
|
||||
|
||||
static void scst_no_dlm_pr_rm_reg(struct scst_device *dev,
|
||||
struct scst_dev_registrant *reg)
|
||||
struct scst_dev_registrant *reg)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \
|
||||
(!defined(RHEL_RELEASE_CODE) || \
|
||||
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 1))
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <linux/stdarg.h>
|
||||
@@ -529,8 +529,9 @@ void scst_pr_send_ua_reg(struct scst_device *dev, struct scst_dev_registrant *re
|
||||
}
|
||||
|
||||
/* Must be called under dev_pr_mutex */
|
||||
static void scst_pr_send_ua_all(struct scst_device *dev, const struct scst_dev_registrant *exclude_reg,
|
||||
int key, int asc, int ascq)
|
||||
static void scst_pr_send_ua_all(struct scst_device *dev,
|
||||
const struct scst_dev_registrant *exclude_reg, int key, int asc,
|
||||
int ascq)
|
||||
{
|
||||
struct scst_dev_registrant *reg;
|
||||
|
||||
|
||||
@@ -113,28 +113,28 @@ bool scst_pr_is_cmd_allowed(struct scst_cmd *cmd);
|
||||
|
||||
void scst_pr_register(struct scst_cmd *cmd, u8 *buffer, int buffer_size);
|
||||
void scst_pr_register_and_ignore(struct scst_cmd *cmd, u8 *buffer,
|
||||
int buffer_size);
|
||||
int buffer_size);
|
||||
void scst_pr_register_and_move(struct scst_cmd *cmd, u8 *buffer,
|
||||
int buffer_size);
|
||||
int buffer_size);
|
||||
void scst_pr_reserve(struct scst_cmd *cmd, u8 *buffer, int buffer_size);
|
||||
void scst_pr_release(struct scst_cmd *cmd, u8 *buffer, int buffer_size);
|
||||
void scst_pr_clear(struct scst_cmd *cmd, u8 *buffer, int buffer_size);
|
||||
void scst_pr_preempt(struct scst_cmd *cmd, u8 *buffer, int buffer_size);
|
||||
void scst_pr_preempt_and_abort(struct scst_cmd *cmd, u8 *buffer,
|
||||
int buffer_size);
|
||||
int buffer_size);
|
||||
|
||||
void scst_pr_read_keys(struct scst_cmd *cmd, u8 *buffer, int buffer_size);
|
||||
void scst_pr_read_reservation(struct scst_cmd *cmd, u8 *buffer,
|
||||
int buffer_size);
|
||||
int buffer_size);
|
||||
void scst_pr_report_caps(struct scst_cmd *cmd, u8 *buffer, int buffer_size);
|
||||
void scst_pr_read_full_status(struct scst_cmd *cmd, u8 *buffer,
|
||||
int buffer_size);
|
||||
int buffer_size);
|
||||
|
||||
u32 scst_tid_size(const u8 *tid);
|
||||
bool tid_equal(const u8 *tid_a, const u8 *tid_b);
|
||||
|
||||
struct scst_dev_registrant *scst_pr_find_reg(struct scst_device *dev,
|
||||
const u8 *transport_id, const u16 rel_tgt_id);
|
||||
const u8 *transport_id, const u16 rel_tgt_id);
|
||||
struct scst_dev_registrant *scst_pr_add_registrant(struct scst_device *dev,
|
||||
const u8 *transport_id,
|
||||
const u16 rel_tgt_id,
|
||||
|
||||
@@ -565,7 +565,8 @@ void scst_report_luns_changed(struct scst_acg *acg);
|
||||
void scst_abort_cmd(struct scst_cmd *cmd, struct scst_mgmt_cmd *mcmd, bool other_ini,
|
||||
bool call_dev_task_mgmt_fn_received);
|
||||
void scst_process_reset(struct scst_device *dev, const struct scst_session *originator,
|
||||
const struct scst_cmd *exclude_cmd, struct scst_mgmt_cmd *mcmd, bool set_ua);
|
||||
const struct scst_cmd *exclude_cmd, struct scst_mgmt_cmd *mcmd,
|
||||
bool set_ua);
|
||||
void __scst_unblock_aborted_cmds(const struct scst_tgt *tgt, const struct scst_session *sess,
|
||||
const struct scst_device *device);
|
||||
void scst_unblock_aborted_cmds(const struct scst_tgt *tgt, const struct scst_session *sess,
|
||||
|
||||
@@ -1680,7 +1680,8 @@ static ssize_t __scst_acg_io_grouping_type_store(struct scst_acg *acg, const cha
|
||||
min_t(int, strlen(SCST_IO_GROUPING_AUTO_STR), count)) == 0) {
|
||||
io_grouping_type = SCST_IO_GROUPING_AUTO;
|
||||
} else if (strncasecmp(buf, SCST_IO_GROUPING_THIS_GROUP_ONLY_STR,
|
||||
min_t(int, strlen(SCST_IO_GROUPING_THIS_GROUP_ONLY_STR), count)) == 0) {
|
||||
min_t(int, strlen(SCST_IO_GROUPING_THIS_GROUP_ONLY_STR),
|
||||
count)) == 0) {
|
||||
io_grouping_type = SCST_IO_GROUPING_THIS_GROUP_ONLY;
|
||||
} else if (strncasecmp(buf, SCST_IO_GROUPING_NEVER_STR,
|
||||
min_t(int, strlen(SCST_IO_GROUPING_NEVER_STR), count)) == 0) {
|
||||
@@ -4834,7 +4835,7 @@ static ssize_t scst_sess_sysfs_##exported_name##_show(struct kobject *kobj, \
|
||||
BUILD_BUG_ON(SCST_DATA_BIDI != 3); \
|
||||
BUILD_BUG_ON(SCST_DATA_NONE != 4); \
|
||||
\
|
||||
BUILD_BUG_ON((dir) >= SCST_DATA_DIR_MAX); \
|
||||
BUILD_BUG_ON((dir) >= SCST_DATA_DIR_MAX); \
|
||||
\
|
||||
sess = container_of(kobj, struct scst_session, sess_kobj); \
|
||||
v = sess->io_stats[dir].name; \
|
||||
@@ -4850,7 +4851,7 @@ static ssize_t scst_sess_sysfs_##exported_name##_store(struct kobject *kobj, \
|
||||
struct scst_session *sess; \
|
||||
sess = container_of(kobj, struct scst_session, sess_kobj); \
|
||||
spin_lock_irq(&sess->sess_list_lock); \
|
||||
BUILD_BUG_ON((dir) >= SCST_DATA_DIR_MAX); \
|
||||
BUILD_BUG_ON((dir) >= SCST_DATA_DIR_MAX); \
|
||||
sess->io_stats[dir].cmd_count = 0; \
|
||||
sess->io_stats[dir].io_byte_count = 0; \
|
||||
sess->io_stats[dir].unaligned_cmd_count = 0; \
|
||||
|
||||
@@ -293,7 +293,8 @@ static bool scst_check_scsi_atomicity(struct scst_cmd *chk_cmd)
|
||||
* that space is used, does nothing.
|
||||
*/
|
||||
p = krealloc(cmd->scsi_atomic_blocked_cmds,
|
||||
sizeof(*cmd->scsi_atomic_blocked_cmds) * (cmd->scsi_atomic_blocked_cmds_count + 1),
|
||||
sizeof(*cmd->scsi_atomic_blocked_cmds) *
|
||||
(cmd->scsi_atomic_blocked_cmds_count + 1),
|
||||
GFP_ATOMIC);
|
||||
if (!p)
|
||||
goto out_busy_undo;
|
||||
@@ -5367,7 +5368,8 @@ static int scst_set_mcmd_next_state(struct scst_mgmt_cmd *mcmd)
|
||||
|
||||
PRINT_CRIT_ERROR("Wrong mcmd %p state %s (fn %s, cmd_finish_wait_count %d, cmd_done_wait_count %d)",
|
||||
mcmd,
|
||||
scst_get_mcmd_state_name(state_name, sizeof(state_name), mcmd->state),
|
||||
scst_get_mcmd_state_name(state_name, sizeof(state_name),
|
||||
mcmd->state),
|
||||
scst_get_tm_fn_name(fn_name, sizeof(fn_name), mcmd->fn),
|
||||
mcmd->cmd_finish_wait_count, mcmd->cmd_done_wait_count);
|
||||
#if !defined(__CHECKER__)
|
||||
@@ -5526,7 +5528,8 @@ static int scst_abort_task_set(struct scst_mgmt_cmd *mcmd)
|
||||
|
||||
if (tgt_dev->curr_order_data->aca_tgt_dev == (unsigned long)mcmd->mcmd_tgt_dev) {
|
||||
/* PR cmd is clearing the commands received on the faulted I_T nexus */
|
||||
if (orig_pr_cmd->cur_order_data->aca_tgt_dev == (unsigned long)orig_pr_cmd->tgt_dev) {
|
||||
if (orig_pr_cmd->cur_order_data->aca_tgt_dev ==
|
||||
(unsigned long)orig_pr_cmd->tgt_dev) {
|
||||
/* PR cmd received on the faulted I_T nexus */
|
||||
if (orig_pr_cmd->queue_type == SCST_CMD_QUEUE_ACA)
|
||||
scst_clear_aca(tgt_dev, (tgt_dev != orig_pr_cmd->tgt_dev));
|
||||
@@ -6574,7 +6577,8 @@ static int scst_process_mgmt_cmd(struct scst_mgmt_cmd *mcmd)
|
||||
|
||||
PRINT_CRIT_ERROR("Wrong mcmd %p state %s (fn %s, cmd_finish_wait_count %d, cmd_done_wait_count %d)",
|
||||
mcmd,
|
||||
scst_get_mcmd_state_name(state_name, sizeof(state_name), mcmd->state),
|
||||
scst_get_mcmd_state_name(state_name, sizeof(state_name),
|
||||
mcmd->state),
|
||||
scst_get_tm_fn_name(fn_name, sizeof(fn_name), mcmd->fn),
|
||||
mcmd->cmd_finish_wait_count,
|
||||
mcmd->cmd_done_wait_count);
|
||||
|
||||
Reference in New Issue
Block a user