Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Show First 20 Lines • Show All 2,523 Lines • ▼ Show 20 Lines | if (outcount + reclen > bufsize) { | ||||
break; | break; | ||||
} | } | ||||
if (flags & V_RDDIR_ENTFLAGS) { | if (flags & V_RDDIR_ENTFLAGS) { | ||||
/* | /* | ||||
* Add extended flag entry: | * Add extended flag entry: | ||||
*/ | */ | ||||
eodp->ed_ino = objnum; | eodp->ed_ino = objnum; | ||||
eodp->ed_reclen = reclen; | eodp->ed_reclen = reclen; | ||||
/* NOTE: ed_off is the offset for the *next* entry */ | /* NOTE: ed_off is the offset for the *next* entry. */ | ||||
next = &(eodp->ed_off); | next = &eodp->ed_off; | ||||
eodp->ed_eflags = zap.za_normalization_conflict ? | eodp->ed_eflags = zap.za_normalization_conflict ? | ||||
ED_CASE_CONFLICT : 0; | ED_CASE_CONFLICT : 0; | ||||
(void) strncpy(eodp->ed_name, zap.za_name, | (void) strncpy(eodp->ed_name, zap.za_name, | ||||
EDIRENT_NAMELEN(reclen)); | EDIRENT_NAMELEN(reclen)); | ||||
eodp = (edirent_t *)((intptr_t)eodp + reclen); | eodp = (edirent_t *)((intptr_t)eodp + reclen); | ||||
} else { | } else { | ||||
/* | /* | ||||
* Add normal entry: | * Add normal entry: | ||||
*/ | */ | ||||
odp->d_ino = objnum; | odp->d_ino = objnum; | ||||
odp->d_reclen = reclen; | odp->d_reclen = reclen; | ||||
odp->d_namlen = strlen(zap.za_name); | odp->d_namlen = strlen(zap.za_name); | ||||
/* NOTE: d_off is the offset for the *next* entry. */ | |||||
bapt: This probably needs a #ifdef __FreeBSD__ or a #ifndef illumos (same for all zfs changes) | |||||
Not Done Inline ActionsThe same statement exists "as is" in the other branch of the if statement (14 lines above) though jack_gandi.net: The same statement exists "as is" in the other branch of the if statement (14 lines above)… | |||||
Not Done Inline ActionsYou are right, never mind bapt: You are right, never mind | |||||
next = &odp->d_off; | |||||
Done Inline Actions() are excessive. kib: () are excessive. | |||||
Done Inline ActionsI agree, for the sake of symmetry I also changed the above statement. jack_gandi.net: I agree, for the sake of symmetry I also changed the above statement. | |||||
(void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); | (void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); | ||||
odp->d_type = type; | odp->d_type = type; | ||||
odp = (dirent64_t *)((intptr_t)odp + reclen); | odp = (dirent64_t *)((intptr_t)odp + reclen); | ||||
} | } | ||||
outcount += reclen; | outcount += reclen; | ||||
ASSERT(outcount <= bufsize); | ASSERT(outcount <= bufsize); | ||||
/* Prefetch znode */ | /* Prefetch znode */ | ||||
if (prefetch) | if (prefetch) | ||||
dmu_prefetch(os, objnum, 0, 0, 0, | dmu_prefetch(os, objnum, 0, 0, 0, | ||||
ZIO_PRIORITY_SYNC_READ); | ZIO_PRIORITY_SYNC_READ); | ||||
skip_entry: | skip_entry: | ||||
/* | /* | ||||
* Move to the next entry, fill in the previous offset. | * Move to the next entry, fill in the previous offset. | ||||
*/ | */ | ||||
if (offset > 2 || (offset == 2 && !zfs_show_ctldir(zp))) { | if (offset > 2 || (offset == 2 && !zfs_show_ctldir(zp))) { | ||||
zap_cursor_advance(&zc); | zap_cursor_advance(&zc); | ||||
offset = zap_cursor_serialize(&zc); | offset = zap_cursor_serialize(&zc); | ||||
} else { | } else { | ||||
offset += 1; | offset += 1; | ||||
} | } | ||||
/* Fill the offset right after advancing the cursor. */ | |||||
Done Inline ActionsWrite comments as the full sentences, i.e. upper-case the first word, end with dot. kib: Write comments as the full sentences, i.e. upper-case the first word, end with dot. | |||||
if (next != NULL) | |||||
*next = offset; | |||||
if (cooks != NULL) { | if (cooks != NULL) { | ||||
*cooks++ = offset; | *cooks++ = offset; | ||||
ncooks--; | ncooks--; | ||||
KASSERT(ncooks >= 0, ("ncookies=%d", ncooks)); | KASSERT(ncooks >= 0, ("ncookies=%d", ncooks)); | ||||
} | } | ||||
} | } | ||||
zp->z_zn_prefetch = B_FALSE; /* a lookup will re-enable pre-fetching */ | zp->z_zn_prefetch = B_FALSE; /* a lookup will re-enable pre-fetching */ | ||||
▲ Show 20 Lines • Show All 3,493 Lines • Show Last 20 Lines |
This probably needs a #ifdef FreeBSD or a #ifndef illumos (same for all zfs changes)