~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/test/old/test_setlayout.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#define __USE_GNU 1
 
2
#include <fcntl.h>
 
3
#include <netinet/in.h>
 
4
#include <linux/types.h>
 
5
#include "include/ceph_fs.h"
 
6
#include <stdlib.h>
 
7
#include <stdio.h>
 
8
#include <string.h>
 
9
 
 
10
#include "kernel/ioctl.h"
 
11
 
 
12
 
 
13
main() {
 
14
        struct ceph_file_layout l;
 
15
        int fd = open("foo.txt", O_RDONLY);
 
16
        int r = ioctl(fd, CEPH_IOC_GET_LAYOUT, &l, sizeof(l));
 
17
        printf("get = %d\n", r);
 
18
 
 
19
        l.fl_stripe_unit = 65536;
 
20
        l.fl_object_size = 65536;
 
21
        
 
22
        r = ioctl(fd, CEPH_IOC_SET_LAYOUT, &l, sizeof(l));
 
23
        printf("set = %d\n", r);
 
24
}