diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-13 18:12:06 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-13 18:12:06 -0400 |
commit | 95ef43c4308102d23afa887c9fc28d9977612a2d (patch) | |
tree | 39674efd5c4540cb23e093d3777ad814cc84ff6d /src/backend/storage/file/fd.c | |
parent | fa11a09fed2b6f483231608866a682ee3a376277 (diff) | |
download | postgresql-95ef43c4308102d23afa887c9fc28d9977612a2d.tar.gz postgresql-95ef43c4308102d23afa887c9fc28d9977612a2d.zip |
Widen amount-to-flush arguments of FileWriteback and callers.
It's silly to define these counts as narrower than they might someday
need to be. Also, I believe that the BLCKSZ * nflush calculation in
mdwriteback was capable of overflowing an int.
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r-- | src/backend/storage/file/fd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index f513554bff5..03143f11334 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -1538,28 +1538,28 @@ FilePrefetch(File file, off_t offset, int amount) } void -FileWriteback(File file, off_t offset, int amount) +FileWriteback(File file, off_t offset, off_t nbytes) { int returnCode; Assert(FileIsValid(file)); - DO_DB(elog(LOG, "FileWriteback: %d (%s) " INT64_FORMAT " %d", + DO_DB(elog(LOG, "FileWriteback: %d (%s) " INT64_FORMAT " " INT64_FORMAT, file, VfdCache[file].fileName, - (int64) offset, amount)); + (int64) offset, (int64) nbytes)); /* - * Caution: do not call pg_flush_data with amount = 0, it could trash the - * file's seek position. + * Caution: do not call pg_flush_data with nbytes = 0, it could trash the + * file's seek position. We prefer to define that as a no-op here. */ - if (amount <= 0) + if (nbytes <= 0) return; returnCode = FileAccess(file); if (returnCode < 0) return; - pg_flush_data(VfdCache[file].fd, offset, amount); + pg_flush_data(VfdCache[file].fd, offset, nbytes); } int |