Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269912
b: refs/heads/master
c: b103705
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Oct 12, 2011
1 parent 67104b9 commit 7033ee9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 815cb21662b914e1e14c256a3d662b1352c8509e
refs/heads/master: b10370585349d364ff3c550afa7922e6e21f029d
15 changes: 8 additions & 7 deletions trunk/fs/xfs/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ xfs_file_fsync(
struct xfs_trans *tp;
int error = 0;
int log_flushed = 0;
xfs_lsn_t lsn = 0;

trace_xfs_file_fsync(ip);

Expand Down Expand Up @@ -214,9 +215,9 @@ xfs_file_fsync(
*/
xfs_trans_ijoin(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
xfs_trans_set_sync(tp);
error = _xfs_trans_commit(tp, 0, &log_flushed);
error = xfs_trans_commit(tp, 0);

lsn = ip->i_itemp->ili_last_lsn;
xfs_iunlock(ip, XFS_ILOCK_EXCL);
} else {
/*
Expand All @@ -227,14 +228,14 @@ xfs_file_fsync(
* disk yet, the inode will be still be pinned. If it is,
* force the log.
*/
if (xfs_ipincount(ip)) {
error = _xfs_log_force_lsn(mp,
ip->i_itemp->ili_last_lsn,
XFS_LOG_SYNC, &log_flushed);
}
if (xfs_ipincount(ip))
lsn = ip->i_itemp->ili_last_lsn;
xfs_iunlock(ip, XFS_ILOCK_SHARED);
}

if (!error && lsn)
error = _xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, &log_flushed);

/*
* If we only have a single device, and the log force about was
* a no-op we might have to flush the data device cache here.
Expand Down
11 changes: 4 additions & 7 deletions trunk/fs/xfs/xfs_trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -1790,9 +1790,7 @@ xfs_trans_commit_cil(
}

/*
* xfs_trans_commit
*
* Commit the given transaction to the log a/synchronously.
* Commit the given transaction to the log.
*
* XFS disk error handling mechanism is not based on a typical
* transaction abort mechanism. Logically after the filesystem
Expand All @@ -1804,10 +1802,9 @@ xfs_trans_commit_cil(
* Do not reference the transaction structure after this call.
*/
int
_xfs_trans_commit(
xfs_trans_commit(
struct xfs_trans *tp,
uint flags,
int *log_flushed)
uint flags)
{
struct xfs_mount *mp = tp->t_mountp;
xfs_lsn_t commit_lsn = -1;
Expand Down Expand Up @@ -1866,7 +1863,7 @@ _xfs_trans_commit(
if (sync) {
if (!error) {
error = _xfs_log_force_lsn(mp, commit_lsn,
XFS_LOG_SYNC, log_flushed);
XFS_LOG_SYNC, NULL);
}
XFS_STATS_INC(xs_trans_sync);
} else {
Expand Down
5 changes: 1 addition & 4 deletions trunk/fs/xfs/xfs_trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,7 @@ void xfs_trans_log_efd_extent(xfs_trans_t *,
struct xfs_efd_log_item *,
xfs_fsblock_t,
xfs_extlen_t);
int _xfs_trans_commit(xfs_trans_t *,
uint flags,
int *);
#define xfs_trans_commit(tp, flags) _xfs_trans_commit(tp, flags, NULL)
int xfs_trans_commit(xfs_trans_t *, uint flags);
void xfs_trans_cancel(xfs_trans_t *, int);
int xfs_trans_ail_init(struct xfs_mount *);
void xfs_trans_ail_destroy(struct xfs_mount *);
Expand Down

0 comments on commit 7033ee9

Please sign in to comment.