Deleted Added
full compact
ext2_lookup.c (105420) ext2_lookup.c (109623)
1/*
2 * modified for Lites 1.1
3 *
4 * Aug 1995, Godmar Back (gback@cs.utah.edu)
5 * University of Utah, Department of Computer Science
6 */
7/*
8 * Copyright (c) 1989, 1993

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

37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
41 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * SUCH DAMAGE.
43 *
44 * @(#)ufs_lookup.c 8.6 (Berkeley) 4/1/94
1/*
2 * modified for Lites 1.1
3 *
4 * Aug 1995, Godmar Back (gback@cs.utah.edu)
5 * University of Utah, Department of Computer Science
6 */
7/*
8 * Copyright (c) 1989, 1993

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

37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
41 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * SUCH DAMAGE.
43 *
44 * @(#)ufs_lookup.c 8.6 (Berkeley) 4/1/94
45 * $FreeBSD: head/sys/gnu/fs/ext2fs/ext2_lookup.c 105420 2002-10-18 21:41:41Z bde $
45 * $FreeBSD: head/sys/gnu/fs/ext2fs/ext2_lookup.c 109623 2003-01-21 08:56:16Z alfred $
46 */
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/namei.h>
51#include <sys/bio.h>
52#include <sys/buf.h>
53#include <sys/mount.h>

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

176#endif
177
178 auio = *uio;
179 auio.uio_iov = &aiov;
180 auio.uio_iovcnt = 1;
181 auio.uio_resid = count;
182 auio.uio_segflg = UIO_SYSSPACE;
183 aiov.iov_len = count;
46 */
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/namei.h>
51#include <sys/bio.h>
52#include <sys/buf.h>
53#include <sys/mount.h>

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

176#endif
177
178 auio = *uio;
179 auio.uio_iov = &aiov;
180 auio.uio_iovcnt = 1;
181 auio.uio_resid = count;
182 auio.uio_segflg = UIO_SYSSPACE;
183 aiov.iov_len = count;
184 MALLOC(dirbuf, caddr_t, count, M_TEMP, M_WAITOK);
184 MALLOC(dirbuf, caddr_t, count, M_TEMP, 0);
185 aiov.iov_base = dirbuf;
186 error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred);
187 if (error == 0) {
188 readcnt = count - auio.uio_resid;
189 edp = (struct ext2_dir_entry_2 *)&dirbuf[readcnt];
190 ncookies = 0;
191 bzero(&dstdp, offsetof(struct dirent, d_name));
192 for (dp = (struct ext2_dir_entry_2 *)dirbuf;

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

238
239 if (!error && ap->a_ncookies != NULL) {
240 u_long *cookiep, *cookies, *ecookies;
241 off_t off;
242
243 if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1)
244 panic("ext2fs_readdir: unexpected uio from NFS server");
245 MALLOC(cookies, u_long *, ncookies * sizeof(u_long), M_TEMP,
185 aiov.iov_base = dirbuf;
186 error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred);
187 if (error == 0) {
188 readcnt = count - auio.uio_resid;
189 edp = (struct ext2_dir_entry_2 *)&dirbuf[readcnt];
190 ncookies = 0;
191 bzero(&dstdp, offsetof(struct dirent, d_name));
192 for (dp = (struct ext2_dir_entry_2 *)dirbuf;

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

238
239 if (!error && ap->a_ncookies != NULL) {
240 u_long *cookiep, *cookies, *ecookies;
241 off_t off;
242
243 if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1)
244 panic("ext2fs_readdir: unexpected uio from NFS server");
245 MALLOC(cookies, u_long *, ncookies * sizeof(u_long), M_TEMP,
246 M_WAITOK);
246 0);
247 off = startoffset;
248 for (dp = (struct ext2_dir_entry_2 *)dirbuf,
249 cookiep = cookies, ecookies = cookies + ncookies;
250 cookiep < ecookies;
251 dp = (struct ext2_dir_entry_2 *)((caddr_t) dp + dp->rec_len)) {
252 off += dp->rec_len;
253 *cookiep++ = (u_long) off;
254 }

--- 856 unchanged lines hidden ---
247 off = startoffset;
248 for (dp = (struct ext2_dir_entry_2 *)dirbuf,
249 cookiep = cookies, ecookies = cookies + ncookies;
250 cookiep < ecookies;
251 dp = (struct ext2_dir_entry_2 *)((caddr_t) dp + dp->rec_len)) {
252 off += dp->rec_len;
253 *cookiep++ = (u_long) off;
254 }

--- 856 unchanged lines hidden ---