usr/src/uts/common/fs/zfs/zfs_dir.c
changeset 6492 903545192033
parent 5959 1e1904b8526d
child 6992 20c04e18c58c
equal deleted inserted replaced
6491:448e02e63395 6492:903545192033
    72 		boolean_t conflict = B_FALSE;
    72 		boolean_t conflict = B_FALSE;
    73 		size_t bufsz = 0;
    73 		size_t bufsz = 0;
    74 		char *buf = NULL;
    74 		char *buf = NULL;
    75 
    75 
    76 		if (rpnp) {
    76 		if (rpnp) {
    77 			buf = rpnp->pn_path;
    77 			buf = rpnp->pn_buf;
    78 			bufsz = rpnp->pn_bufsize;
    78 			bufsz = rpnp->pn_bufsize;
    79 		}
    79 		}
    80 		if (exact)
    80 		if (exact)
    81 			mt = MT_EXACT;
    81 			mt = MT_EXACT;
    82 		/*
    82 		/*
    83 		 * In the non-mixed case we only expect there would ever
    83 		 * In the non-mixed case we only expect there would ever
    84 		 * be one match, but we need to use the normalizing lookup.
    84 		 * be one match, but we need to use the normalizing lookup.
    85 		 */
    85 		 */
    86 		error = zap_lookup_norm(zfsvfs->z_os, dzp->z_id, name, 8, 1,
    86 		error = zap_lookup_norm(zfsvfs->z_os, dzp->z_id, name, 8, 1,
    87 		    zoid, mt, buf, bufsz, &conflict);
    87 		    zoid, mt, buf, bufsz, &conflict);
    88 		if (deflags)
    88 		if (!error && deflags)
    89 			*deflags = conflict ? ED_CASE_CONFLICT : 0;
    89 			*deflags = conflict ? ED_CASE_CONFLICT : 0;
    90 	} else {
    90 	} else {
    91 		error = zap_lookup(zfsvfs->z_os, dzp->z_id, name, 8, 1, zoid);
    91 		error = zap_lookup(zfsvfs->z_os, dzp->z_id, name, 8, 1, zoid);
    92 	}
    92 	}
    93 	*zoid = ZFS_DIRENT_OBJ(*zoid);
    93 	*zoid = ZFS_DIRENT_OBJ(*zoid);
   399 			dzp->z_zn_prefetch = B_TRUE; /* enable prefetching */
   399 			dzp->z_zn_prefetch = B_TRUE; /* enable prefetching */
   400 		}
   400 		}
   401 		rpnp = NULL;
   401 		rpnp = NULL;
   402 	}
   402 	}
   403 
   403 
   404 	if ((flags & FIGNORECASE) && rpnp)
   404 	if ((flags & FIGNORECASE) && rpnp && !error)
   405 		(void) strlcpy(rpnp->pn_path, name, rpnp->pn_bufsize);
   405 		(void) strlcpy(rpnp->pn_buf, name, rpnp->pn_bufsize);
   406 
   406 
   407 	return (error);
   407 	return (error);
   408 }
   408 }
   409 
   409 
   410 static char *
   410 static char *