open(): O_EVTONLY and O_NOATIME
O'Connor, Daniel
darius at dons.net.au
Thu Mar 9 04:40:44 UTC 2017
> On 9 Mar 2017, at 10:45, Rozhuk Ivan <rozhuk.im at gmail.com> wrote:
>
>> consider the most often cause for atime update, read(2): VFS
>> translates the syscall through all its layers into VOP_READ() call
>> for fs-specific action, and the signature of the call is
>> VOP_READ(struct vnode *, struct uio *, int ioflag, struct
>> ucred *); As you see, there file is already down-casted to vnode, and
>> of course we do not want the vnode to loose atime updates just
>> because one file is opened which asked for no atime updates. As
>> result, upper VFS layers must pass a flag to VOP_READ().
>>
>> You are welcome to finish the analysis and to prototype the solution.
>
> ????
> If file system cant be mount with NOATIME - then it already ready to support O_NOATIME.
Konstantin means that due to the way the file system driver gets requests there is no information about how they were opened in the first place.
This means that there is no way it could look at all the FDs which have this file open and see they are all noatime and then disable atime just for that one.
You are right in that if an FS can be mounted noatime it should be able to work but unfortunately there is no plumbing between the open of the file and the file system that supports that.
--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
More information about the freebsd-hackers
mailing list