Linux 3.14 compat: IO acct, global_page_state, etc

generic_start_io_acct/generic_end_io_acct in the master
branch of the linux kernel requires that the request_queue
be provided.

Move the logic from freemem in the spl to arc_free_memory
in arc.c. Do this so we can take advantage of global_page_state
interface checks in zfs.

Upstream kernel replaced struct block_device with
struct gendisk in struct bio. Determine if the
function bio_set_dev exists during configure
and have zfs use that if it exists.

bio_set_dev https://github.com/torvalds/linux/commit/74d4699
global_node_page_state https://github.com/torvalds/linux/commit/75ef718
io acct https://github.com/torvalds/linux/commit/d62e26b

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #6635
This commit is contained in:
Giuseppe Di Natale
2017-09-16 11:00:19 -07:00
committed by Brian Behlendorf
parent 90cdf2833d
commit 787acae0b5
7 changed files with 112 additions and 19 deletions
+14 -4
View File
@@ -598,16 +598,26 @@ blk_queue_discard_granularity(struct request_queue *q, unsigned int dg)
*/
#define VDEV_HOLDER ((void *)0x2401de7)
#ifndef HAVE_GENERIC_IO_ACCT
static inline void
generic_start_io_acct(int rw, unsigned long sectors, struct hd_struct *part)
blk_generic_start_io_acct(struct request_queue *q, int rw,
unsigned long sectors, struct hd_struct *part)
{
#if defined(HAVE_GENERIC_IO_ACCT_3ARG)
generic_start_io_acct(rw, sectors, part);
#elif defined(HAVE_GENERIC_IO_ACCT_4ARG)
generic_start_io_acct(q, rw, sectors, part);
#endif
}
static inline void
generic_end_io_acct(int rw, struct hd_struct *part, unsigned long start_time)
blk_generic_end_io_acct(struct request_queue *q, int rw,
struct hd_struct *part, unsigned long start_time)
{
}
#if defined(HAVE_GENERIC_IO_ACCT_3ARG)
generic_end_io_acct(rw, part, start_time);
#elif defined(HAVE_GENERIC_IO_ACCT_4ARG)
generic_end_io_acct(q, rw, part, start_time);
#endif
}
#endif /* _ZFS_BLKDEV_H */