Eric Sandeen a9cc799eca xfs: increase readdir buffer size
While doing some testing of readdir perf a while back,
I noticed that the buffer size we're using internally is
smaller than what glibc gives us by default.  Upping this
size helped a bit, and seems safe.

glibc's __alloc_dir() does:

  const size_t default_allocation = (4 * BUFSIZ < sizeof (struct dirent64)
                                     ? sizeof (struct dirent64) : 4 * BUFSIZ);
  const size_t small_allocation = (BUFSIZ < sizeof (struct dirent64)
                                   ? sizeof (struct dirent64) : BUFSIZ);
  size_t allocation = default_allocation;
#ifdef _STATBUF_ST_BLKSIZE
  if (statp != NULL && default_allocation < statp->st_blksize)
    allocation = statp->st_blksize;
#endif

and

#define _G_BUFSIZ 8192
#define _IO_BUFSIZ _G_BUFSIZ
# define BUFSIZ _IO_BUFSIZ

so the default buffer is 4 * 8192 = 32768
(except in the unlikely case of blocks > 32k....)

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
2010-03-01 16:33:41 -06:00
..
2010-02-13 13:22:53 -06:00
2009-12-14 23:08:16 -06:00
2009-06-10 17:07:47 +02:00
2010-01-26 15:10:15 +11:00
2009-12-14 23:08:16 -06:00
2009-06-10 17:07:47 +02:00
2010-01-21 13:44:36 -06:00
2009-12-14 23:08:16 -06:00
2009-12-14 23:08:16 -06:00
2010-01-21 13:44:36 -06:00
2009-12-14 23:08:16 -06:00
2009-03-29 09:51:14 +02:00
2009-03-29 09:55:42 +02:00
2008-12-01 11:37:35 +11:00
2008-10-30 17:53:24 +11:00
2010-01-21 13:44:43 -06:00
2009-03-29 09:55:42 +02:00
2010-01-15 15:33:02 -06:00
2009-08-31 14:46:22 -05:00
2009-12-14 23:08:16 -06:00
2009-12-14 23:08:16 -06:00
2010-02-08 17:41:48 -06:00
2009-12-14 23:08:16 -06:00
2009-03-29 09:55:42 +02:00
2009-09-01 12:46:16 -05:00
2009-03-29 09:55:42 +02:00
2010-01-20 10:44:58 +11:00
2009-06-08 15:33:32 +02:00
2009-12-14 23:08:16 -06:00