summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsemenu <semenu@FreeBSD.org>2001-09-08 22:59:12 +0000
committersemenu <semenu@FreeBSD.org>2001-09-08 22:59:12 +0000
commit4c1e7080405406e7885d4dacb3b08ac2b6942255 (patch)
tree5ac0a91bb31af4424e7ba8037654ba26fb9a038b /sys
parent4d49e9cd2b3b7ec38d869f666721755924573788 (diff)
downloadFreeBSD-src-4c1e7080405406e7885d4dacb3b08ac2b6942255.zip
FreeBSD-src-4c1e7080405406e7885d4dacb3b08ac2b6942255.tar.gz
Fix opening particular file's attributes (as described in man page).
This is useful for debug purposes. MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/ntfs/ntfs_subr.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sys/fs/ntfs/ntfs_subr.c b/sys/fs/ntfs/ntfs_subr.c
index 2a2177c..7b9ae76 100644
--- a/sys/fs/ntfs/ntfs_subr.c
+++ b/sys/fs/ntfs/ntfs_subr.c
@@ -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;
OpenPOWER on IntegriCloud