user/usertests.c
void
bigwrite(void)
{
  int fd, sz;

  printf("bigwrite test\n");

  unlink("bigwrite");
  for(sz = 499; sz < (MAXOPBLOCKS+2)*BSIZE; sz += 471){
    fd = open("bigwrite", O_CREATE | O_RDWR);
    if(fd < 0){
      printf("cannot create bigwrite\n");
      exit(1);
    }
    int i;
    for(i = 0; i < 2; i++){
      int cc = write(fd, buf, sz);
      if(cc != sz){
        printf("write(%d) ret %d\n", sz, cc);
        exit(1);
      }
    }
    close(fd);
    unlink("bigwrite");
  }

  printf("bigwrite ok\n");
}
// test writes that are larger than the log.
test writes that are larger than the log.
test writes that are larger than the log .
void
bigwrite(void)
{
  int fd, sz;
  printf("bigwrite test\n");
  unlink("bigwrite");
  for(sz = 499; sz < (MAXOPBLOCKS+2)*BSIZE; sz += 471){
    fd = open("bigwrite", O_CREATE | O_RDWR);
    if(fd < 0){
      printf("cannot create bigwrite\n");
      exit(1);
    }
    int i;
    for(i = 0; i < 2; i++){
      int cc = write(fd, buf, sz);
      if(cc != sz){
        printf("write(%d) ret %d\n", sz, cc);
        exit(1);
      }
    }
    close(fd);
    unlink("bigwrite");
  }
  printf("bigwrite ok\n");
}
void bigwrite ( void ) { int fd , sz ; printf ( " \n " ) ; unlink ( " " ) ; for ( sz = 499 ; sz < ( MAXOPBLOCKS + 2 ) * BSIZE ; sz += 471 ) { fd = open ( " " , O_CREATE | O_RDWR ) ; if ( fd < 0 ) { printf ( " \n " ) ; exit ( 1 ) ; } int i ; for ( i = 0 ; i < 2 ; i ++ ) { int cc = write ( fd , buf , sz ) ; if ( cc != sz ) { printf ( " \n " , sz , cc ) ; exit ( 1 ) ; } } close ( fd ) ; unlink ( " " ) ; } printf ( " \n " ) ; }
test writes that are larger than the log.
test writes that are larger than the log .