Lines Matching refs:na

1339  * @na:		ntfs attribute to perform initialization for
1343 * successfully obtained FEK, then @na->crypto is allocated and FEK stored
1344 * inside. In the other case @na->crypto is set to NULL.
1348 int ntfs_crypto_attr_open(ntfs_attr *na)
1353 na->crypto = NULL;
1354 if (!na || !NAttrEncrypted(na)) {
1364 fek = ntfs_inode_fek_get(na->ni, ntfs_crypto_ctx.rsa_key[i]);
1366 na->crypto = ntfs_malloc(sizeof(ntfs_crypto_attr));
1367 if (!na->crypto)
1369 na->crypto->fek = fek;
1381 * @na: ntfs attribute to perform deinitialization for
1386 void ntfs_crypto_attr_close(ntfs_attr *na)
1388 if (!na || !NAttrEncrypted(na))
1391 if (na->crypto) {
1392 ntfs_fek_release(na->crypto->fek);
1393 free(na->crypto);
1400 * @na: ntfs attribute to read from
1408 s64 ntfs_crypto_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b)
1414 if (!na || pos < 0 || count < 0 || !b || !NAttrEncrypted(na)) {
1421 if (!na->crypto) {
1430 ntfs_attr_map_runlist_range(na, pos >> na->ni->vol->cluster_size_bits,
1431 (pos + count - 1) >> na->ni->vol->cluster_size_bits);
1435 while (total < count && offset < na->data_size) {
1440 if (offset + length > na->data_size)
1441 length = na->data_size - offset;
1453 if (offset >= na->initialized_size) {
1459 bytes_read = ntfs_rl_pread(na->ni->vol, na->rl, offset,
1468 if ((i = ntfs_fek_decrypt_sector(na->crypto->fek, buffer,
1478 if (offset + length > na->initialized_size)
1479 memset(buffer + (na->initialized_size - offset), 0,
1480 offset + length - na->initialized_size);
1500 int ntfs_crypto_attr_open(ntfs_attr *na)
1502 na->crypto = NULL;
1507 void ntfs_crypto_attr_close(ntfs_attr *na)
1511 s64 ntfs_crypto_attr_pread(ntfs_attr *na, const s64 pos, s64 count,