Lines Matching refs:inode

456  *       has been created without an inode, it won't overflow the buffer.
486 * the buffer, since we created the search context without an inode.
519 * using inode
524 * get inode of parent
527 int utils_inode_get_name(ntfs_inode *inode, char *buffer, int bufsize)
542 if (!inode || !buffer) {
547 vol = inode->vol;
554 ctx = ntfs_attr_get_search_ctx(inode, NULL);
560 //ntfs_log_debug("i = %d, inode = %p (%lld)\n", i, inode, inode->mft_no);
587 long long)inode->mft_no);
597 if (i > 0) /* Don't close the original inode */
598 ntfs_inode_close(inode);
601 //ntfs_log_debug("inode 5\n");
605 inode = ntfs_inode_open(vol, parent);
606 if (!inode) {
607 ntfs_log_error("Couldn't open inode %llu.\n",
784 * @mref: MFT Reference (inode number)
853 * utils_is_metadata - Determine if an inode represents a metadata file
854 * @inode: An ntfs inode to be tested
857 * They can be identified by their inode number (offset in MFT/$DATA) or by
860 * Return: 1 inode is a metadata file
861 * 0 inode is not a metadata file
864 int utils_is_metadata(ntfs_inode *inode)
872 if (!inode) {
877 vol = inode->vol;
881 num = inode->mft_no;
885 file = inode->mrec;
892 rec = find_first_attribute(AT_FILE_NAME, inode->mrec);
1000 if (ctx->inode)
1001 ntfs_inode_close(ctx->inode);
1021 if (ctx->inode) {
1022 ntfs_inode_close(ctx->inode);
1023 ctx->inode = NULL;
1035 ntfs_log_error("Error reading inode %llu. Aborting.\n",
1043 ctx->inode = ntfs_inode_open(ctx->vol, (MFT_REF) ctx->mft_num);
1044 if (ctx->inode == NULL) {
1054 "Error reading inode %lld.\n",
1060 "extent of inode %lld.\n",
1068 attr10 = find_first_attribute(AT_STANDARD_INFORMATION, ctx->inode->mrec);
1069 attr20 = find_first_attribute(AT_ATTRIBUTE_LIST, ctx->inode->mrec);
1070 attr80 = find_first_attribute(AT_DATA, ctx->inode->mrec);
1084 attr_ctx = ntfs_attr_get_search_ctx(ctx->inode, NULL);
1096 switch (utils_is_metadata(ctx->inode)) {
1101 //ntfs_log_error("Error reading inode %lld.\n", ctx->mft_num);
1110 ctx->inode = (ntfs_inode*)calloc(1, sizeof(*ctx->inode));
1111 if (!ctx->inode) {
1116 ctx->inode->mft_no = ctx->mft_num;
1117 ctx->inode->vol = ctx->vol;
1118 ctx->inode->mrec = ntfs_malloc(ctx->vol->mft_record_size);
1119 if (!ctx->inode->mrec) {
1120 free(ctx->inode); // == ntfs_inode_close
1132 if (ntfs_attr_pread(mft, ctx->vol->mft_record_size * ctx->mft_num, ctx->vol->mft_record_size, ctx->inode->mrec) < ctx->vol->mft_record_size) {
1147 if (ntfs_inode_close(ctx->inode)) {
1148 ntfs_log_error("Error closing inode %llu.\n",
1153 ctx->inode = NULL;
1156 return (ctx->inode == NULL);