aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_da_btree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_da_btree.h')
-rw-r--r--fs/xfs/xfs_da_btree.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h
index 7facf86f74f9..e64c6924996f 100644
--- a/fs/xfs/xfs_da_btree.h
+++ b/fs/xfs/xfs_da_btree.h
@@ -99,6 +99,15 @@ typedef struct xfs_da_node_entry xfs_da_node_entry_t;
99 *========================================================================*/ 99 *========================================================================*/
100 100
101/* 101/*
102 * Search comparison results
103 */
104enum xfs_dacmp {
105 XFS_CMP_DIFFERENT, /* names are completely different */
106 XFS_CMP_EXACT, /* names are exactly the same */
107 XFS_CMP_CASE /* names are same but differ in case */
108};
109
110/*
102 * Structure to ease passing around component names. 111 * Structure to ease passing around component names.
103 */ 112 */
104typedef struct xfs_da_args { 113typedef struct xfs_da_args {
@@ -127,6 +136,7 @@ typedef struct xfs_da_args {
127 unsigned char rename; /* T/F: this is an atomic rename op */ 136 unsigned char rename; /* T/F: this is an atomic rename op */
128 unsigned char addname; /* T/F: this is an add operation */ 137 unsigned char addname; /* T/F: this is an add operation */
129 unsigned char oknoent; /* T/F: ok to return ENOENT, else die */ 138 unsigned char oknoent; /* T/F: ok to return ENOENT, else die */
139 enum xfs_dacmp cmpresult; /* name compare result for lookups */
130} xfs_da_args_t; 140} xfs_da_args_t;
131 141
132/* 142/*
@@ -201,6 +211,14 @@ typedef struct xfs_da_state {
201 (uint)(XFS_DA_LOGOFF(BASE, ADDR)), \ 211 (uint)(XFS_DA_LOGOFF(BASE, ADDR)), \
202 (uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1) 212 (uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1)
203 213
214/*
215 * Name ops for directory and/or attr name operations
216 */
217struct xfs_nameops {
218 xfs_dahash_t (*hashname)(struct xfs_name *);
219 enum xfs_dacmp (*compname)(struct xfs_da_args *, const char *, int);
220};
221
204 222
205#ifdef __KERNEL__ 223#ifdef __KERNEL__
206/*======================================================================== 224/*========================================================================
@@ -249,6 +267,10 @@ int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
249 xfs_dabuf_t *dead_buf); 267 xfs_dabuf_t *dead_buf);
250 268
251uint xfs_da_hashname(const uchar_t *name_string, int name_length); 269uint xfs_da_hashname(const uchar_t *name_string, int name_length);
270enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
271 const char *name, int len);
272
273
252xfs_da_state_t *xfs_da_state_alloc(void); 274xfs_da_state_t *xfs_da_state_alloc(void);
253void xfs_da_state_free(xfs_da_state_t *state); 275void xfs_da_state_free(xfs_da_state_t *state);
254 276