• Damien Le Moal's avatar
    zonefs: use iomap for synchronous direct writes · 16d7fd3c
    Damien Le Moal authored
    Remove the function zonefs_file_dio_append() that is used to manually
    issue REQ_OP_ZONE_APPEND BIOs for processing synchronous direct writes
    and use iomap instead.
    
    To preserve the use of zone append operations for synchronous writes,
    different struct iomap_dio_ops are defined. For synchronous direct
    writes using zone append, zonefs_zone_append_dio_ops is introduced.
    The submit_bio operation of this structure is defined as the function
    zonefs_file_zone_append_dio_submit_io() which is used to change the BIO
    opreation for synchronous direct IO writes to REQ_OP_ZONE_APPEND.
    
    In order to preserve the write location check on completion of zone
    append BIOs, the end_io operation is also defined using the function
    zonefs_file_zone_append_dio_bio_end_io(). This check now relies on the
    zonefs_zone_append_bio structure, allocated together with zone append
    BIOs with a dedicated BIO set. This structure include the target inode
    of a zone append BIO as well as the target append offset location for
    the zone append operation. This is used to perform a check against
    bio->bi_iter.bi_sector when the BIO completes, without needing to use
    the zone information z_wpoffset field, thus removing the need for
    taking the inode truncate mutex.
    Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
    Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
    16d7fd3c
zonefs.h 7.4 KB