Trivial changes: whitespace and modes.

Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.

Signed-off-by: Dan Cross <cross@gajendra.net>
This commit is contained in:
Dan Cross 2020-01-10 14:44:21 +00:00
parent 77a0a5b519
commit fa325e9b42
1021 changed files with 5688 additions and 6193 deletions

View file

@ -46,7 +46,7 @@ blockput(Block *b)
return;
if(!b->_close){
fprint(2, "no blockPut\n");
abort();
abort();
}
(*b->_close)(b);
}

View file

@ -3,7 +3,7 @@
#include <diskfs.h>
/*
* Disk cache. Caches by offset, so higher levels have
* Disk cache. Caches by offset, so higher levels have
* to deal with alignment issues (if we get asked for the
* blocks at offsets 0 and 1, we'll do two reads).
*/
@ -43,7 +43,7 @@ addtohash(DiskCache *d, DiskCacheBlock *b, u64int offset)
if(b->offset != ~(u64int)0){
fprint(2, "bad offset in addtohash\n");
return;
return;
}
b->offset = offset;
h = offset % d->nhash;
@ -227,8 +227,8 @@ diskcacheread(Disk *dd, u32int len, u64int offset)
return b;
}
/*
* It's okay to remove these from the hash table.
/*
* It's okay to remove these from the hash table.
* Either the block is in use by someone or it is on
* the lru list. If it's in use it will get put on the lru
* list once the refs go away.
@ -264,7 +264,7 @@ diskcacheclose(Disk *dd)
blockput(b->subblock);
free(d);
}
/* needn't be fast */
static int
isprime(int n)

View file

