Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16627
b: refs/heads/master
c: 70b9ecb
h: refs/heads/master
i:
  16625: 8f95278
  16623: b983b96
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jan 6, 2006
1 parent be1176c commit ff491d6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 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: 24174119c73983d5217da8f56a12c79a9b57e056
refs/heads/master: 70b9ecbdb9c5fdc731f8780bffd45d9519020c4a
2 changes: 2 additions & 0 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME;
int err;

/* Flush out writes to the server in order to update c/mtime */
nfs_sync_inode(inode, 0, 0, FLUSH_WAIT|FLUSH_NOCOMMIT);
if (__IS_FLG(inode, MS_NOATIME))
need_atime = 0;
else if (__IS_FLG(inode, MS_NODIRATIME) && S_ISDIR(inode->i_mode))
Expand Down
23 changes: 12 additions & 11 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,22 +1377,23 @@ int nfs_commit_inode(struct inode *inode, int how)
int nfs_sync_inode(struct inode *inode, unsigned long idx_start,
unsigned int npages, int how)
{
int error,
wait;
int nocommit = how & FLUSH_NOCOMMIT;
int wait = how & FLUSH_WAIT;
int error;

wait = how & FLUSH_WAIT;
how &= ~FLUSH_WAIT;
how &= ~(FLUSH_WAIT|FLUSH_NOCOMMIT);

do {
error = 0;
if (wait)
if (wait) {
error = nfs_wait_on_requests(inode, idx_start, npages);
if (error == 0)
error = nfs_flush_inode(inode, idx_start, npages, how);
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
if (error == 0)
if (error != 0)
continue;
}
error = nfs_flush_inode(inode, idx_start, npages, how);
if (error != 0)
continue;
if (!nocommit)
error = nfs_commit_inode(inode, how);
#endif
} while (error > 0);
return error;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/nfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#define FLUSH_STABLE 4 /* commit to stable storage */
#define FLUSH_LOWPRI 8 /* low priority background flush */
#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */

#ifdef __KERNEL__

Expand Down

0 comments on commit ff491d6

Please sign in to comment.