23.07.2014 Views

Lustre 1.6 Operations Manual

Lustre 1.6 Operations Manual

Lustre 1.6 Operations Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Examples<br />

System default size is 4MB.<br />

char *tfile = TESTFILE;<br />

int stripe_size = 65536<br />

To start at default, run:<br />

int stripe_offset = -1<br />

To start at the default, run:<br />

int stripe_count = 1<br />

To set a single stripe for this example, run:<br />

int stripe_pattern = 0<br />

Currently, only RAID 0 is supported.<br />

int stripe_pattern = 0;<br />

int rc, fd;<br />

rc = llapi_file_create(tfile,<br />

stripe_size,stripe_offset, stripe_count,stripe_pattern);<br />

Result code is inverted, you may return with ’EINVAL’ or an ioctl error.<br />

if (rc) {<br />

fprintf(stderr,"llapi_file_create failed: %d (%s) 0, rc,<br />

strerror(-rc));<br />

return -1;<br />

}<br />

llapi_file_create closes the file descriptor. You must re-open the descriptor. To<br />

do this, run:<br />

fd = open(tfile, O_CREAT | O_RDWR | O_LOV_DELAY_CREATE, 0644);<br />

if (fd < 0) \ {<br />

fprintf(stderr, "Can’t open %s file: %s0, tfile,<br />

strerror(errno));<br />

return -1;<br />

}<br />

Chapter 30 Setting <strong>Lustre</strong> Properties (man3) 30-3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!