@@ -192,17 +192,19 @@ int vfs_parse_fs_string(struct fs_context *fc, const char *key,
192
192
EXPORT_SYMBOL (vfs_parse_fs_string );
193
193
194
194
/**
195
- * generic_parse_monolithic - Parse key[=val][,key[=val]]* mount data
195
+ * vfs_parse_monolithic_sep - Parse key[=val][,key[=val]]* mount data
196
196
* @fc: The superblock configuration to fill in.
197
197
* @data: The data to parse
198
+ * @sep: callback for separating next option
198
199
*
199
- * Parse a blob of data that's in key[=val][,key[=val]]* form. This can be
200
- * called from the ->monolithic_mount_data() fs_context operation .
200
+ * Parse a blob of data that's in key[=val][,key[=val]]* form with a custom
201
+ * option separator callback .
201
202
*
202
203
* Returns 0 on success or the error returned by the ->parse_option() fs_context
203
204
* operation on failure.
204
205
*/
205
- int generic_parse_monolithic (struct fs_context * fc , void * data )
206
+ int vfs_parse_monolithic_sep (struct fs_context * fc , void * data ,
207
+ char * (* sep )(char * * ))
206
208
{
207
209
char * options = data , * key ;
208
210
int ret = 0 ;
@@ -214,7 +216,7 @@ int generic_parse_monolithic(struct fs_context *fc, void *data)
214
216
if (ret )
215
217
return ret ;
216
218
217
- while ((key = strsep (& options , "," )) != NULL ) {
219
+ while ((key = sep (& options )) != NULL ) {
218
220
if (* key ) {
219
221
size_t v_len = 0 ;
220
222
char * value = strchr (key , '=' );
@@ -233,6 +235,28 @@ int generic_parse_monolithic(struct fs_context *fc, void *data)
233
235
234
236
return ret ;
235
237
}
238
+ EXPORT_SYMBOL (vfs_parse_monolithic_sep );
239
+
240
+ static char * vfs_parse_comma_sep (char * * s )
241
+ {
242
+ return strsep (s , "," );
243
+ }
244
+
245
+ /**
246
+ * generic_parse_monolithic - Parse key[=val][,key[=val]]* mount data
247
+ * @fc: The superblock configuration to fill in.
248
+ * @data: The data to parse
249
+ *
250
+ * Parse a blob of data that's in key[=val][,key[=val]]* form. This can be
251
+ * called from the ->monolithic_mount_data() fs_context operation.
252
+ *
253
+ * Returns 0 on success or the error returned by the ->parse_option() fs_context
254
+ * operation on failure.
255
+ */
256
+ int generic_parse_monolithic (struct fs_context * fc , void * data )
257
+ {
258
+ return vfs_parse_monolithic_sep (fc , data , vfs_parse_comma_sep );
259
+ }
236
260
EXPORT_SYMBOL (generic_parse_monolithic );
237
261
238
262
/**
0 commit comments