Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/msdosfs/msdosfs_vnops.c
Show First 20 Lines • Show All 1,552 Lines • ▼ Show 20 Lines | if (offset < bias) { | ||||
strcpy(dirbuf.d_name, "."); | strcpy(dirbuf.d_name, "."); | ||||
break; | break; | ||||
case 1: | case 1: | ||||
dirbuf.d_namlen = 2; | dirbuf.d_namlen = 2; | ||||
strcpy(dirbuf.d_name, ".."); | strcpy(dirbuf.d_name, ".."); | ||||
break; | break; | ||||
} | } | ||||
dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); | dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); | ||||
/* NOTE: d_off is the offset of the *next* entry. */ | |||||
dirbuf.d_off = offset + sizeof(struct direntry); | |||||
if (uio->uio_resid < dirbuf.d_reclen) | if (uio->uio_resid < dirbuf.d_reclen) | ||||
goto out; | goto out; | ||||
error = uiomove(&dirbuf, dirbuf.d_reclen, uio); | error = uiomove(&dirbuf, dirbuf.d_reclen, uio); | ||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
offset += sizeof(struct direntry); | offset += sizeof(struct direntry); | ||||
off = offset; | off = offset; | ||||
if (cookies) { | if (cookies) { | ||||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | #endif | ||||
((pmp->pm_flags & MSDOSFSMNT_SHORTNAME) ? | ((pmp->pm_flags & MSDOSFSMNT_SHORTNAME) ? | ||||
(LCASE_BASE | LCASE_EXT) : 0), | (LCASE_BASE | LCASE_EXT) : 0), | ||||
pmp); | pmp); | ||||
mbnambuf_init(&nb); | mbnambuf_init(&nb); | ||||
} else | } else | ||||
mbnambuf_flush(&nb, &dirbuf); | mbnambuf_flush(&nb, &dirbuf); | ||||
chksum = -1; | chksum = -1; | ||||
dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); | dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); | ||||
/* NOTE: d_off is the offset of the *next* entry. */ | |||||
dirbuf.d_off = offset + sizeof(struct direntry); | |||||
if (uio->uio_resid < dirbuf.d_reclen) { | if (uio->uio_resid < dirbuf.d_reclen) { | ||||
brelse(bp); | brelse(bp); | ||||
goto out; | goto out; | ||||
} | } | ||||
error = uiomove(&dirbuf, dirbuf.d_reclen, uio); | error = uiomove(&dirbuf, dirbuf.d_reclen, uio); | ||||
if (error) { | if (error) { | ||||
brelse(bp); | brelse(bp); | ||||
goto out; | goto out; | ||||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |