Deleted Added
full compact
zfs_ctldir.c (330988) zfs_ctldir.c (341074)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 248 unchanged lines hidden (view full) ---

257 return (SET_ERROR(EINVAL));
258
259 if (uio->uio_offset < 0)
260 return (SET_ERROR(EINVAL));
261 if (uio->uio_offset == 0) {
262 entry.d_fileno = id;
263 entry.d_type = DT_DIR;
264 entry.d_name[0] = '.';
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 248 unchanged lines hidden (view full) ---

257 return (SET_ERROR(EINVAL));
258
259 if (uio->uio_offset < 0)
260 return (SET_ERROR(EINVAL));
261 if (uio->uio_offset == 0) {
262 entry.d_fileno = id;
263 entry.d_type = DT_DIR;
264 entry.d_name[0] = '.';
265 entry.d_name[1] = '\0';
266 entry.d_namlen = 1;
267 entry.d_reclen = sizeof(entry);
265 entry.d_namlen = 1;
266 entry.d_reclen = sizeof(entry);
267 dirent_terminate(&entry);
268 error = vfs_read_dirent(ap, &entry, uio->uio_offset);
269 if (error != 0)
270 return (SET_ERROR(error));
271 }
272
273 if (uio->uio_offset < sizeof(entry))
274 return (SET_ERROR(EINVAL));
275 if (uio->uio_offset == sizeof(entry)) {
276 entry.d_fileno = parent_id;
277 entry.d_type = DT_DIR;
278 entry.d_name[0] = '.';
279 entry.d_name[1] = '.';
268 error = vfs_read_dirent(ap, &entry, uio->uio_offset);
269 if (error != 0)
270 return (SET_ERROR(error));
271 }
272
273 if (uio->uio_offset < sizeof(entry))
274 return (SET_ERROR(EINVAL));
275 if (uio->uio_offset == sizeof(entry)) {
276 entry.d_fileno = parent_id;
277 entry.d_type = DT_DIR;
278 entry.d_name[0] = '.';
279 entry.d_name[1] = '.';
280 entry.d_name[2] = '\0';
281 entry.d_namlen = 2;
282 entry.d_reclen = sizeof(entry);
280 entry.d_namlen = 2;
281 entry.d_reclen = sizeof(entry);
282 dirent_terminate(&entry);
283 error = vfs_read_dirent(ap, &entry, uio->uio_offset);
284 if (error != 0)
285 return (SET_ERROR(error));
286 }
287
288 if (offp != NULL)
289 *offp = 2 * sizeof(entry);
290 return (0);

--- 398 unchanged lines hidden (view full) ---

689 return (SET_ERROR(EINVAL));
690
691 CTASSERT(sizeof(node->snapdir->sn_name) <= sizeof(entry.d_name));
692 entry.d_fileno = node->snapdir->sn_id;
693 entry.d_type = DT_DIR;
694 strcpy(entry.d_name, node->snapdir->sn_name);
695 entry.d_namlen = strlen(entry.d_name);
696 entry.d_reclen = sizeof(entry);
283 error = vfs_read_dirent(ap, &entry, uio->uio_offset);
284 if (error != 0)
285 return (SET_ERROR(error));
286 }
287
288 if (offp != NULL)
289 *offp = 2 * sizeof(entry);
290 return (0);

--- 398 unchanged lines hidden (view full) ---

689 return (SET_ERROR(EINVAL));
690
691 CTASSERT(sizeof(node->snapdir->sn_name) <= sizeof(entry.d_name));
692 entry.d_fileno = node->snapdir->sn_id;
693 entry.d_type = DT_DIR;
694 strcpy(entry.d_name, node->snapdir->sn_name);
695 entry.d_namlen = strlen(entry.d_name);
696 entry.d_reclen = sizeof(entry);
697 dirent_terminate(&entry);
697 error = vfs_read_dirent(ap, &entry, uio->uio_offset);
698 if (error != 0) {
699 if (error == ENAMETOOLONG)
700 error = 0;
701 return (SET_ERROR(error));
702 }
703 if (eofp != NULL)
704 *eofp = 1;

--- 387 unchanged lines hidden (view full) ---

1092 return (error);
1093 }
1094
1095 entry.d_fileno = id;
1096 entry.d_type = DT_DIR;
1097 strcpy(entry.d_name, snapname);
1098 entry.d_namlen = strlen(entry.d_name);
1099 entry.d_reclen = sizeof(entry);
698 error = vfs_read_dirent(ap, &entry, uio->uio_offset);
699 if (error != 0) {
700 if (error == ENAMETOOLONG)
701 error = 0;
702 return (SET_ERROR(error));
703 }
704 if (eofp != NULL)
705 *eofp = 1;

--- 387 unchanged lines hidden (view full) ---

1093 return (error);
1094 }
1095
1096 entry.d_fileno = id;
1097 entry.d_type = DT_DIR;
1098 strcpy(entry.d_name, snapname);
1099 entry.d_namlen = strlen(entry.d_name);
1100 entry.d_reclen = sizeof(entry);
1101 dirent_terminate(&entry);
1100 error = vfs_read_dirent(ap, &entry, uio->uio_offset);
1101 if (error != 0) {
1102 if (error == ENAMETOOLONG)
1103 error = 0;
1104 ZFS_EXIT(zfsvfs);
1105 return (SET_ERROR(error));
1106 }
1107 uio->uio_offset = cookie + dots_offset;

--- 251 unchanged lines hidden ---
1102 error = vfs_read_dirent(ap, &entry, uio->uio_offset);
1103 if (error != 0) {
1104 if (error == ENAMETOOLONG)
1105 error = 0;
1106 ZFS_EXIT(zfsvfs);
1107 return (SET_ERROR(error));
1108 }
1109 uio->uio_offset = cookie + dots_offset;

--- 251 unchanged lines hidden ---