Lines Matching refs:inode
454 * has been created without an inode, it won't overflow the buffer.
484 * the buffer, since we created the search context without an inode.
517 * using inode
522 * get inode of parent
525 int utils_inode_get_name(ntfs_inode *inode, char *buffer, int bufsize)
540 if (!inode || !buffer) {
545 vol = inode->vol;
552 ctx = ntfs_attr_get_search_ctx(inode, NULL);
558 //ntfs_log_debug("i = %d, inode = %p (%lld)\n", i, inode, inode->mft_no);
585 long long)inode->mft_no);
595 if (i > 0) /* Don't close the original inode */
596 ntfs_inode_close(inode);
599 //ntfs_log_debug("inode 5\n");
603 inode = ntfs_inode_open(vol, parent);
604 if (!inode) {
605 ntfs_log_error("Couldn't open inode %llu.\n",
776 * @mref: MFT Reference (inode number)
845 * utils_is_metadata - Determine if an inode represents a metadata file
846 * @inode: An ntfs inode to be tested
849 * They can be identified by their inode number (offset in MFT/$DATA) or by
852 * Return: 1 inode is a metadata file
853 * 0 inode is not a metadata file
856 int utils_is_metadata(ntfs_inode *inode)
864 if (!inode) {
869 vol = inode->vol;
873 num = inode->mft_no;
877 file = inode->mrec;
884 rec = find_first_attribute(AT_FILE_NAME, inode->mrec);
992 if (ctx->inode)
993 ntfs_inode_close(ctx->inode);
1013 if (ctx->inode) {
1014 ntfs_inode_close(ctx->inode);
1015 ctx->inode = NULL;
1027 ntfs_log_error("Error reading inode %llu. Aborting.\n",
1035 ctx->inode = ntfs_inode_open(ctx->vol, (MFT_REF) ctx->mft_num);
1036 if (ctx->inode == NULL) {
1046 "Error reading inode %lld.\n",
1052 "extent of inode %lld.\n",
1060 attr10 = find_first_attribute(AT_STANDARD_INFORMATION, ctx->inode->mrec);
1061 attr20 = find_first_attribute(AT_ATTRIBUTE_LIST, ctx->inode->mrec);
1062 attr80 = find_first_attribute(AT_DATA, ctx->inode->mrec);
1076 attr_ctx = ntfs_attr_get_search_ctx(ctx->inode, NULL);
1088 switch (utils_is_metadata(ctx->inode)) {
1093 //ntfs_log_error("Error reading inode %lld.\n", ctx->mft_num);
1102 ctx->inode = (ntfs_inode*)calloc(1, sizeof(*ctx->inode));
1103 if (!ctx->inode) {
1108 ctx->inode->mft_no = ctx->mft_num;
1109 ctx->inode->vol = ctx->vol;
1110 ctx->inode->mrec = ntfs_malloc(ctx->vol->mft_record_size);
1111 if (!ctx->inode->mrec) {
1112 free(ctx->inode); // == ntfs_inode_close
1124 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) {
1139 if (ntfs_inode_close(ctx->inode)) {
1140 ntfs_log_error("Error closing inode %llu.\n",
1145 ctx->inode = NULL;
1148 return (ctx->inode == NULL);