diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-03-09 02:11:34 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-03-09 02:11:34 +0000 |
commit | 2b101b65e6e9c83e8c99a2345be4c4cd162bb71e (patch) | |
tree | 225030089fe9e0b5109a8659934622616ada8282 /libdiskfs/io-write.c | |
parent | 95d4c9c00005d31f09fc8ab24480141dc6a48f1a (diff) |
(diskfs_S_io_write): Implement diskfs_synchronous.
Diffstat (limited to 'libdiskfs/io-write.c')
-rw-r--r-- | libdiskfs/io-write.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libdiskfs/io-write.c b/libdiskfs/io-write.c index ee9b0822..a78937ba 100644 --- a/libdiskfs/io-write.c +++ b/libdiskfs/io-write.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994 Free Software Foundation + Copyright (C) 1994, 1995 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -55,6 +55,8 @@ diskfs_S_io_write (struct protid *cred, while (off + datalen > np->allocsize) { err = diskfs_grow (np, off + datalen, cred); + if (diskfs_synchronous) + diskfs_node_update (np, 1); if (err) goto out; } @@ -63,6 +65,8 @@ diskfs_S_io_write (struct protid *cred, { np->dn_stat.st_size = off + datalen; np->dn_set_ctime = 1; + if (diskfs_synchronous) + diskfs_node_update (np, 1); } *amt = datalen; @@ -71,7 +75,8 @@ diskfs_S_io_write (struct protid *cred, if (!err && offset == -1) cred->po->filepointer += *amt; - if (!err && (cred->po->openstat & O_FSYNC)) + if (!err + && ((cred->po->openstat & O_FSYNC) || diskfs_synchronous)) diskfs_file_update (np, 1); out: |