* index_get_size - Find the INDX block size from the index root * @inode: Inode of the directory to be checked * * Find the size of a directory's INDX block from the INDEX_ROOT attribute. * * Return: n Success, the INDX blocks are n bytes in size * 0 Error, not a directory */
| 125 | * 0 Error, not a directory |
| 126 | */ |
| 127 | static int index_get_size(ntfs_inode *inode) |
| 128 | { |
| 129 | ATTR_RECORD *attr90; |
| 130 | INDEX_ROOT *iroot; |
| 131 | |
| 132 | attr90 = find_first_attribute(AT_INDEX_ROOT, inode->mrec); |
| 133 | if (!attr90) |
| 134 | return 0; // not a directory |
| 135 | |
| 136 | iroot = (INDEX_ROOT*)((u8*)attr90 + le16_to_cpu(attr90->value_offset)); |
| 137 | |
| 138 | return iroot->index_block_size; |
| 139 | } |
| 140 | |
| 141 | #ifdef HAVE_ICONV |
| 142 | static int ntfs_ucstoutf8(iconv_t cd, const ntfschar *ins, const int ins_len, char **outs, const int outs_len) |
no test coverage detected