Merge pull request #15 from micrakow/added_wlth_support

Added Write Lifetime Hint support in classifier
This commit is contained in:
Adam Rutkowski 2019-04-25 15:15:31 +02:00 committed by GitHub
commit 28eee81fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View File

@ -209,6 +209,17 @@ static cas_cls_eval_t _cas_cls_numeric_test_u(
return cas_cls_eval_no;
}
#ifdef WLTH_SUPPORT
/* Write lifetime hint condition test */
static cas_cls_eval_t _cas_cls_wlth_test(struct cas_classifier *cls,
struct cas_cls_condition *c, struct cas_cls_io *io,
ocf_part_id_t part_id)
{
return _cas_cls_numeric_test_u(c, io->bio->bi_write_hint);
}
#endif
/* Io class test function */
static cas_cls_eval_t _cas_cls_io_class_test(struct cas_classifier *cls,
struct cas_cls_condition *c, struct cas_cls_io *io,
@ -417,6 +428,10 @@ static struct cas_cls_condition_handler _handlers[] = {
_cas_cls_generic_dtr },
{ "directory", _cas_cls_directory_test, _cas_cls_directory_ctr,
_cas_cls_directory_dtr },
#ifdef WLTH_SUPPORT
{ "wlth", _cas_cls_wlth_test, _cas_cls_numeric_ctr,
_cas_cls_generic_dtr},
#endif
{ NULL }
};

View File

@ -83,6 +83,10 @@
#define BIO_OP_STATUS(bio) bio->bi_error
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
#define WLTH_SUPPORT
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
#define BIO_ENDIO(BIO, BYTES_DONE, ERROR) \
({ BIO_OP_STATUS(BIO) = ERROR; bio_endio(BIO); })

2
ocf

@ -1 +1 @@
Subproject commit 9f927de841e82d07fda63c5ad3536620b536f5e0
Subproject commit bb6fe41b9df17c727780391cac7c816b3c484175