Skip to content
  • Eric Biggers's avatar
    vfs: Deduplicate code shared by xattr system calls operating on paths · 8cc43116
    Eric Biggers authored
    
    
    The following pairs of system calls dealing with extended attributes only
    differ in their behavior on whether the symbolic link is followed (when
    the named file is a symbolic link):
    
    - setxattr() and lsetxattr()
    - getxattr() and lgetxattr()
    - listxattr() and llistxattr()
    - removexattr() and lremovexattr()
    
    Despite this, the implementations all had duplicated code, so this commit
    redirects each of the above pairs of system calls to a corresponding
    function to which different lookup flags (LOOKUP_FOLLOW or 0) are passed.
    
    For me this reduced the stripped size of xattr.o from 8824 to 8248 bytes.
    
    Signed-off-by: default avatarEric Biggers <ebiggers3@gmail.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    8cc43116