projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve error message for grading when the make failed.
[pintos-anon]
/
grading
/
vm
/
page-merge-par.c
diff --git
a/grading/vm/page-merge-par.c
b/grading/vm/page-merge-par.c
index 93ceb24f005e4c0137eae4cfec8ec4628c139635..06209e8359b1e6cd9a251964dbee91338b6e0b98 100644
(file)
--- a/
grading/vm/page-merge-par.c
+++ b/
grading/vm/page-merge-par.c
@@
-5,9
+5,12
@@
#else
#include "posix-compat.h"
#endif
#else
#include "posix-compat.h"
#endif
-#include "arc4.h"
+#include "
../lib/
arc4.h"
-#define CHUNK_SIZE (63 * 1024) /* Max file size. */
+/* This is the max file size for an older version of the Pintos
+ file system that had 126 direct blocks each pointing to a
+ single disk sector. We could raise it now. */
+#define CHUNK_SIZE (126 * 512)
#define CHUNK_CNT 8 /* Number of chunks. */
#define DATA_SIZE (CHUNK_CNT * CHUNK_SIZE) /* Buffer size. */
#define CHUNK_CNT 8 /* Number of chunks. */
#define DATA_SIZE (CHUNK_CNT * CHUNK_SIZE) /* Buffer size. */
@@
-22,7
+25,7
@@
init (void)
struct arc4 arc4;
size_t i;
struct arc4 arc4;
size_t i;
- printf ("page-merge-par) init\n");
+ printf ("
(
page-merge-par) init\n");
arc4_init (&arc4, "foobar", 6);
arc4_crypt (&arc4, buf1, sizeof buf1);
arc4_init (&arc4, "foobar", 6);
arc4_crypt (&arc4, buf1, sizeof buf1);
@@
-46,7
+49,7
@@
sort (void)
printf ("(page-merge-par) sort chunk %zu\n", i);
/* Write this chunk to a file. */
printf ("(page-merge-par) sort chunk %zu\n", i);
/* Write this chunk to a file. */
- snprintf (fn, sizeof fn, "buf%
d
", i);
+ snprintf (fn, sizeof fn, "buf%
zu
", i);
create (fn, CHUNK_SIZE);
fd = open (fn);
if (fd < 0)
create (fn, CHUNK_SIZE);
fd = open (fn);
if (fd < 0)
@@
-79,7
+82,7
@@
sort (void)
}
/* Read chunk back from file. */
}
/* Read chunk back from file. */
- snprintf (fn, sizeof fn, "buf%
d
", i);
+ snprintf (fn, sizeof fn, "buf%
zu
", i);
fd = open (fn);
if (fd < 0)
{
fd = open (fn);
if (fd < 0)
{