⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Linux kernel client
All Projects
Ceph
»
Linux kernel client
Overview
Activity
Roadmap
Issues
Spent time
Gantt
Calendar
Download (693 Bytes)
Bug #44166
ยป lazycaps.c
Pablo Llopis
, 02/17/2020 09:38 AM
#include
<stdio.h>
#include
<fcntl.h>
#include
<string.h>
#include
<sys/ioctl.h>
#define CEPH_IOCTL_MAGIC 0x97
#define CEPH_IOC_LAZYIO _IO(CEPH_IOCTL_MAGIC, 4)
#define BUFSIZE 2097152
int
main
(
int
argc
,
char
*
argv
[])
{
char
buf
[
BUFSIZE
];
int
reps
=
5120
;
//10G file
int
fd
;
int
rank
;
int
numranks
=
2
;
if
(
argc
!=
3
)
{
printf
(
"%s <filename> <rank>
\n
"
);
}
rank
=
atoi
(
argv
[
2
]);
fd
=
open
(
argv
[
1
],
O_RDWR
|
O_CREAT
,
0664
);
if
(
fd
>=
0
)
ioctl
(
fd
,
CEPH_IOC_LAZYIO
);
long
unsigned
int
i
;
for
(
i
=
0
;
i
<
reps
/
numranks
;
i
++
)
{
memset
(
buf
,
i
,
BUFSIZE
);
lseek
(
fd
,
i
*
numranks
*
BUFSIZE
+
rank
*
BUFSIZE
,
SEEK_SET
);
write
(
fd
,
buf
,
BUFSIZE
);
}
fsync
(
fd
);
close
(
fd
);
return
0
;
}
(1-1/1)
Loading...