tables.c (99110) | tables.c (108533) |
---|---|
1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 27 unchanged lines hidden (view full) --- 36 */ 37 38#ifndef lint 39#if 0 40static char sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93"; 41#endif 42#endif /* not lint */ 43#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 27 unchanged lines hidden (view full) --- 36 */ 37 38#ifndef lint 39#if 0 40static char sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93"; 41#endif 42#endif /* not lint */ 43#include <sys/cdefs.h> |
44__FBSDID("$FreeBSD: head/bin/pax/tables.c 99110 2002-06-30 05:15:05Z obrien $"); | 44__FBSDID("$FreeBSD: head/bin/pax/tables.c 108533 2003-01-01 18:49:04Z schweikh $"); |
45 46#include <sys/types.h> 47#include <sys/time.h> 48#include <sys/stat.h> 49#include <sys/fcntl.h> 50#include <errno.h> 51#include <stdio.h> 52#include <stdlib.h> --- 206 unchanged lines hidden (view full) --- 259 */ 260 *ppt = pt->fow; 261 (void)free((char *)pt->name); 262 (void)free((char *)pt); 263} 264 265/* 266 * lnk_end() | 45 46#include <sys/types.h> 47#include <sys/time.h> 48#include <sys/stat.h> 49#include <sys/fcntl.h> 50#include <errno.h> 51#include <stdio.h> 52#include <stdlib.h> --- 206 unchanged lines hidden (view full) --- 259 */ 260 *ppt = pt->fow; 261 (void)free((char *)pt->name); 262 (void)free((char *)pt); 263} 264 265/* 266 * lnk_end() |
267 * pull apart a existing link table so we can reuse it. We do this between | 267 * Pull apart an existing link table so we can reuse it. We do this between |
268 * read and write phases of append with update. (The format may have 269 * used the link table, and we need to start with a fresh table for the | 268 * read and write phases of append with update. (The format may have 269 * used the link table, and we need to start with a fresh table for the |
270 * write phase | 270 * write phase). |
271 */ 272 273void 274lnk_end(void) 275{ 276 int i; 277 HRDLNK *pt; 278 HRDLNK *ppt; --- 30 unchanged lines hidden (view full) --- 309 * name on the archive it is added). This applies to writes and appends. 310 * An append with an -u must read the archive and store the modification time 311 * for every file on that archive before starting the write phase. It is clear 312 * that this is one HUGE database. To save memory space, the actual file names 313 * are stored in a scatch file and indexed by an in memory hash table. The 314 * hash table is indexed by hashing the file path. The nodes in the table store 315 * the length of the filename and the lseek offset within the scratch file 316 * where the actual name is stored. Since there are never any deletions to this | 271 */ 272 273void 274lnk_end(void) 275{ 276 int i; 277 HRDLNK *pt; 278 HRDLNK *ppt; --- 30 unchanged lines hidden (view full) --- 309 * name on the archive it is added). This applies to writes and appends. 310 * An append with an -u must read the archive and store the modification time 311 * for every file on that archive before starting the write phase. It is clear 312 * that this is one HUGE database. To save memory space, the actual file names 313 * are stored in a scatch file and indexed by an in memory hash table. The 314 * hash table is indexed by hashing the file path. The nodes in the table store 315 * the length of the filename and the lseek offset within the scratch file 316 * where the actual name is stored. Since there are never any deletions to this |
317 * table, fragmentation of the scratch file is never a issue. Lookups seem to | 317 * table, fragmentation of the scratch file is never an issue. Lookups seem to |
318 * not exhibit any locality at all (files in the database are rarely 319 * looked up more than once...). So caching is just a waste of memory. The 320 * only limitation is the amount of scatch file space available to store the 321 * path names. 322 */ 323 324/* 325 * ftime_start() --- 286 unchanged lines hidden (view full) --- 612 */ 613 return; 614} 615 616/* 617 * device/inode mapping table routines 618 * (used with formats that store device and inodes fields) 619 * | 318 * not exhibit any locality at all (files in the database are rarely 319 * looked up more than once...). So caching is just a waste of memory. The 320 * only limitation is the amount of scatch file space available to store the 321 * path names. 322 */ 323 324/* 325 * ftime_start() --- 286 unchanged lines hidden (view full) --- 612 */ 613 return; 614} 615 616/* 617 * device/inode mapping table routines 618 * (used with formats that store device and inodes fields) 619 * |
620 * device/inode mapping tables remap the device field in a archive header. The | 620 * device/inode mapping tables remap the device field in an archive header. The |
621 * device/inode fields are used to determine when files are hard links to each 622 * other. However these values have very little meaning outside of that. This 623 * database is used to solve one of two different problems. 624 * 625 * 1) when files are appended to an archive, while the new files may have hard 626 * links to each other, you cannot determine if they have hard links to any 627 * file already stored on the archive from a prior run of pax. We must assume 628 * that these inode/device pairs are unique only within a SINGLE run of pax --- 662 unchanged lines hidden --- | 621 * device/inode fields are used to determine when files are hard links to each 622 * other. However these values have very little meaning outside of that. This 623 * database is used to solve one of two different problems. 624 * 625 * 1) when files are appended to an archive, while the new files may have hard 626 * links to each other, you cannot determine if they have hard links to any 627 * file already stored on the archive from a prior run of pax. We must assume 628 * that these inode/device pairs are unique only within a SINGLE run of pax --- 662 unchanged lines hidden --- |