123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- #include "xfs.h"
- #include "xfs_fs.h"
- #include "xfs_shared.h"
- #include "xfs_format.h"
- #include "xfs_log_format.h"
- #include "xfs_trans_resv.h"
- #include "xfs_mount.h"
- #include "xfs_inode.h"
- #include "xfs_trans.h"
- #include "xfs_trans_priv.h"
- #include "xfs_inode_item.h"
- #include "xfs_trace.h"
- void
- xfs_trans_ijoin(
- struct xfs_trans *tp,
- struct xfs_inode *ip,
- uint lock_flags)
- {
- xfs_inode_log_item_t *iip;
- ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
- if (ip->i_itemp == NULL)
- xfs_inode_item_init(ip, ip->i_mount);
- iip = ip->i_itemp;
- ASSERT(iip->ili_lock_flags == 0);
- iip->ili_lock_flags = lock_flags;
-
- xfs_trans_add_item(tp, &iip->ili_item);
- }
- void
- xfs_trans_ichgtime(
- struct xfs_trans *tp,
- struct xfs_inode *ip,
- int flags)
- {
- struct inode *inode = VFS_I(ip);
- struct timespec tv;
- ASSERT(tp);
- ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
- tv = current_time(inode);
- if (flags & XFS_ICHGTIME_MOD)
- inode->i_mtime = tv;
- if (flags & XFS_ICHGTIME_CHG)
- inode->i_ctime = tv;
- }
- void
- xfs_trans_log_inode(
- xfs_trans_t *tp,
- xfs_inode_t *ip,
- uint flags)
- {
- ASSERT(ip->i_itemp != NULL);
- ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
-
- ip->i_itemp->ili_fsync_fields |= flags;
-
- if (!(ip->i_itemp->ili_item.li_desc->lid_flags & XFS_LID_DIRTY) &&
- IS_I_VERSION(VFS_I(ip))) {
- VFS_I(ip)->i_version++;
- flags |= XFS_ILOG_CORE;
- }
- tp->t_flags |= XFS_TRANS_DIRTY;
- ip->i_itemp->ili_item.li_desc->lid_flags |= XFS_LID_DIRTY;
-
- flags |= ip->i_itemp->ili_last_fields;
- ip->i_itemp->ili_fields |= flags;
- }
|