diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-06-22 23:23:48 -0400 |
---|---|---|
committer | Niv Sardi <xaiki@debian.org> | 2008-07-28 02:58:53 -0400 |
commit | ad9b463aa206b8c8f0bab378cf7c090c1a9a8e34 (patch) | |
tree | c427ffd218b9123ec5fc6d004d6bd25e65e8de1f /fs/xfs/xfs_attr.h | |
parent | caf8aabdbc6849de772850d26d3dbe35e8f63bff (diff) |
[XFS] Switches xfs_vn_listxattr to set it's put_listent callback directly
and not go through xfs_attr_list.
SGI-PV: 983395
SGI-Modid: xfs-linux-melb:xfs-kern:31324a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_attr.h')
-rw-r--r-- | fs/xfs/xfs_attr.h | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/fs/xfs/xfs_attr.h b/fs/xfs/xfs_attr.h index c1f7d43e5ecf..41469434f413 100644 --- a/fs/xfs/xfs_attr.h +++ b/fs/xfs/xfs_attr.h | |||
@@ -18,9 +18,11 @@ | |||
18 | #ifndef __XFS_ATTR_H__ | 18 | #ifndef __XFS_ATTR_H__ |
19 | #define __XFS_ATTR_H__ | 19 | #define __XFS_ATTR_H__ |
20 | 20 | ||
21 | struct xfs_inode; | ||
22 | struct xfs_da_args; | ||
23 | struct xfs_attr_list_context; | ||
24 | |||
21 | /* | 25 | /* |
22 | * xfs_attr.h | ||
23 | * | ||
24 | * Large attribute lists are structured around Btrees where all the data | 26 | * Large attribute lists are structured around Btrees where all the data |
25 | * elements are in the leaf nodes. Attribute names are hashed into an int, | 27 | * elements are in the leaf nodes. Attribute names are hashed into an int, |
26 | * then that int is used as the index into the Btree. Since the hashval | 28 | * then that int is used as the index into the Btree. Since the hashval |
@@ -35,17 +37,6 @@ | |||
35 | * External interfaces | 37 | * External interfaces |
36 | *========================================================================*/ | 38 | *========================================================================*/ |
37 | 39 | ||
38 | struct cred; | ||
39 | struct xfs_attr_list_context; | ||
40 | |||
41 | typedef struct attrnames { | ||
42 | char * attr_name; | ||
43 | unsigned int attr_namelen; | ||
44 | } attrnames_t; | ||
45 | |||
46 | extern struct attrnames attr_user; | ||
47 | extern struct attrnames attr_secure; | ||
48 | extern struct attrnames attr_trusted; | ||
49 | 40 | ||
50 | #define ATTR_DONTFOLLOW 0x0001 /* -- unused, from IRIX -- */ | 41 | #define ATTR_DONTFOLLOW 0x0001 /* -- unused, from IRIX -- */ |
51 | #define ATTR_ROOT 0x0002 /* use attrs in root (trusted) namespace */ | 42 | #define ATTR_ROOT 0x0002 /* use attrs in root (trusted) namespace */ |
@@ -54,14 +45,8 @@ extern struct attrnames attr_trusted; | |||
54 | #define ATTR_CREATE 0x0010 /* pure create: fail if attr already exists */ | 45 | #define ATTR_CREATE 0x0010 /* pure create: fail if attr already exists */ |
55 | #define ATTR_REPLACE 0x0020 /* pure set: fail if attr does not exist */ | 46 | #define ATTR_REPLACE 0x0020 /* pure set: fail if attr does not exist */ |
56 | 47 | ||
57 | #define ATTR_KERNACCESS 0x0400 /* [kernel] iaccess, inode held io-locked */ | ||
58 | #define ATTR_KERNOTIME 0x1000 /* [kernel] don't update inode timestamps */ | 48 | #define ATTR_KERNOTIME 0x1000 /* [kernel] don't update inode timestamps */ |
59 | #define ATTR_KERNOVAL 0x2000 /* [kernel] get attr size only, not value */ | 49 | #define ATTR_KERNOVAL 0x2000 /* [kernel] get attr size only, not value */ |
60 | #define ATTR_KERNAMELS 0x4000 /* [kernel] list attr names (simple list) */ | ||
61 | |||
62 | #define ATTR_KERNORMALS 0x0800 /* [kernel] normal attr list: user+secure */ | ||
63 | #define ATTR_KERNROOTLS 0x8000 /* [kernel] include root in the attr list */ | ||
64 | #define ATTR_KERNFULLS (ATTR_KERNORMALS|ATTR_KERNROOTLS) | ||
65 | 50 | ||
66 | /* | 51 | /* |
67 | * The maximum size (into the kernel or returned from the kernel) of an | 52 | * The maximum size (into the kernel or returned from the kernel) of an |
@@ -129,20 +114,40 @@ typedef struct attrlist_cursor_kern { | |||
129 | 114 | ||
130 | 115 | ||
131 | /*======================================================================== | 116 | /*======================================================================== |
132 | * Function prototypes for the kernel. | 117 | * Structure used to pass context around among the routines. |
133 | *========================================================================*/ | 118 | *========================================================================*/ |
134 | 119 | ||
135 | struct xfs_inode; | 120 | |
136 | struct attrlist_cursor_kern; | 121 | typedef int (*put_listent_func_t)(struct xfs_attr_list_context *, int, |
137 | struct xfs_da_args; | 122 | char *, int, int, char *); |
123 | |||
124 | typedef struct xfs_attr_list_context { | ||
125 | struct xfs_inode *dp; /* inode */ | ||
126 | struct attrlist_cursor_kern *cursor; /* position in list */ | ||
127 | char *alist; /* output buffer */ | ||
128 | int seen_enough; /* T/F: seen enough of list? */ | ||
129 | int count; /* num used entries */ | ||
130 | int dupcnt; /* count dup hashvals seen */ | ||
131 | int bufsize; /* total buffer size */ | ||
132 | int firstu; /* first used byte in buffer */ | ||
133 | int flags; /* from VOP call */ | ||
134 | int resynch; /* T/F: resynch with cursor */ | ||
135 | int put_value; /* T/F: need value for listent */ | ||
136 | put_listent_func_t put_listent; /* list output fmt function */ | ||
137 | int index; /* index into output buffer */ | ||
138 | } xfs_attr_list_context_t; | ||
139 | |||
140 | |||
141 | /*======================================================================== | ||
142 | * Function prototypes for the kernel. | ||
143 | *========================================================================*/ | ||
138 | 144 | ||
139 | /* | 145 | /* |
140 | * Overall external interface routines. | 146 | * Overall external interface routines. |
141 | */ | 147 | */ |
142 | int xfs_attr_inactive(struct xfs_inode *dp); | 148 | int xfs_attr_inactive(struct xfs_inode *dp); |
143 | |||
144 | int xfs_attr_shortform_getvalue(struct xfs_da_args *); | ||
145 | int xfs_attr_fetch(struct xfs_inode *, struct xfs_name *, char *, int *, int); | 149 | int xfs_attr_fetch(struct xfs_inode *, struct xfs_name *, char *, int *, int); |
146 | int xfs_attr_rmtval_get(struct xfs_da_args *args); | 150 | int xfs_attr_rmtval_get(struct xfs_da_args *args); |
151 | int xfs_attr_list_int(struct xfs_attr_list_context *); | ||
147 | 152 | ||
148 | #endif /* __XFS_ATTR_H__ */ | 153 | #endif /* __XFS_ATTR_H__ */ |