]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * scalable distributed file system | |
5 | * | |
6 | * Copyright (C) Jeff Layton <jlayton@redhat.com> | |
7 | * | |
8 | * Heavily borrowed from David Howells' draft statx patchset. | |
9 | * | |
10 | * This is free software; you can redistribute it and/or | |
11 | * modify it under the terms of the GNU Lesser General Public | |
12 | * License version 2.1, as published by the Free Software | |
13 | * Foundation. See file COPYING. | |
14 | * | |
15 | */ | |
16 | ||
17 | #ifndef CEPH_CEPH_STATX_H | |
18 | #define CEPH_CEPH_STATX_H | |
19 | #include <stdint.h> | |
20 | ||
21 | #ifdef __cplusplus | |
22 | extern "C" { | |
23 | #endif | |
24 | ||
25 | /* | |
26 | * Since the xstat patches are still a work in progress, we borrow its data | |
27 | * structures and #defines to implement ceph_getattrx. Once the xstat stuff | |
28 | * has been merged we should drop this and switch over to using that instead. | |
29 | */ | |
30 | struct ceph_statx { | |
31 | uint32_t stx_mask; | |
32 | uint32_t stx_blksize; | |
33 | uint32_t stx_nlink; | |
34 | uint32_t stx_uid; | |
35 | uint32_t stx_gid; | |
36 | uint16_t stx_mode; | |
37 | uint64_t stx_ino; | |
38 | uint64_t stx_size; | |
39 | uint64_t stx_blocks; | |
40 | dev_t stx_dev; | |
41 | dev_t stx_rdev; | |
42 | struct timespec stx_atime; | |
43 | struct timespec stx_ctime; | |
44 | struct timespec stx_mtime; | |
45 | struct timespec stx_btime; | |
46 | uint64_t stx_version; | |
47 | }; | |
48 | ||
49 | #define CEPH_STATX_MODE 0x00000001U /* Want/got stx_mode */ | |
50 | #define CEPH_STATX_NLINK 0x00000002U /* Want/got stx_nlink */ | |
51 | #define CEPH_STATX_UID 0x00000004U /* Want/got stx_uid */ | |
52 | #define CEPH_STATX_GID 0x00000008U /* Want/got stx_gid */ | |
53 | #define CEPH_STATX_RDEV 0x00000010U /* Want/got stx_rdev */ | |
54 | #define CEPH_STATX_ATIME 0x00000020U /* Want/got stx_atime */ | |
55 | #define CEPH_STATX_MTIME 0x00000040U /* Want/got stx_mtime */ | |
56 | #define CEPH_STATX_CTIME 0x00000080U /* Want/got stx_ctime */ | |
57 | #define CEPH_STATX_INO 0x00000100U /* Want/got stx_ino */ | |
58 | #define CEPH_STATX_SIZE 0x00000200U /* Want/got stx_size */ | |
59 | #define CEPH_STATX_BLOCKS 0x00000400U /* Want/got stx_blocks */ | |
60 | #define CEPH_STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */ | |
61 | #define CEPH_STATX_BTIME 0x00000800U /* Want/got stx_btime */ | |
62 | #define CEPH_STATX_VERSION 0x00001000U /* Want/got stx_version */ | |
63 | #define CEPH_STATX_ALL_STATS 0x00001fffU /* All supported stats */ | |
64 | ||
65 | /* | |
66 | * Compatability macros until these defines make their way into glibc | |
67 | */ | |
68 | #ifndef AT_NO_ATTR_SYNC | |
69 | #define AT_NO_ATTR_SYNC 0x4000 /* Don't sync attributes with the server */ | |
70 | #endif | |
71 | ||
72 | /* | |
73 | * The statx interfaces only allow these flags. In order to allow us to add | |
74 | * others in the future, we disallow setting any that aren't recognized. | |
75 | */ | |
76 | #define CEPH_REQ_FLAG_MASK (AT_SYMLINK_NOFOLLOW|AT_NO_ATTR_SYNC) | |
77 | ||
78 | #ifdef __cplusplus | |
79 | } | |
80 | #endif | |
81 | ||
82 | #endif /* CEPH_STATX_H */ | |
83 |