/****************** Custom includes ********************/
#include <linux/lustre_lite.h>
+#include <linux/lustre_idl.h>
/****************** Functions ******************/
-int write_file(char *name, struct lov_user_md *striping, int bufsize,
+int write_file(char *name, struct lov_mds_md *striping, int bufsize,
char *buf1, char *buf2);
int main(int argc, char *argv[])
{
- struct lov_user_md a_striping;
+ struct lov_mds_md a_striping;
long bufsize = sizeof(long) * STRIPE_SIZE;
char *rbuf, *wbuf;
int data, *dp;
*dp = data;
/* Init defaults on striping info */
- a_striping.lum_stripe_size = STRIPE_SIZE;
- a_striping.lum_stripe_pattern = 0;
+ a_striping.lmm_magic = LOV_MAGIC;
+ a_striping.lmm_stripe_size = STRIPE_SIZE;
+ a_striping.lmm_stripe_pattern = 0;
/* Write file for OST1 only */
/* Start at OST 0, and use only 1 OST */
- a_striping.lum_stripe_offset = 0;
- a_striping.lum_stripe_count = 1;
+ a_striping.lmm_stripe_offset = 0;
+ a_striping.lmm_stripe_count = 1;
result = write_file("/mnt/lustre/ost1", &a_striping, bufsize,
wbuf, rbuf);
/* Write file for OST2 only */
/* Start at OST 1, and use only 1 OST */
- a_striping.lum_stripe_offset = 1;
- a_striping.lum_stripe_count = 1;
+ a_striping.lmm_stripe_offset = 1;
+ a_striping.lmm_stripe_count = 1;
result = write_file("/mnt/lustre/ost2", &a_striping, bufsize,
wbuf, rbuf);
/* Write file across both OST1 and OST2 */
/* Start at OST 0, and use only 2 OSTs */
- a_striping.lum_stripe_offset = 0;
- a_striping.lum_stripe_count = 2;
+ a_striping.lmm_stripe_offset = 0;
+ a_striping.lmm_stripe_count = 2;
result = write_file("/mnt/lustre/ost1and2", &a_striping, bufsize,
wbuf, rbuf);
}
-int write_file(char *name, struct lov_user_md *striping, int bufsize,
+int write_file(char *name, struct lov_mds_md *striping, int bufsize,
char *wbuf, char *rbuf)
{
int fd, result;