Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion acme/bin/source/win/dat.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum
NPIPEDATA = 8000,
NPIPE = NPIPEDATA+32,
/* EVENTSIZE is really 256 in acme, but we use events internally and want bigger buffers */
EVENTSIZE = 16*1024,
EVENTSIZE = IOUNIT,
NEVENT = 5,
};

Expand Down
2 changes: 2 additions & 0 deletions sys/include/ape/lib9.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <u.h> /* ick; need Rune defined below */

#define IOUNIT 32768U /* default buffer size for 9p io */

#define MORDER 0x0003 /* mask for bits defining order of mounting */
#define MREPL 0x0000 /* mount replaces object */
#define MBEFORE 0x0001 /* mount goes before others in union directory */
Expand Down
2 changes: 1 addition & 1 deletion sys/include/bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ typedef struct Biobufhdr Biobufhdr;

enum
{
Bsize = 16*1024,
Bsize = IOUNIT,
Bungetsize = UTFmax+1, /* space for ungetc */
Bmagic = 0x314159,
Beof = -1,
Expand Down
1 change: 1 addition & 0 deletions sys/include/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ extern void freenetconninfo(NetConnInfo*);
* system calls
*
*/
#define IOUNIT 32768U /* default buffer size for 9p io */
#define STATMAX 65535U /* max length of machine-independent stat structure */
#define DIRMAX (sizeof(Dir)+STATMAX) /* max length of Dir structure */
#define ERRMAX 128 /* max length of error string */
Expand Down
30 changes: 10 additions & 20 deletions sys/lib/dist/cmd/bzfs/mkext.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "bzfs.h"

enum{
LEN = 8*1024,
NFLDS = 6, /* filename, modes, uid, gid, mtime, bytes */
};

Expand All @@ -39,8 +38,7 @@ void error(char*, ...);
void warn(char*, ...);
void usage(void);
char *mtpt;
Biobufhdr bin;
uchar binbuf[2*LEN];
Biobuf bin;

void
usage(void)
Expand Down Expand Up @@ -89,15 +87,12 @@ blockread(int in, char *first, int nfirst)
return -1;
}

enum { NAMELEN = 28 };

