• J. R. Okajima's avatar
    aufs: export via NFS 1/2, body · c470ddd6
    J. R. Okajima authored
    
    
    Implement exporting via NFS.
    The file handle is rather large (40 bytes at most + the file handle on a
    branch).
    The non-virtual filesystems can use an anonymous (disconnected) dentry
    as long as the inode is identified, but aufs needs a dentry with dinfo
    which is usually constructed.  So aufs has to find or generate the
    normal dentry from the file handle in decoding.  Eg. in aufs, there
    should never be the anonymous dentry.
    
    In decoding the file handle, if both of the dentry and the inode which
    are corresponding the file handle are still in cache, then they are
    returned immediately.  Otherwise aufs has to find the cached parent dir
    from the file handle.  If the parent dir is not cached either, the aufs
    tries these steps.
    - decode the branch fs's file handle and get the parent dir
    - generate the path of the parent dir on the branch
    - convert the branch path to aufs's path
    - lookup the inode number under the aufs' path
    The last one is the slowest case.
    
    exportfs_decode_fh() (actually reconnect_path()) acquires mutex, and
    this behaviour violates the locking order between aufs si_rwsem.  This
    is not a problem since internal exportfs_decode_fh() is called for the
    branch fs.
    Simply use lockdep_off/on to silence the lockdep message.
    
    See also the document in later commit.
    This is compiled only when CONFIG_AUFS_EXPORT is enabled.
    Signed-off-by: default avatarJ. R. Okajima <hooanon05g@gmail.com>
    c470ddd6
xino.c 38.7 KB