diff --git a/scst/include/scst.h b/scst/include/scst.h index 655e155e8..1d7ca69b1 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -92,6 +92,12 @@ typedef _Bool bool; #include "scst_sgv.h" #endif +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) +#ifndef __printf +#define __printf(a, b) __attribute__((format(printf,a,b))) +#endif +#endif + #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) && !defined(BACKPORT_LINUX_CPUMASK_H) #define nr_cpu_ids NR_CPUS #endif @@ -3787,6 +3793,8 @@ static inline struct scatterlist *sg_chain_ptr(struct scatterlist *sg) return NULL; } +#define sg_is_last(sg) false + #ifndef sg_page static inline struct page *sg_page(struct scatterlist *sg) { diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 6420801d8..5bb919a15 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -2134,8 +2134,8 @@ static int vdisk_unmap_range(struct scst_cmd *cmd, (unsigned long long)start_lba, (unsigned long long)blocks); if (virt_dev->blockio) { - struct inode *inode = fd->f_dentry->d_inode; #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 27) + struct inode *inode = fd->f_dentry->d_inode; gfp_t gfp = scst_cmd_get_gfp_flags(cmd); #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 31) err = blkdev_issue_discard(inode->i_bdev, start_lba, blocks, gfp);