#define MDT_MIN_THREADS 2UL
#define MDT_MAX_THREADS 512UL
#define MDT_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
- num_physpages >> (25 - PAGE_SHIFT)), 2UL)
+ num_physpages >> (25 - CFS_PAGE_SHIFT)), 2UL)
#define FLD_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
- num_physpages >> (25 - PAGE_SHIFT)), 2UL)
+ num_physpages >> (25 - CFS_PAGE_SHIFT)), 2UL)
#define SEQ_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
- num_physpages >> (25 - PAGE_SHIFT)), 2UL)
+ num_physpages >> (25 - CFS_PAGE_SHIFT)), 2UL)
/* Absolute limits */
#define MDS_THREADS_MIN 2
/* create sample data */
for (i = 0, buf = buf_alloc; i < _npages; i++) {
- for (j = 0; j < PAGE_SIZE/sizeof(int); j++, buf++) {
+ for (j = 0; j < CFS_PAGE_SIZE/sizeof(int); j++, buf++) {
*buf = rand();
}
}
/* compute checksum */
for (i = 0, buf = buf_alloc; i < _npages; i++) {
- for (j = 0; j < PAGE_SIZE/sizeof(int); j++, buf++) {
+ for (j = 0; j < CFS_PAGE_SIZE/sizeof(int); j++, buf++) {
check_sum[i] += *buf;
}
}
}
gettimeofday(&tw1, NULL);
for (i = 0, buf = buf_alloc; i < _npages;
- i += xfer, buf += xfer * PAGE_SIZE / sizeof(int)) {
- rc = write(fd, buf, PAGE_SIZE * xfer);
- if (rc != PAGE_SIZE * xfer) {
+ i += xfer, buf += xfer * CFS_PAGE_SIZE / sizeof(int)) {
+ rc = write(fd, buf, CFS_PAGE_SIZE * xfer);
+ if (rc != CFS_PAGE_SIZE * xfer) {
printf("write error (i %d, rc %d): %s\n", i, rc,
strerror(errno));
return(1);
}
gettimeofday(&tr1, NULL);
for (i = 0, buf = buf_alloc; i < _npages;
- i += xfer, buf += xfer * PAGE_SIZE / sizeof(int)) {
- rc = read(fd, buf, PAGE_SIZE * xfer);
- if (rc != PAGE_SIZE * xfer) {
+ i += xfer, buf += xfer * CFS_PAGE_SIZE / sizeof(int)) {
+ rc = read(fd, buf, CFS_PAGE_SIZE * xfer);
+ if (rc != CFS_PAGE_SIZE * xfer) {
printf("read error (i %d, rc %d): %s\n", i, rc,
strerror(errno));
return(1);
/* compute checksum */
for (i = 0, buf = buf_alloc; i < _npages; i++) {
int sum = 0;
- for (j = 0; j < PAGE_SIZE/sizeof(int); j++, buf++) {
+ for (j = 0; j < CFS_PAGE_SIZE/sizeof(int); j++, buf++) {
sum += *buf;
}
if (sum != check_sum[i]) {
tw = (tw2.tv_sec - tw1.tv_sec) * 1000000 + (tw2.tv_usec - tw1.tv_usec);
tr = (tr2.tv_sec - tr1.tv_sec) * 1000000 + (tr2.tv_usec - tr1.tv_usec);
printf(" (R:%.3fM/s, W:%.3fM/s)\n",
- (_npages * PAGE_SIZE) / (tw / 1000000.0) / (1024 * 1024),
- (_npages * PAGE_SIZE) / (tr / 1000000.0) / (1024 * 1024));
+ (_npages * CFS_PAGE_SIZE) / (tw / 1000000.0) / (1024 * 1024),
+ (_npages * CFS_PAGE_SIZE) / (tr / 1000000.0) / (1024 * 1024));
if (data_error)
return 1;
__liblustre_setup_();
- buf_size = _npages * PAGE_SIZE;
+ buf_size = _npages * CFS_PAGE_SIZE;
if (opt_verbose)
printf("allocating %d bytes buffer\n", buf_size);
buf_alloc = calloc(1, buf_size);
struct hlist_head *hash;
int nr_hash, i;
- OBD_ALLOC(hash, PAGE_SIZE);
+ OBD_ALLOC(hash, CFS_PAGE_SIZE);
if (!hash)
return NULL;
- nr_hash = PAGE_SIZE / sizeof(struct hlist_head);
+ nr_hash = CFS_PAGE_SIZE / sizeof(struct hlist_head);
LASSERT(nr_hash > NR_CAPAHASH);
for (i = 0; i < NR_CAPAHASH; i++)
}
spin_unlock(&capa_lock);
- OBD_FREE(hash, PAGE_SIZE);
+ OBD_FREE(hash, CFS_PAGE_SIZE);
}
static inline int const capa_hashfn(struct lu_fid *fid)
int keylen;
struct scatterlist sl = {
.page = virt_to_page(capa),
- .offset = (unsigned long)(capa) % PAGE_SIZE,
+ .offset = (unsigned long)(capa) % CFS_PAGE_SIZE,
.length = offsetof(struct lustre_capa, lc_hmac),
};