1/*
2 * Copyright (c) 2000-2001, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 15 unchanged lines hidden (view full) ---
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/fs/smbfs/smbfs_io.c 107821 2002-12-13 10:15:01Z tjr $
33 *
34 */
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/resourcevar.h> /* defines plimit structure in proc struct */
38#include <sys/kernel.h>
39#include <sys/proc.h>
40#include <sys/fcntl.h>
--- 63 unchanged lines hidden (view full) ---
104 (np->n_parent ? VTOSMB(np->n_parent)->n_ino : 2);
105 if (de.d_fileno == 0)
106 de.d_fileno = 0x7ffffffd + offset;
107 de.d_namlen = offset + 1;
108 de.d_name[0] = '.';
109 de.d_name[1] = '.';
110 de.d_name[offset + 1] = '\0';
111 de.d_type = DT_DIR;
112 error = uiomove((caddr_t)&de, DE_SIZE, uio);
113 if (error)
114 return error;
115 offset++;
116 uio->uio_offset += DE_SIZE;
117 }
118 if (limit == 0)
119 return 0;
120 if (offset != np->n_dirofs || np->n_dirseq == NULL) {
--- 39 unchanged lines hidden (view full) ---
160 ctx->f_nmlen, &ctx->f_attr, &newvp);
161 if (!error) {
162 cn.cn_nameptr = de.d_name;
163 cn.cn_namelen = de.d_namlen;
164 cache_enter(vp, newvp, &cn);
165 vput(newvp);
166 }
167 }
168 error = uiomove((caddr_t)&de, DE_SIZE, uio);
169 if (error)
170 break;
171 }
172 if (error == ENOENT)
173 error = 0;
174 uio->uio_offset = offset * DE_SIZE;
175 return error;
176}
--- 538 unchanged lines hidden ---
2 * Copyright (c) 2000-2001, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 15 unchanged lines hidden (view full) ---
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/fs/smbfs/smbfs_io.c 107821 2002-12-13 10:15:01Z tjr $
33 *
34 */
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/resourcevar.h> /* defines plimit structure in proc struct */
38#include <sys/kernel.h>
39#include <sys/proc.h>
40#include <sys/fcntl.h>
--- 63 unchanged lines hidden (view full) ---
104 (np->n_parent ? VTOSMB(np->n_parent)->n_ino : 2);
105 if (de.d_fileno == 0)
106 de.d_fileno = 0x7ffffffd + offset;
107 de.d_namlen = offset + 1;
108 de.d_name[0] = '.';
109 de.d_name[1] = '.';
110 de.d_name[offset + 1] = '\0';
111 de.d_type = DT_DIR;
112 error = uiomove((caddr_t)&de, DE_SIZE, uio);
113 if (error)
114 return error;
115 offset++;
116 uio->uio_offset += DE_SIZE;
117 }
118 if (limit == 0)
119 return 0;
120 if (offset != np->n_dirofs || np->n_dirseq == NULL) {
--- 39 unchanged lines hidden (view full) ---
160 ctx->f_nmlen, &ctx->f_attr, &newvp);
161 if (!error) {
162 cn.cn_nameptr = de.d_name;
163 cn.cn_namelen = de.d_namlen;
164 cache_enter(vp, newvp, &cn);
165 vput(newvp);
166 }
167 }
168 error = uiomove((caddr_t)&de, DE_SIZE, uio);
169 if (error)
170 break;
171 }
172 if (error == ENOENT)
173 error = 0;
174 uio->uio_offset = offset * DE_SIZE;
175 return error;
176}
--- 538 unchanged lines hidden ---