diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-26 05:43:26 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-07-26 05:43:26 +0200 |
commit | 6617c63a374f7211b41252d3957e8a89061b8a49 (patch) | |
tree | 649d456d9b95e47cfc10ac4b9ff2ec705c1633a3 /sys/src/9/port/portdat.h | |
parent | 918cb7604039601fecd70379b8bc2fee5b26a514 (diff) |
kernel: pipelined read ahead for the mount cache
this changes devmnt adding mntrahread() function and some helpers
for it to do pipelined sequential read ahead for the mount cache.
basically, cread() calls mntrahread() with Mntrah structure and it
figures out if we where reading sequentially and if thats the case
issues reads of c->iounit size in advance.
the read ahead state (Mntrah) is kept in the mount cache so we can
handle (read ahead) cache invalidation in the presence of writes.
Diffstat (limited to 'sys/src/9/port/portdat.h')
-rw-r--r-- | sys/src/9/port/portdat.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sys/src/9/port/portdat.h b/sys/src/9/port/portdat.h index 106f016f8..16f24a10d 100644 --- a/sys/src/9/port/portdat.h +++ b/sys/src/9/port/portdat.h @@ -16,7 +16,9 @@ typedef struct Log Log; typedef struct Logflag Logflag; typedef struct Mntcache Mntcache; typedef struct Mount Mount; +typedef struct Mntrah Mntrah; typedef struct Mntrpc Mntrpc; +typedef struct Mntproc Mntproc; typedef struct Mnt Mnt; typedef struct Mhead Mhead; typedef struct Note Note; @@ -270,6 +272,29 @@ struct Mhead Mhead* hash; /* Hash chain */ }; +struct Mntrah +{ + Rendez; + + ulong vers; + + vlong off; + vlong seq; + + uint i; + Mntrpc *r[8]; +}; + +struct Mntproc +{ + Rendez; + + Mnt *m; + Mntrpc *r; + void *a; + void (*f)(Mntrpc*, void*); +}; + struct Mnt { Lock; @@ -277,6 +302,7 @@ struct Mnt Chan *c; /* Channel to file service */ Proc *rip; /* Reader in progress */ Mntrpc *queue; /* Queue of pending requests on this channel */ + Mntproc defered[8]; /* Worker processes for defered RPCs (read ahead) */ ulong id; /* Multiplexer id for channel check */ Mnt *list; /* Free list */ int flags; /* cache */ |