• Dave Chinner's avatar
    xfs: only CIL pushes require a start record · 6eaed95e
    Dave Chinner authored
    So move the one-off start record writing in xlog_write() out into
    the static header that the CIL push builds to write into the log
    initially. This simplifes the xlog_write() logic a lot.
    
    pahole on x86-64 confirms that the xlog_cil_trans_hdr is correctly
    32 bit aligned and packed for copying the log op and transaction
    headers directly into the log as a single log region copy.
    
    struct xlog_cil_trans_hdr {
            struct xlog_op_header      oph[2];               /*     0    24 */
            struct xfs_trans_header    thdr;                 /*    24    16 */
            struct xfs_log_iovec       lhdr[2];              /*    40    32 */
    
            /* size: 72, cachelines: 2, members: 3 */
            /* last cacheline: 8 bytes */
    };
    
    A wart is needed to handle the fact that length of the region the
    opheader points to doesn't include the opheader length. hence if
    we embed the opheader, we have to substract the opheader length from
    the length written into the opheader by the generic copying code.
    This will eventually go away when everything is converted to
    embedded opheaders.
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarChandan Babu R <chandan.babu@oracle.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    6eaed95e
xfs_log_cil.c 48.8 KB