• J
    cifs: avoid extra allocation for small cifs.idmap keys · 41a9f1f6
    Jeff Layton 提交于
    The cifs.idmap keytype always allocates memory to hold the payload from
    userspace. In the common case where we're translating a SID to a UID or
    GID, we're allocating memory to hold something that's less than or equal
    to the size of a pointer.
    
    When the payload is the same size as a pointer or smaller, just store
    it in the payload.value union member instead. That saves us an extra
    allocation on the sid_to_id upcall.
    
    Note that we have to take extra care to check the datalen when we
    go to dereference the .data pointer in the union, but the callers
    now check that as a matter of course anyway.
    Reviewed-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
    Signed-off-by: NJeff Layton <jlayton@redhat.com>
    Signed-off-by: NSteve French <smfrench@gmail.com>
    41a9f1f6
cifsacl.c 27.6 KB