Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: remove the inode log format from the inode log item

No need to keep the inode log format around all the time, we can
easily generate it at iop_format time.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>

authored by

Christoph Hellwig and committed by
Dave Chinner
2f251293 da776503

+11 -19
+11 -18
fs/xfs/xfs_inode_item.c
··· 370 370 struct xfs_inode_log_format *ilf; 371 371 struct xfs_log_iovec *vecp = NULL; 372 372 373 - ilf = xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_IFORMAT, 374 - &iip->ili_format, 375 - sizeof(struct xfs_inode_log_format)); 376 - ilf->ilf_size = 1; 373 + ilf = xlog_prepare_iovec(lv, &vecp, XLOG_REG_TYPE_IFORMAT); 374 + ilf->ilf_type = XFS_LI_INODE; 375 + ilf->ilf_ino = ip->i_ino; 376 + ilf->ilf_blkno = ip->i_imap.im_blkno; 377 + ilf->ilf_len = ip->i_imap.im_len; 378 + ilf->ilf_boffset = ip->i_imap.im_boffset; 379 + ilf->ilf_fields = XFS_ILOG_CORE; 380 + ilf->ilf_size = 2; /* format + core */ 381 + xlog_finish_iovec(lv, vecp, sizeof(struct xfs_inode_log_format)); 377 382 378 383 if (ip->i_d.di_version == 1) 379 384 xfs_inode_item_format_v1_inode(ip); 380 385 xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_ICORE, 381 386 &ip->i_d, 382 387 xfs_icdinode_size(ip->i_d.di_version)); 383 - ilf->ilf_size++; 384 388 385 389 xfs_inode_item_format_data_fork(iip, ilf, lv, &vecp); 386 390 if (XFS_IFORK_Q(ip)) { ··· 394 390 ~(XFS_ILOG_ADATA | XFS_ILOG_ABROOT | XFS_ILOG_AEXT); 395 391 } 396 392 397 - /* 398 - * Now update the log format that goes out to disk from the in-core 399 - * values. We always write the inode core to make the arithmetic 400 - * games in recovery easier, which isn't a big deal as just about any 401 - * transaction would dirty it anyway. 402 - */ 403 - iip->ili_format.ilf_fields = XFS_ILOG_CORE | 404 - (iip->ili_fields & ~XFS_ILOG_TIMESTAMP); 393 + /* update the format with the exact fields we actually logged */ 394 + ilf->ilf_fields |= (iip->ili_fields & ~XFS_ILOG_TIMESTAMP); 405 395 } 406 396 407 397 /* ··· 599 601 iip->ili_inode = ip; 600 602 xfs_log_item_init(mp, &iip->ili_item, XFS_LI_INODE, 601 603 &xfs_inode_item_ops); 602 - iip->ili_format.ilf_type = XFS_LI_INODE; 603 - iip->ili_format.ilf_ino = ip->i_ino; 604 - iip->ili_format.ilf_blkno = ip->i_imap.im_blkno; 605 - iip->ili_format.ilf_len = ip->i_imap.im_len; 606 - iip->ili_format.ilf_boffset = ip->i_imap.im_boffset; 607 604 } 608 605 609 606 /*
-1
fs/xfs/xfs_inode_item.h
··· 34 34 unsigned short ili_logged; /* flushed logged data */ 35 35 unsigned int ili_last_fields; /* fields when flushed */ 36 36 unsigned int ili_fields; /* fields to be logged */ 37 - xfs_inode_log_format_t ili_format; /* logged structure */ 38 37 } xfs_inode_log_item_t; 39 38 40 39 static inline int xfs_inode_clean(xfs_inode_t *ip)