Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-20514

improve 'll_get_name()' to use 'trusted.link' xattr

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • 3
    • 9223372036854775807

      The ll_get_name() function used for finding the filename for NFS file handles is walking the parent directories with ll_dir_read() calling ll_nfs_get_name_filldir() to iterate over all of the directory entries and comparing the dirent FID with the file handle FID to see if that is the filename (ignoring the case if there are multiple hard links to a file).

      It would be more efficient to look up the inode FID and use the trusted.link xattr to resolve the filename for a file directly instead of walking every entry in a directory (or at least half on average, and likely repeating for each parent all the way up the root).

      I suspect that the child inode FID is already in memory on the client (since this is the whole point of the by-FID lookup) so the trusted.link xattr is probably available directly on the client without an RPC. It may just be a matter of splitting the core code out of ll_getparent() to be usable by the kernel and changing ll_get_name() to call it?

            wc-triage WC Triage
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: