diff options
Diffstat (limited to 'include/linux/textsearch.h')
-rw-r--r-- | include/linux/textsearch.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h index 6f371f24160b..d9a85d616385 100644 --- a/include/linux/textsearch.h +++ b/include/linux/textsearch.h | |||
@@ -10,10 +10,8 @@ | |||
10 | 10 | ||
11 | struct ts_config; | 11 | struct ts_config; |
12 | 12 | ||
13 | /** | 13 | #define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */ |
14 | * TS_AUTOLOAD - Automatically load textsearch modules when needed | 14 | #define TS_IGNORECASE 2 /* Searches string case insensitively */ |
15 | */ | ||
16 | #define TS_AUTOLOAD 1 | ||
17 | 15 | ||
18 | /** | 16 | /** |
19 | * struct ts_state - search state | 17 | * struct ts_state - search state |
@@ -39,7 +37,7 @@ struct ts_state | |||
39 | struct ts_ops | 37 | struct ts_ops |
40 | { | 38 | { |
41 | const char *name; | 39 | const char *name; |
42 | struct ts_config * (*init)(const void *, unsigned int, gfp_t); | 40 | struct ts_config * (*init)(const void *, unsigned int, gfp_t, int); |
43 | unsigned int (*find)(struct ts_config *, | 41 | unsigned int (*find)(struct ts_config *, |
44 | struct ts_state *); | 42 | struct ts_state *); |
45 | void (*destroy)(struct ts_config *); | 43 | void (*destroy)(struct ts_config *); |
@@ -52,12 +50,14 @@ struct ts_ops | |||
52 | /** | 50 | /** |
53 | * struct ts_config - search configuration | 51 | * struct ts_config - search configuration |
54 | * @ops: operations of chosen algorithm | 52 | * @ops: operations of chosen algorithm |
53 | * @flags: flags | ||
55 | * @get_next_block: callback to fetch the next block to search in | 54 | * @get_next_block: callback to fetch the next block to search in |
56 | * @finish: callback to finalize a search | 55 | * @finish: callback to finalize a search |
57 | */ | 56 | */ |
58 | struct ts_config | 57 | struct ts_config |
59 | { | 58 | { |
60 | struct ts_ops *ops; | 59 | struct ts_ops *ops; |
60 | int flags; | ||
61 | 61 | ||
62 | /** | 62 | /** |
63 | * get_next_block - fetch next block of data | 63 | * get_next_block - fetch next block of data |
@@ -162,11 +162,10 @@ static inline struct ts_config *alloc_ts_config(size_t payload, | |||
162 | { | 162 | { |
163 | struct ts_config *conf; | 163 | struct ts_config *conf; |
164 | 164 | ||
165 | conf = kmalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask); | 165 | conf = kzalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask); |
166 | if (conf == NULL) | 166 | if (conf == NULL) |
167 | return ERR_PTR(-ENOMEM); | 167 | return ERR_PTR(-ENOMEM); |
168 | 168 | ||
169 | memset(conf, 0, TS_PRIV_ALIGN(sizeof(*conf)) + payload); | ||
170 | return conf; | 169 | return conf; |
171 | } | 170 | } |
172 | 171 | ||