diff options
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 29 | ||||
-rw-r--r-- | fs/xfs/xfs_inode_item.h | 1 |
2 files changed, 11 insertions, 19 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 45224d28049e..686889b4a1e5 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -370,17 +370,21 @@ xfs_inode_item_format( | |||
370 | struct xfs_inode_log_format *ilf; | 370 | struct xfs_inode_log_format *ilf; |
371 | struct xfs_log_iovec *vecp = NULL; | 371 | struct xfs_log_iovec *vecp = NULL; |
372 | 372 | ||
373 | ilf = xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_IFORMAT, | 373 | ilf = xlog_prepare_iovec(lv, &vecp, XLOG_REG_TYPE_IFORMAT); |
374 | &iip->ili_format, | 374 | ilf->ilf_type = XFS_LI_INODE; |
375 | sizeof(struct xfs_inode_log_format)); | 375 | ilf->ilf_ino = ip->i_ino; |
376 | ilf->ilf_size = 1; | 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 | if (ip->i_d.di_version == 1) | 383 | if (ip->i_d.di_version == 1) |
379 | xfs_inode_item_format_v1_inode(ip); | 384 | xfs_inode_item_format_v1_inode(ip); |
380 | xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_ICORE, | 385 | xlog_copy_iovec(lv, &vecp, XLOG_REG_TYPE_ICORE, |
381 | &ip->i_d, | 386 | &ip->i_d, |
382 | xfs_icdinode_size(ip->i_d.di_version)); | 387 | xfs_icdinode_size(ip->i_d.di_version)); |
383 | ilf->ilf_size++; | ||
384 | 388 | ||
385 | xfs_inode_item_format_data_fork(iip, ilf, lv, &vecp); | 389 | xfs_inode_item_format_data_fork(iip, ilf, lv, &vecp); |
386 | if (XFS_IFORK_Q(ip)) { | 390 | if (XFS_IFORK_Q(ip)) { |
@@ -390,14 +394,8 @@ xfs_inode_item_format( | |||
390 | ~(XFS_ILOG_ADATA | XFS_ILOG_ABROOT | XFS_ILOG_AEXT); | 394 | ~(XFS_ILOG_ADATA | XFS_ILOG_ABROOT | XFS_ILOG_AEXT); |
391 | } | 395 | } |
392 | 396 | ||
393 | /* | 397 | /* update the format with the exact fields we actually logged */ |
394 | * Now update the log format that goes out to disk from the in-core | 398 | ilf->ilf_fields |= (iip->ili_fields & ~XFS_ILOG_TIMESTAMP); |
395 | * values. We always write the inode core to make the arithmetic | ||
396 | * games in recovery easier, which isn't a big deal as just about any | ||
397 | * transaction would dirty it anyway. | ||
398 | */ | ||
399 | iip->ili_format.ilf_fields = XFS_ILOG_CORE | | ||
400 | (iip->ili_fields & ~XFS_ILOG_TIMESTAMP); | ||
401 | } | 399 | } |
402 | 400 | ||
403 | /* | 401 | /* |
@@ -601,11 +599,6 @@ xfs_inode_item_init( | |||
601 | iip->ili_inode = ip; | 599 | iip->ili_inode = ip; |
602 | xfs_log_item_init(mp, &iip->ili_item, XFS_LI_INODE, | 600 | xfs_log_item_init(mp, &iip->ili_item, XFS_LI_INODE, |
603 | &xfs_inode_item_ops); | 601 | &xfs_inode_item_ops); |
604 | iip->ili_format.ilf_type = XFS_LI_INODE; | ||
605 | iip->ili_format.ilf_ino = ip->i_ino; | ||
606 | iip->ili_format.ilf_blkno = ip->i_imap.im_blkno; | ||
607 | iip->ili_format.ilf_len = ip->i_imap.im_len; | ||
608 | iip->ili_format.ilf_boffset = ip->i_imap.im_boffset; | ||
609 | } | 602 | } |
610 | 603 | ||
611 | /* | 604 | /* |
diff --git a/fs/xfs/xfs_inode_item.h b/fs/xfs/xfs_inode_item.h index 29b5f2b6533a..488d81254e28 100644 --- a/fs/xfs/xfs_inode_item.h +++ b/fs/xfs/xfs_inode_item.h | |||
@@ -34,7 +34,6 @@ typedef struct xfs_inode_log_item { | |||
34 | unsigned short ili_logged; /* flushed logged data */ | 34 | unsigned short ili_logged; /* flushed logged data */ |
35 | unsigned int ili_last_fields; /* fields when flushed */ | 35 | unsigned int ili_last_fields; /* fields when flushed */ |
36 | unsigned int ili_fields; /* fields to be logged */ | 36 | unsigned int ili_fields; /* fields to be logged */ |
37 | xfs_inode_log_format_t ili_format; /* logged structure */ | ||
38 | } xfs_inode_log_item_t; | 37 | } xfs_inode_log_item_t; |
39 | 38 | ||
40 | static inline int xfs_inode_clean(xfs_inode_t *ip) | 39 | static inline int xfs_inode_clean(xfs_inode_t *ip) |