Not even sure where min() was coming from, but it seems to be missing on
i386 lucid.:
g++ -DHAVE_CONFIG_H -I. -Wall -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -rdynamic -g -O2 -MT rbd.o -MD -MP -MF .deps/rbd.Tpo -c -o rbd.o rbd.cc
rbd.cc: In function 'int do_import(void*, const char*, int, const char*)':
rbd.cc:837: error: no matching function for call to 'min(uint64_t&, off_t)'
make[3]: *** [rbd.o] Error 1
Reported-by: John Leach <john@johnleach.co.uk>
Signed-off-by: Sage Weil <sage@newdream.net>
using namespace librados;
#include "include/byteorder.h"
+#include "include/intarith.h"
#include <errno.h>
#include <inttypes.h>
break; /* don't try to merge if we're big enough */
extent_len += fiemap->fm_extents[extent].fe_length; /* length of current extent */
- end_ofs = min(size, file_pos + extent_len);
+ end_ofs = MIN(size, file_pos + extent_len);
end_block = get_block_num(&header, end_ofs - 1); /* ending block */