summaryrefslogtreecommitdiffstats
path: root/sbin/dump/tape.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-06-21 06:18:05 +0000
committermckusick <mckusick@FreeBSD.org>2002-06-21 06:18:05 +0000
commit88d85c15ef183c06524d6ca695f62c0c0672b00c (patch)
treef1364dbfb9835934a3879b5904f7ff9a1495744c /sbin/dump/tape.c
parenteacb69b0197a8553d5004aa99532cabad8778e36 (diff)
downloadFreeBSD-src-88d85c15ef183c06524d6ca695f62c0c0672b00c.zip
FreeBSD-src-88d85c15ef183c06524d6ca695f62c0c0672b00c.tar.gz
This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit block pointers. It also adds a file-creation time field, an ability to use jumbo blocks per inode to allow extent like pointer density, and space for extended attributes (up to twice the filesystem block size worth of attributes, e.g., on a 16K filesystem, there is space for 32K of attributes). UFS2 fully supports and runs existing UFS1 filesystems. New filesystems built using newfs can be built in either UFS1 or UFS2 format using the -O option. In this commit UFS1 is the default format, so if you want to build UFS2 format filesystems, you must specify -O 2. This default will be changed to UFS2 when UFS2 proves itself to be stable. In this commit the boot code for reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c) as there is insufficient space in the boot block. Once the size of the boot block is increased, this code can be defined. Things to note: the definition of SBSIZE has changed to SBLOCKSIZE. The header file <ufs/ufs/dinode.h> must be included before <ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and ufs_lbn_t. Still TODO: Verify that the first level bootstraps work for all the architectures. Convert the utility ffsinfo to understand UFS2 and test growfs. Add support for the extended attribute storage. Update soft updates to ensure integrity of extended attribute storage. Switch the current extended attribute interfaces to use the extended attribute storage. Add the extent like functionality (framework is there, but is currently never used). Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@freebsd.org>
Diffstat (limited to 'sbin/dump/tape.c')
-rw-r--r--sbin/dump/tape.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c
index 215d73b2..d13142e 100644
--- a/sbin/dump/tape.c
+++ b/sbin/dump/tape.c
@@ -62,7 +62,7 @@ static const char rcsid[] =
#include "dump.h"
int writesize; /* size of malloc()ed buffer for tape */
-long lastspclrec = -1; /* tape block number of last written header */
+int64_t lastspclrec = -1; /* tape block number of last written header */
int trecno = 0; /* next record to write in current block */
extern long blocksperfile; /* number of blocks per output file */
long blocksthisvol; /* number of blocks on current output file */
@@ -87,21 +87,21 @@ static void rollforward(void);
* The following structure defines the instruction packets sent to slaves.
*/
struct req {
- ufs_daddr_t dblk;
+ ufs2_daddr_t dblk;
int count;
};
int reqsiz;
#define SLAVES 3 /* 1 slave writing, 1 reading, 1 for slack */
struct slave {
- int tapea; /* header number at start of this chunk */
+ int64_t tapea; /* header number at start of this chunk */
+ int64_t firstrec; /* record number of this block */
int count; /* count to next header (used for TS_TAPE */
/* after EOT) */
int inode; /* inode that we are currently dealing with */
int fd; /* FD for this slave */
int pid; /* PID for this slave */
int sent; /* 1 == we've sent this slave requests */
- int firstrec; /* record number of this block */
char (*tblock)[TP_BSIZE]; /* buffer for data blocks */
struct req *req; /* buffer for requests */
} slaves[SLAVES+1];
@@ -161,7 +161,7 @@ void
writerec(char *dp, int isspcl)
{
- slp->req[trecno].dblk = (ufs_daddr_t)0;
+ slp->req[trecno].dblk = (ufs2_daddr_t)0;
slp->req[trecno].count = 1;
/* Can't do a structure assignment due to alignment problems */
bcopy(dp, *(nextblock)++, sizeof (union u_spcl));
@@ -174,9 +174,10 @@ writerec(char *dp, int isspcl)
}
void
-dumpblock(ufs_daddr_t blkno, int size)
+dumpblock(ufs2_daddr_t blkno, int size)
{
- int avail, tpblks, dblkno;
+ int avail, tpblks;
+ ufs2_daddr_t dblkno;
dblkno = fsbtodb(sblock, blkno);
tpblks = size >> tp_bshift;
@@ -226,7 +227,7 @@ static void
flushtape(void)
{
int i, blks, got;
- long lastfirstrec;
+ int64_t lastfirstrec;
int siz = (char *)nextblock - (char *)slp->req;
@@ -385,7 +386,8 @@ rollforward(void)
{
struct req *p, *q, *prev;
struct slave *tslp;
- int i, size, savedtapea, got;
+ int i, size, got;
+ int64_t savedtapea;
union u_spcl *ntb, *otb;
tslp = &slaves[SLAVES];
ntb = (union u_spcl *)tslp->tblock[1];
@@ -618,9 +620,7 @@ restore_check_point:
spcl.c_firstrec = slp->firstrec;
spcl.c_volume++;
spcl.c_type = TS_TAPE;
- spcl.c_flags |= DR_NEWHEADER;
writeheader((ino_t)slp->inode);
- spcl.c_flags &=~ DR_NEWHEADER;
if (tapeno > 1)
msg("Volume %d begins with blocks from inode %d\n",
tapeno, slp->inode);
OpenPOWER on IntegriCloud