[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sync patch for minixfs pl 10
Hi!
Here is an improved patch for the minixfs to use the sync feature
of a mint which has my patch applied, relative to pl 10
Ciao
Ulrich
--
+---------------+----------------------------+-----------------------+
| Ulrich Kuehn | Internet: | Life is uncertain -- |
| Cand.Math.Inf | kuehn@math.uni-muenster.de | eat the dessert first |
+---------------+----------------------------+-----------------------+
------------------ police line, do cross ------------------
diff -uw old/config.h ./config.h
--- old/config.h Tue Nov 1 01:02:06 1994
+++ ./config.h Mon Oct 31 23:46:56 1994
@@ -20,6 +20,11 @@
#define NORMAL 1 /* sync() on all but writes */
#define ROBUST 2 /* sync() on everything ***slow*** */
+/* uk: define this to let syncing be done by MiNT's sysupdate daemon
+ * through Sync() system call, set CACHE_MODE TURBO.
+ */
+#define SYSUPDATE
+
#define SYNC_TIME 5 /* sync time is seconds */
#define MAX_RWS 1024 /* Maximum sectors to read/write atomically */
diff -uw old/filesys.h ./filesys.h
--- old/filesys.h Tue Nov 1 01:02:22 1994
+++ ./filesys.h Tue Nov 1 01:13:36 1994
@@ -158,6 +158,7 @@
#define FS_NOXBIT 0x04 /* if a file can be read, it can be executed */
#define FS_LONGPATH 0x08 /* file system understands "size" argument to
"getname" */
+#define FS_DO_SYNC 0x20 /* file system has sync function */
long (*root) P_((_wORD drv, fcookie *fc));
long (*lookup) P_((fcookie *dir, char *name, fcookie *fc));
@@ -191,6 +192,7 @@
long (*dskchng) P_((_wORD drv));
long (*release) P_((fcookie *fc));
long (*dupcookie) P_((fcookie *dest, fcookie *src));
+ void (*sync) P_((void));
} FILESYS;
/*
diff -uw old/main.c ./main.c
--- old/main.c Thu Nov 17 17:26:48 1994
+++ ./main.c Thu Nov 17 17:29:22 1994
@@ -122,6 +122,17 @@
{
BASEPAGE *b;
+#ifdef SYSUPDATE
+ if ((kernel->maj_version) && (kernel->min_version >= 0x12) &&
+ (kernel->dos_tab[0x150] != NULL) )
+ {
+ /* Do not start the update daemon, or use the root timeout
+ * method, as the system already has a Sync() system call,
+ * and hopefully a running update daemon.
+ */
+ }
+ else
+#endif
#if 0
if(Addroottimeout) Addroottimeout(sync_time*1000l,t_sync,0);
else
diff -uw old/minixfs.c ./minixfs.c
--- old/minixfs.c Sun Oct 30 22:51:18 1994
+++ ./minixfs.c Mon Oct 31 23:48:34 1994
@@ -6,7 +6,11 @@
FILESYS minix_filesys = {
(FILESYS *) 0,
+#ifdef SYSUPDATE
+ FS_CASESENSITIVE | FS_LONGPATH | FS_DO_SYNC,
+#else
FS_CASESENSITIVE | FS_LONGPATH,
+#endif
m_root, m_lookup, m_creat, m_getdev,
m_getxattr, m_chattr, m_chown,
m_chmode, m_mkdir,
@@ -17,7 +21,10 @@
m_wlabel, m_rlabel,
m_symlink, m_readlink,
m_hardlink, m_fscntl, m_dskchng,
- m_release,m_dupcookie
+ m_release,m_dupcookie,
+#ifdef SYSUPDATE
+ l_sync
+#endif
};
extern DEVDRV minix_dev;