summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-24 20:56:24 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-24 20:56:24 +0000
commit88253a56136a2800ebd59d72aafdd04c630bc316 (patch)
tree67852b2156b12a0874ac79ab5efb609cb1d9ca6b /libdiskfs
parent29bd5cb55bd05cc6137ff391916df1a7c4dca74f (diff)
(_diskfs_diskdirty): New var.
(diskfs_check_readonly): New function. (diskfs_set_readonly): After clean sync, clear _diskfs_diskdirty.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/readonly.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libdiskfs/readonly.c b/libdiskfs/readonly.c
index 3425e299..b45e756e 100644
--- a/libdiskfs/readonly.c
+++ b/libdiskfs/readonly.c
@@ -24,6 +24,24 @@
#include "priv.h"
+int _diskfs_diskdirty;
+
+int
+diskfs_check_readonly ()
+{
+ if (diskfs_readonly)
+ return 1;
+ else
+ {
+ if (!_diskfs_diskdirty)
+ {
+ diskfs_set_hypermetadata (0, 0);
+ _diskfs_diskdirty = 1;
+ }
+ return 0;
+ }
+}
+
/* Change an active filesystem between read-only and writable modes, setting
the global variable DISKFS_READONLY to reflect the current mode. If an
error is returned, nothing will have changed. The user should hold
@@ -61,6 +79,7 @@ diskfs_set_readonly (int readonly)
{
diskfs_sync_everything (1);
diskfs_set_hypermetadata (1, 1);
+ _diskfs_diskdirty = 0;
}
}