mirror of
https://github.com/ceph/ceph
synced 2025-02-04 01:14:24 +00:00
buffer::read_file into pages to avoid c++ allocator's disagreement with perl
This commit is contained in:
parent
f6f54a2f93
commit
e7d366a7f9
1
src/.gitignore
vendored
1
src/.gitignore
vendored
@ -9,7 +9,6 @@ fakefuse
|
||||
fakesyn
|
||||
mkmonmap
|
||||
monmaptool
|
||||
crushtool
|
||||
newsyn
|
||||
dev
|
||||
mondata
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
pthread_mutex_init(&_m,NULL);
|
||||
}
|
||||
}
|
||||
virtual ~Mutex() {
|
||||
~Mutex() {
|
||||
assert(nlock == 0);
|
||||
pthread_mutex_destroy(&_m);
|
||||
}
|
||||
|
@ -38,7 +38,8 @@ int buffer::list::read_file(const char *fn)
|
||||
return -errno;
|
||||
}
|
||||
::fstat(fd, &st);
|
||||
bufferptr bp(st.st_size);
|
||||
int s = ROUND_UP_TO(st.st_size, PAGE_SIZE);
|
||||
bufferptr bp = buffer::create_page_aligned(s);
|
||||
append(bp);
|
||||
::read(fd, (void*)c_str(), length());
|
||||
::close(fd);
|
||||
|
@ -165,8 +165,7 @@ sub compile_crush {
|
||||
}
|
||||
}
|
||||
|
||||
#$wrap->write_to_file($outfn);
|
||||
$wrap->read_from_file($outfn);
|
||||
$wrap->write_to_file($outfn);
|
||||
1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user