We can think of there being three types of devices:
1/ SAFE. With a SAFE device, there is no write-behind cache, or if
there is it is non-volatile. Once a write completes it is
completely safe. Such a device does not require barriers
or ->issue_flush_fn, and can respond to them either by a
no-op or with -EOPNOTSUPP (the former is preferred).
2/ FLUSHABLE.
A FLUSHABLE device may have a volatile write-behind cache.
This cache can be flushed with a call to blkdev_issue_flush.
It may not support barrier requests.
3/ BARRIER.
A BARRIER device supports both blkdev_issue_flush and
BIO_RW_BARRIER. Either may be used to synchronise any
write-behind cache to non-volatile storage (media).
Handling of SAFE and FLUSHABLE devices is essentially the same and can
work on a BARRIER device. The BARRIER device has the option of more
efficient handling.