The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | **************************************************************************** |
| 11 | ****************************************************************************/ |
| 12 | #ifndef LOCKD_XDR_H |
| 13 | #define LOCKD_XDR_H |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 14 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 15 | #include <linux/fs.h> |
| 16 | #include <linux/nfs.h> |
| 17 | #include <linux/sunrpc/xdr.h> |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 18 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 19 | #define NLM_MAXCOOKIELEN 32 |
| 20 | #define NLM_MAXSTRLEN 1024 |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 21 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 22 | #define nlm_granted __constant_htonl(NLM_LCK_GRANTED) |
| 23 | #define nlm_lck_denied __constant_htonl(NLM_LCK_DENIED) |
| 24 | #define nlm_lck_denied_nolocks __constant_htonl(NLM_LCK_DENIED_NOLOCKS) |
| 25 | #define nlm_lck_blocked __constant_htonl(NLM_LCK_BLOCKED) |
| 26 | #define nlm_lck_denied_grace_period __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD) |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 27 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 28 | struct nlm_lock { |
| 29 | char * caller; |
| 30 | int len; |
| 31 | struct nfs_fh fh; |
| 32 | struct xdr_netobj oh; |
| 33 | u32 svid; |
| 34 | struct file_lock fl; |
| 35 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 36 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 37 | struct nlm_cookie |
| 38 | { |
| 39 | unsigned char data[NLM_MAXCOOKIELEN]; |
| 40 | unsigned int len; |
| 41 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 42 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 43 | struct nlm_args { |
| 44 | struct nlm_cookie cookie; |
| 45 | struct nlm_lock lock; |
| 46 | u32 block; |
| 47 | u32 reclaim; |
| 48 | u32 state; |
| 49 | u32 monitor; |
| 50 | u32 fsm_access; |
| 51 | u32 fsm_mode; |
| 52 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 53 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 54 | typedef struct nlm_args nlm_args; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 55 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 56 | struct nlm_res { |
| 57 | struct nlm_cookie cookie; |
| 58 | u32 status; |
| 59 | struct nlm_lock lock; |
| 60 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 61 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 62 | struct nlm_reboot { |
| 63 | char * mon; |
| 64 | int len; |
| 65 | u32 state; |
| 66 | u32 addr; |
| 67 | u32 vers; |
| 68 | u32 proto; |
| 69 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 70 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 71 | #define NLMSVC_XDRSIZE sizeof(struct nlm_args) |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 72 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 73 | #endif |