• Kirill Smelkov's avatar
    vfs: document that read/write & friends are called with file.f_pos_lock held · 8ea60779
    Kirill Smelkov authored
    Commit 9c225f26 ("vfs: atomic f_pos accesses as per POSIX") added
    locking on read/write/lseek for regular files so that the file position
    is updated atomically.
    
    Commit 10dce8af ("fs: stream_open - opener for stream-like files so
    that read and write can run simultaneously without deadlock") removed
    that locking if a file is stream-like, so that e.g. read don't deadlock
    simultaneous write.
    
    Document that file.f_pos_lock is held on read/write & co for regular
    files.
    
    In the documentation we can ignore the fact that f_pos_lock is not taken
    if there is only one single thread using the file, because it is just an
    optimization and does not affect semantic, by which multiple read /
    write cannot run simultaneously.
    Signed-off-by: Kirill Smelkov's avatarKirill Smelkov <kirr@nexedi.com>
    8ea60779
vfs.txt 54.5 KB