void
main(int argc, char **argv)
{
char *rargv[10];
int rargc;
char *fields[NFLDS], name[2*LEN], *p, *namep;
char uid[NAMELEN], gid[NAMELEN];
char *fields[NFLDS], *p;
ulong mode, bytes, mtime;
char *file;
int i, n, stdin, fd, chatty;
Expand All @@ -116,7 +111,6 @@ main(int argc, char **argv)
rfork(RFNOTEG);
stdin = 0;
file = nil;
namep = name;
mtpt = "/root";
chatty = 0;
ARGBEGIN{
Expand Down Expand Up @@ -174,41 +168,37 @@ if(chatty) fprint(2, "found at %d\n", i);

fd = unbflz(unbzip(blockread(fd, blk+13, sizeof(blk)-13)));

Binits(&bin, fd, OREAD, binbuf, sizeof binbuf);
while(p = Brdline(&bin, '\n')){
p[Blinelen(&bin)-1] = '\0';
Binit(&bin, fd, OREAD);
while((p = Brdstr(&bin, '\n', 1)) != nil){
if(chatty) fprint(2, "%s\n", p);
if(strcmp(p, "end of archive") == 0){
if(strcmp(p, "end of archive") == 0)
_exits(0);
}
if(getfields(p, fields, NFLDS, 0, " \t") != NFLDS){
warn("too few fields in file header");
continue;
}
strcpy(namep, fields[0]);
mode = strtoul(fields[1], 0, 8);
mtime = strtoul(fields[4], 0, 10);
bytes = strtoul(fields[5], 0, 10);
strncpy(uid, fields[2], NAMELEN);
strncpy(gid, fields[3], NAMELEN);
if(mode & DMDIR)
mkdir(name, mode, mtime, uid, gid);
mkdir(fields[0], mode, mtime, fields[2], fields[3]);
else
extract(name, mode, mtime, uid, gid, bytes);
extract(fields[0], mode, mtime, fields[2], fields[3], bytes);
free(p);
}
fprint(2, "premature end of archive\n");
exits("premature end of archive");
}

char buf[8192];
char buf[IOUNIT];

int
ffcreate(char *name, ulong mode, char *uid, char *gid, ulong mtime, int length)
{
int fd, om;
Dir nd;

sprint(buf, "%s/%s", mtpt, name);
snprint(buf, sizeof buf, "%s/%s", mtpt, name);
om = ORDWR;
if(mode&DMDIR)
om = OREAD;
Expand Down
2 changes: 1 addition & 1 deletion sys/lib/dist/cmd/bzfs/oramfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum
OPERM = 0x3, /* mask of all permission types in open mode */
Nram = 512,
Maxsize = 512*1024*1024,
Maxfdata = 8192,
Maxfdata = IOUNIT,
};

typedef struct Fid Fid;
Expand Down
4 changes: 2 additions & 2 deletions sys/lib/dist/cmd/bzfs/unbzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ static int
bunzip(int ofd, char *ofile, Biobuf *bin)
{
int e, n, done, onemore;
char buf[8192];
char obuf[8192];
char buf[IOUNIT];
char obuf[IOUNIT];
Biobuf bout;
bz_stream strm;

Expand Down
2 changes: 1 addition & 1 deletion sys/src/9/pc/devvirtio9p.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ enum {

Fmounttag = 1, /* 9P device feature bit 0: config carries a mount tag */

Msize = IOHDRSZ + 16*1024, /* matches MAXRPC in devmnt.c */
Msize = IOHDRSZ + 32*1024, /* matches MAXRPC in devmnt.c */
Maxslot = 64, /* cap on outstanding RPCs per device */

Fidhash = 257, /* buckets in the directory-fid set */
Expand Down
2 changes: 1 addition & 1 deletion sys/src/9/port/devmnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* connection.
*/

#define MAXRPC (IOHDRSZ+16*1024) /* maybe a larger size will be faster */
#define MAXRPC (IOHDRSZ+32*1024) /* maybe a larger size will be faster */
/* use a known-good common size for initial negotiation */
#define MAXCMNRPC (IOHDRSZ+8192)

Expand Down
2 changes: 1 addition & 1 deletion sys/src/9k/386/devvirtio9p.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ enum {

Fmounttag = 1, /* 9P device feature bit 0: config carries a mount tag */

Msize = IOHDRSZ + 16*1024, /* matches MAXRPC in devmnt.c */
Msize = IOHDRSZ + 32*1024, /* matches MAXRPC in devmnt.c */
Maxslot = 64, /* cap on outstanding RPCs per device */

Fidhash = 257, /* buckets in the directory-fid set */
Expand Down
2 changes: 1 addition & 1 deletion sys/src/9k/k10/root/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <fcall.h>
#include <libsec.h>

#define Maxfdata 8192
#define Maxfdata IOUNIT
#define MaxStr 128

void remoteside(int);
Expand Down
2 changes: 1 addition & 1 deletion sys/src/9k/port/devmnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* connection.
*/

#define MAXRPC (IOHDRSZ+16*1024) /* maybe a larger size will be faster */
#define MAXRPC (IOHDRSZ+32*1024) /* maybe a larger size will be faster */
/* use a known-good common size for initial negotiation */
#define MAXCMNRPC (IOHDRSZ+8192)

Expand Down
2 changes: 1 addition & 1 deletion sys/src/9k/root/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <fcall.h>
#include <libsec.h>

#define Maxfdata 8192
#define Maxfdata IOUNIT
#define MaxStr 128

void remoteside(int);
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/5a/a.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef struct Hist Hist;
#define MAXALIGN 7
#define FPCHIP 1
#define NSYMB 8192
#define BUFSIZ (16*1024)
#define BUFSIZ IOUNIT
#define HISTSZ 20
#define NINCLUDE 10
#define NHUNK 10000
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/5l/l.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ enum
NHUNK = 100000,
MINSIZ = 64,
NENT = 100,
MAXIO = (16*1024),
MAXIO = IOUNIT,
MAXHIST = 20, /* limit of path elements for history symbols */

Roffset = 22, /* no. bits for offset in relocation address */
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/6a/a.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef struct Gen2 Gen2;
#define MAXALIGN 7
#define FPCHIP 1
#define NSYMB 500
#define BUFSIZ (16*1024)
#define BUFSIZ IOUNIT
#define HISTSZ 20
#define NINCLUDE 10
#define NHUNK 10000
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/6l/l.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ enum
MINSIZ = 8,
STRINGSZ = 200,
MINLC = 1,
MAXIO = (16*1024),
MAXIO = IOUNIT,
MAXHIST = 20, /* limit of path elements for history symbols */

Yxxx = 0,
Expand Down
1 change: 0 additions & 1 deletion sys/src/cmd/7a/mkfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
</$objtype/mkfile
CFLAGS = $CFLAGS -DIOUNIT=8192

TARG=7a
OFILES=\
Expand Down
1 change: 0 additions & 1 deletion sys/src/cmd/7c/mkfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
</$objtype/mkfile
CFLAGS = $CFLAGS -DIOUNIT=8192

TARG=7c
OFILES=\
Expand Down
1 change: 0 additions & 1 deletion sys/src/cmd/7l/mkfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
</$objtype/mkfile
CFLAGS = $CFLAGS -DIOUNIT=8192

TARG=7l
OFILES=\
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/8a/a.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef struct Gen2 Gen2;
#define MAXALIGN 7
#define FPCHIP 1
#define NSYMB 500
#define BUFSIZ (16*1024)
#define BUFSIZ IOUNIT
#define HISTSZ 20
#define NINCLUDE 10
#define NHUNK 10000
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/8l/l.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ enum
MINSIZ = 4,
STRINGSZ = 200,
MINLC = 1,
MAXIO = (16*1024),
MAXIO = IOUNIT,
MAXHIST = 20, /* limit of path elements for history symbols */

Yxxx = 0,
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/9660srv/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

enum
{
Maxfdata = 8192,
Maxfdata = IOUNIT,
Maxiosize = IOHDRSZ+Maxfdata,
};

Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/9a/a.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef struct Hist Hist;
#define MAXALIGN 7
#define FPCHIP 1
#define NSYMB 8192
#define BUFSIZ (16*1024)
#define BUFSIZ IOUNIT
#define HISTSZ 20
#define NINCLUDE 10
#define NHUNK 10000
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/9l/l.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ enum
FPCHIP = 1,
BIG = 32768-8,
STRINGSZ = 200,
MAXIO = (16*1024),
MAXIO = IOUNIT,
MAXHIST = 20, /* limit of path elements for history symbols */
DATBLK = 1024,
NHASH = 10007,
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/acme/dat.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enum
enum
{
Blockincr = 256,
Maxblock = 16*1024,
Maxblock = IOUNIT,
NRange = 10,
Infinity = 0x7FFFFFFF, /* huge value for regexp address */
};
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/ar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ arstream(int fd, Arfile *ap)
{
Armember *bp;
int i;
char buf[8192];
char buf[IOUNIT];

if (ap->paged) { /* copy from disk */
seek(ap->fd, 0, 0);
Expand Down
13 changes: 7 additions & 6 deletions sys/src/cmd/aux/consolefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum
Qdata,

Bufsize= 32*1024, /* chars buffered per reader */
Stacksize= Bufsize+1024*3, /* fsreply(Bufsize+IOHDRSZ)+fsreader(1024)+others */
Maxcons= 64, /* maximum consoles */
Nhash= 64, /* Fid hash buckets */
};
Expand Down Expand Up @@ -162,7 +163,7 @@ char Enofid[] = "no such fid";
char *consoledb = "/lib/ndb/consoledb";
char *mntpt = "/mnt/consoles";

int messagesize = 8192+IOHDRSZ;
int messagesize = IOUNIT+IOHDRSZ;

void
fatal(char *fmt, ...)
Expand Down Expand Up @@ -357,7 +358,7 @@ fsmount(char *mntpt)
/* start up the file system process */
v[0] = fs;
v[1] = pfd;
proccreate(fsrun, v, 16*1024);
proccreate(fsrun, v, Stacksize);

/* Typically mounted before /srv exists */
if(access("#s/consoles", AEXIST) < 0){
Expand Down Expand Up @@ -417,7 +418,7 @@ fsreopen(Fs* fs, Console *c)

v[0] = fs;
v[1] = c;
proccreate(fsreader, v, 16*1024);
proccreate(fsreader, v, Stacksize);

return 0;
}
Expand Down Expand Up @@ -764,8 +765,8 @@ fsversion(Fs *fs, Request *r, Fid*)
return;
}
messagesize = r->f.msize;
if(messagesize > 8192+IOHDRSZ)
messagesize = 8192+IOHDRSZ;
if(messagesize > IOUNIT+IOHDRSZ)
messagesize = IOUNIT+IOHDRSZ;
r->f.msize = messagesize;
if(strncmp(r->f.version, "9P2000", 6) != 0){
fsreply(fs, r, "unrecognized 9P version");
Expand Down Expand Up @@ -1206,7 +1207,7 @@ void
fsreply(Fs *fs, Request *r, char *err)
{
int n;
uchar buf[8192+IOHDRSZ];
uchar buf[Bufsize+IOHDRSZ];

if(err){
r->f.type = Rerror;
Expand Down
2 changes: 1 addition & 1 deletion sys/src/cmd/aux/trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ main(int argc, char **argv)
void
xfer(int from, int to)
{
char buf[12*1024];
char buf[IOUNIT];
int n;

while((n = read(from, buf, sizeof buf)) > 0)
Expand Down
4 changes: 2 additions & 2 deletions sys/src/cmd/bzip2/bunzip2.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ static int
bunzip(int ofd, char *ofile, Biobuf *bin)
{
int e, n, done, onemore;
char buf[8192];
char obuf[8192];
char buf[IOUNIT];
char obuf[IOUNIT];
Biobuf bout;
bz_stream strm;

Expand Down
Loading
Loading