@ -103,7 +103,7 @@ ext2blockread(Fsys *fsys, u64int vbno)
if(bno != vbno)
return nil;
/*
/*
if(bno < fs->firstblock)
return diskread(fs->disk, fs->blocksize, (u64int)bno*fs->blocksize);
*/
@ -142,7 +142,7 @@ ext2blockread(Fsys *fsys, u64int vbno)
if((bits[boff>>3] & (1<<(boff&7))) == 0){
if(debug)
fprint(2, "block %d not allocated in group %d: bitblock %d/%lld bits[%d] = %#x\n",
boff, bno/fs->blockspergroup,
boff, bno/fs->blockspergroup,
(int)bitblock,
bitpos,
boff>>3,
@ -174,7 +174,7 @@ ext2fileblock(Ext2 *fs, Inode *ino, u32int bno, int size)
obno = bno;
if(bno < NDIRBLOCKS){
if(debug)
fprint(2, "fileblock %d -> %d...",
fprint(2, "fileblock %d -> %d...",
bno, ino->block[bno]);
return ext2datablock(fs, ino->block[bno], size);
}
@ -592,7 +592,7 @@ ext2readdir(Fsys *fsys, SunAuthUnix *au, Nfs3Handle *h, u32int count, u64int coo
if((ok = inoperm(&ino, au, AREAD)) != Nfs3Ok)
return ok;
if(debug) print("readdir cookie %#llux ino.size %#llux\n",
if(debug) print("readdir cookie %#llux ino.size %#llux\n",
(u64int)cookie, (u64int)ino.size);
if(cookie >= ino.size){

View file

@ -80,7 +80,7 @@ struct Super
u32int revlevel; /* Revision level */
u16int defresuid; /* Default uid for reserved blocks */
u16int defresgid; /* Default gid for reserved blocks */
/* the following are only available with revlevel = 1 */
u32int firstino; /* First non-reserved inode */
u16int inosize; /* size of inode structure */
@ -161,4 +161,3 @@ struct Ext2
Disk *disk;
Fsys *fsys;
};

View file

@ -8,4 +8,3 @@ fsysopenfat(Disk *disk)
USED(disk);
return nil;
}

View file

@ -124,8 +124,8 @@ okay:
fs->nfrag = fsblk->nfrag;
fs->ndfrag = fsblk->ndfrag;
/*
* used to use
* fs->blockspergroup = (u64int)fsblk->_cylspergroup *
* used to use
* fs->blockspergroup = (u64int)fsblk->_cylspergroup *
* fsblk->secspercyl * BYTESPERSEC / fsblk->blocksize;
* for UFS1, but this should work for both UFS1 and UFS2
*/
@ -190,7 +190,7 @@ ffsclose(Fsys *fsys)
free(fs);
free(fsys);
}
static int
checkfsblk(Fsblk *super)
{
@ -311,7 +311,7 @@ ffsdatablock(Ffs *fs, u64int bno, int size)
blockput(b);
return nil;
}
return b;
}
@ -319,7 +319,7 @@ static u64int
ifetch(Ffs *fs, u64int bno, u32int off)
{
Block *b;
if(bno == BADBNO)
return BADBNO;
b = ffsdatablock(fs, bno, fs->blocksize);
@ -352,10 +352,10 @@ ffsfileblockno(Ffs *fs, Inode *ino, u64int bno)
if(bno < ppb*ppb)
return ifetch(fs, ifetch(fs, ino->ib[1], bno/ppb), bno%ppb);
bno -= ppb*ppb;
if(bno/ppb/ppb/ppb == 0) /* bno < ppb*ppb*ppb w/o overflow */
return ifetch(fs, ifetch(fs, ifetch(fs, ino->ib[2], bno/ppb/ppb), (bno/ppb)%ppb), bno%ppb);
fprint(2, "ffsfileblock %llud: way too big\n", bno+NDADDR+ppb+ppb*ppb);
return BADBNO;
}
@ -364,7 +364,7 @@ static Block*
ffsfileblock(Ffs *fs, Inode *ino, u64int bno, int size)
{
u64int b;
b = ffsfileblockno(fs, ino, bno);
if(b == ~0)
return nil;
@ -396,7 +396,7 @@ static void
inode1to2(Inode1 *i1, Inode *i2)
{
int i;
memset(i2, 0, sizeof *i2);
i2->mode = i1->mode;
i2->nlink = i1->nlink;
@ -777,7 +777,7 @@ ffsxfileblock(Fsys *fsys, Nfs3Handle *h, u64int offset)
Inode ino;
Nfs3Status ok;
Ffs *fs;
fs = fsys->priv;
if((ok = handle2ino(fs, h, nil, &ino)) != Nfs3Ok){
nfs3errstr(ok);

View file

@ -40,7 +40,7 @@ enum
FSMAGIC = 0x011954,
FSMAGIC2 = 0x19540119,
FSCHECKSUM = 0x7c269d38,
/* Fsblk.inodefmt */
FS42INODEFMT = -1,
FS44INODEFMT = 2,
@ -341,4 +341,3 @@ struct Ffs
Disk *disk;
};

View file

@ -89,7 +89,7 @@ fsysopenhfs(Disk *disk)
fsys->_readdir = hfsreaddir;
fsys->_close = hfsclose;
fsys->disk = disk;
if(hfswrapper(fsys) < 0 || hfssync(fsys) < 0)
goto error;
@ -130,7 +130,7 @@ hfswrapper(Fsys *fsys)
int magic, hfsstart, subsig, substart, subnblocks;
u32int hfsblocksize;
u64int offset, size;
fs = fsys->priv;
disk = fsys->disk;
if((b = diskread(disk, 162, 1024)) == nil)
@ -143,12 +143,12 @@ hfswrapper(Fsys *fsys)
substart = get16(mdb+126);
subnblocks = get16(mdb+128);
blockput(b);
if(magic != Hfssig)
return 0;
if(subsig != Hfsplussig && subsig != Hfsxsig)
return 0;
offset = hfsstart*512 + substart*hfsblocksize;
size = subnblocks*hfsblocksize;
@ -748,7 +748,7 @@ hfsreaddir(Fsys *fsys, SunAuthUnix *au, Nfs3Handle *h, u32int count,
if(ino.u.nentries>>31)
return Nfs3ErrIo;
nentries = ino.u.nentries*2; /* even data, odd resource */
i = cookie>>32;
cnid = cookie&0xFFFFFFFF;
if(debug) print("readdir %ud %ud %ud...", cnid, i, nentries);
@ -784,7 +784,7 @@ hfsreaddir(Fsys *fsys, SunAuthUnix *au, Nfs3Handle *h, u32int count,
goto badparent;
i++;
}
memset(&e, 0, sizeof e);
for(; i<nentries; i++){
rsrc = i&1;

View file

@ -3,12 +3,12 @@
wrapper.
Apple technical note 1150 documents the file system:
http://developer.apple.com/technotes/tn/tn1150.html
Briefly an hfs file system comprises a volume header, an
optional journal, and a set of forks.
Most fs metadata resides in forks including a block allocation
bitmap, a tree storing extents (q.v.) for forks and bad disk
blocks, and a tree storing catalog (file and directory)
@ -52,11 +52,11 @@ enum
NAMELEN = 255,
UTFNAMELEN = NAMELEN*UTFmax,
NEXTENTS = 8,
Dfork = 0, Rfork = 255,
/* fixed cnids */
RootpId = 1, RootId, ExtentsId, CatalogId,
BadblockId, AllocId, MinuserId = 16,
@ -71,7 +71,7 @@ enum
/* values in Node.type */
LeafNode = -1, IndexNode, HeaderNode, MapNode,
/* catalog record types */
Folder = 1, File, FolderThread, FileThread,
@ -163,14 +163,14 @@ struct Treeref
{
Tree *tree;
u32int cnid; /* tree->fork->cnid, for debugging prints */
Block *block; /* a node in the tree */
u32int nno;
Node node;
int rno; /* a record in the node */
int klen;
uchar *key;
uchar *key;
int dlen;
uchar *data;
};

View file

@ -8,4 +8,3 @@ fsysopenkfs(Disk *disk)
USED(disk);
return nil;
}

View file

@ -27,7 +27,7 @@ static int
diskpartsync(Disk *dd)
{
DiskPart *d = (DiskPart*)dd;
if(d->subdisk)
return disksync(d->subdisk);
return 0;
@ -37,7 +37,7 @@ static void
diskpartclose(Disk *dd)
{
DiskPart *d = (DiskPart*)dd;
if(d->subdisk)
diskclose(d->subdisk);
free(d);
@ -47,18 +47,18 @@ Disk*
diskpart(Disk *subdisk, u64int offset, u64int size)
{
DiskPart *d;
d = mallocz(sizeof(DiskPart), 1);
if(d == nil)
return nil;
d->subdisk = subdisk;
d->offset = offset;
d->size = size;
d->disk._read = diskpartread;
d->disk._sync = diskpartsync;
d->disk._close = diskpartclose;
return &d->disk;
}

View file

@ -159,4 +159,3 @@ Err:
_nfilereads_darwin_sucks(); /* force Darwin ld to pull in file.o */
return nil;
}

View file

@ -31,5 +31,3 @@ diskVentiRead(Disk *dd, u32int len, u64int offset)
walk down blocks
return the one
}