inode: and a quick fixup for the fixup
authorAlan Cox <alan@linux.intel.com>
Tue, 17 Apr 2018 22:17:28 +0000 (23:17 +0100)
committerAlan Cox <alan@linux.intel.com>
Tue, 17 Apr 2018 22:17:28 +0000 (23:17 +0100)
This is too ugly to live long term but will do for the moment while I figure
out the proper way to deal with this and avoid things like the double search.

Possibly we need a unified 'bread' related operation that gets the contents
of a buffer into user space, by any means needed.

Something like

bp = bfind(...)
if (bp || !user) {
if (bp == NULL)
bread_no_lookup()
update fields
copy to user
unlock
return
}
issue raw copy to user page

Kernel/inode.c

index dacfb7c..d412343 100644 (file)
@@ -123,6 +123,9 @@ void readi(regptr inoptr ino, uint8_t flag)
                                        bp = bread(dev, pblk, 0);
                                        if (bp == NULL)
                                                break;
+                               } else {
+                                       /* FIXME: this has to get sorted ASAP */
+                                       bp->bf_time = ++bufclock;
                                }
                                uputblk(bp, uoff(), amount);