Lines Matching refs:fname
426 int lookup, struct fscrypt_name *fname) in fscrypt_setup_filename() argument
431 memset(fname, 0, sizeof(struct fscrypt_name)); in fscrypt_setup_filename()
432 fname->usr_fname = iname; in fscrypt_setup_filename()
435 fname->disk_name.name = (unsigned char *)iname->name; in fscrypt_setup_filename()
436 fname->disk_name.len = iname->len; in fscrypt_setup_filename()
446 &fname->crypto_buf.len)) in fscrypt_setup_filename()
448 fname->crypto_buf.name = kmalloc(fname->crypto_buf.len, in fscrypt_setup_filename()
450 if (!fname->crypto_buf.name) in fscrypt_setup_filename()
453 ret = fscrypt_fname_encrypt(dir, iname, fname->crypto_buf.name, in fscrypt_setup_filename()
454 fname->crypto_buf.len); in fscrypt_setup_filename()
457 fname->disk_name.name = fname->crypto_buf.name; in fscrypt_setup_filename()
458 fname->disk_name.len = fname->crypto_buf.len; in fscrypt_setup_filename()
463 fname->is_ciphertext_name = true; in fscrypt_setup_filename()
473 fname->crypto_buf.name = kmalloc(FSCRYPT_NOKEY_NAME_MAX, GFP_KERNEL); in fscrypt_setup_filename()
474 if (fname->crypto_buf.name == NULL) in fscrypt_setup_filename()
477 ret = base64_decode(iname->name, iname->len, fname->crypto_buf.name); in fscrypt_setup_filename()
484 fname->crypto_buf.len = ret; in fscrypt_setup_filename()
486 nokey_name = (void *)fname->crypto_buf.name; in fscrypt_setup_filename()
487 fname->hash = nokey_name->dirhash[0]; in fscrypt_setup_filename()
488 fname->minor_hash = nokey_name->dirhash[1]; in fscrypt_setup_filename()
491 fname->disk_name.name = nokey_name->bytes; in fscrypt_setup_filename()
492 fname->disk_name.len = in fscrypt_setup_filename()
498 kfree(fname->crypto_buf.name); in fscrypt_setup_filename()
517 bool fscrypt_match_name(const struct fscrypt_name *fname, in fscrypt_match_name() argument
521 (const void *)fname->crypto_buf.name; in fscrypt_match_name()
524 if (likely(fname->disk_name.name)) { in fscrypt_match_name()
525 if (de_name_len != fname->disk_name.len) in fscrypt_match_name()
527 return !memcmp(de_name, fname->disk_name.name, de_name_len); in fscrypt_match_name()