Fix opening particular file's attributes (as described in man page).

This is useful for debug purposes.

MFC after:	2 weeks
This commit is contained in:
Semen Ustimenko 2001-09-08 22:59:12 +00:00
parent ebcc9d9c8c
commit 0895d6c389
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83227

View file

@ -740,8 +740,12 @@ ntfs_fget(
dprintf(("ntfs_fget: allocating fnode: %p\n",fp));
fp->f_ip = ip;
fp->f_attrname = attrname;
if (fp->f_attrname) fp->f_flag |= FN_AATTRNAME;
if (attrname) {
fp->f_flag |= FN_AATTRNAME;
MALLOC(fp->f_attrname, char *, strlen(attrname)+1, M_TEMP, M_WAITOK);
strcpy(fp->f_attrname, attrname);
} else
fp->f_attrname = NULL;
fp->f_attrtype = attrtype;
ntfs_ntref(ip);
@ -821,14 +825,14 @@ ntfs_ntlookupattr(
goto out;
}
return (ENOENT);
}
} else
*attrtype = NTFS_A_DATA;
out:
if (namelen) {
MALLOC((*attrname), char *, namelen, M_TEMP, M_WAITOK);
memcpy((*attrname), name, namelen);
(*attrname)[namelen] = '\0';
*attrtype = NTFS_A_DATA;
}
return (0);
@ -948,17 +952,18 @@ ntfs_ntlookupfile(
goto fail;
}
/* vget node, but don't load it */
error = ntfs_vgetex(ntmp->ntm_mountp,
iep->ie_number, attrtype, attrname,
LK_EXCLUSIVE, VG_DONTLOADIN | VG_DONTVALIDFN,
curproc, &nvp);
/* free the buffer returned by ntfs_ntlookupattr() */
if (attrname) {
FREE(attrname, M_TEMP);
attrname = NULL;
}
/* vget node, but don't load it */
error = ntfs_vgetex(ntmp->ntm_mountp,
iep->ie_number, attrtype, attrname,
LK_EXCLUSIVE, VG_DONTLOADIN | VG_DONTVALIDFN,
curproc, &nvp);
if (error)
goto fail;