Lines Matching defs:inode
381 * has been created without an inode, it won't overflow the buffer.
411 * the buffer, since we created the search context without an inode.
444 * using inode
449 * get inode of parent
452 int utils_inode_get_name(ntfs_inode *inode, char *buffer, int bufsize)
467 if (!inode || !buffer) {
472 vol = inode->vol;
479 ctx = ntfs_attr_get_search_ctx(inode, NULL);
485 //ntfs_log_debug("i = %d, inode = %p (%lld)\n", i, inode, inode->mft_no);
512 long long)inode->mft_no);
522 if (i > 0) /* Don't close the original inode */
523 ntfs_inode_close(inode);
526 //ntfs_log_debug("inode 5\n");
530 inode = ntfs_inode_open(vol, parent);
531 if (!inode) {
532 ntfs_log_error("Couldn't open inode %llu.\n",
701 * @mref: MFT Reference (inode number)
768 * utils_is_metadata - Determine if an inode represents a metadata file
769 * @inode: An ntfs inode to be tested
772 * They can be identified by their inode number (offset in MFT/$DATA) or by
775 * Return: 1 inode is a metadata file
776 * 0 inode is not a metadata file
779 int utils_is_metadata(ntfs_inode *inode)
787 if (!inode) {
792 vol = inode->vol;
796 num = inode->mft_no;
800 file = inode->mrec;
806 file = inode->mrec;
808 rec = find_first_attribute(AT_FILE_NAME, inode->mrec);
916 if (ctx->inode)
917 ntfs_inode_close(ctx->inode);
937 if (ctx->inode) {
938 ntfs_inode_close(ctx->inode);
939 ctx->inode = NULL;
951 ntfs_log_error("Error reading inode %llu. Aborting.\n",
959 ctx->inode = ntfs_inode_open(ctx->vol, (MFT_REF) ctx->mft_num);
960 if (ctx->inode == NULL) {
961 ntfs_log_error("Error reading inode %llu.\n", (unsigned
966 attr10 = find_first_attribute(AT_STANDARD_INFORMATION, ctx->inode->mrec);
967 attr20 = find_first_attribute(AT_ATTRIBUTE_LIST, ctx->inode->mrec);
968 attr80 = find_first_attribute(AT_DATA, ctx->inode->mrec);
982 attr_ctx = ntfs_attr_get_search_ctx(ctx->inode, NULL);
994 switch (utils_is_metadata(ctx->inode)) {
999 //ntfs_log_error("Error reading inode %lld.\n", ctx->mft_num);
1008 ctx->inode = calloc(1, sizeof(*ctx->inode));
1009 if (!ctx->inode) {
1014 ctx->inode->mft_no = ctx->mft_num;
1015 ctx->inode->vol = ctx->vol;
1016 ctx->inode->mrec = ntfs_malloc(ctx->vol->mft_record_size);
1017 if (!ctx->inode->mrec) {
1018 free(ctx->inode); // == ntfs_inode_close
1030 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) {
1045 if (ntfs_inode_close(ctx->inode)) {
1046 ntfs_log_error("Error closing inode %llu.\n",
1051 ctx->inode = NULL;
1054 return (ctx->inode == NULL);