#include <ctype.h>
#include <fcntl.h>
-#define DBOX_READ_BLOCK_SIZE 4096
+#define DBOX_READ_BLOCK_SIZE IO_BLOCK_SIZE
#ifndef DBOX_FILE_LOCK_METHOD_FLOCK
static const struct dotlock_settings dotlock_set = {
#include <sys/stat.h>
#include <utime.h>
-#define MBOX_READ_BLOCK_SIZE (1024*4)
+#define MBOX_READ_BLOCK_SIZE IO_BLOCK_SIZE
int mbox_file_open(struct mbox_mailbox *mbox)
{
/* Block size when read()ing message header. */
#define MAIL_READ_HDR_BLOCK_SIZE (1024*4)
/* Block size when read()ing message (header and) body. */
-#define MAIL_READ_FULL_BLOCK_SIZE (1024*8)
+#define MAIL_READ_FULL_BLOCK_SIZE IO_BLOCK_SIZE
struct mail_storage_module_register {
unsigned int id;
int fdatasync(int);
#endif
+/* Try to keep IO operations at least this size */
+#ifndef IO_BLOCK_SIZE
+# define IO_BLOCK_SIZE 8192
+#endif
+
#endif
#ifdef HAVE_POSIX_FALLOCATE
static bool posix_fallocate_supported = TRUE;
#endif
- char block[4096];
+ char block[IO_BLOCK_SIZE];
off_t offset;
ssize_t ret;
struct stat st;
#include "istream.h"
#include "iostream-internal.h"
-#define I_STREAM_MIN_SIZE 4096
+#define I_STREAM_MIN_SIZE IO_BLOCK_SIZE
struct istream_private {
/* inheritance: */
/* try to keep the buffer size within 4k..128k. ReiserFS may actually return
128k as optimal size. */
-#define DEFAULT_OPTIMAL_BLOCK_SIZE 4096
+#define DEFAULT_OPTIMAL_BLOCK_SIZE IO_BLOCK_SIZE
#define MAX_OPTIMAL_BLOCK_SIZE (128*1024)
#define IS_STREAM_EMPTY(fstream) \
static off_t o_stream_default_send_istream(struct ostream_private *outstream,
struct istream *instream)
{
- return io_stream_copy(&outstream->ostream, instream, 1024);
+ return io_stream_copy(&outstream->ostream, instream, IO_BLOCK_SIZE);
}
struct ostream *o_stream_create(struct ostream_private *_stream)