@@ -192,17 +192,19 @@ int vfs_parse_fs_string(struct fs_context *fc, const char *key,
192192EXPORT_SYMBOL (vfs_parse_fs_string );
193193
194194/**
195- * generic_parse_monolithic - Parse key[=val][,key[=val]]* mount data
195+ * vfs_parse_monolithic_sep - Parse key[=val][,key[=val]]* mount data
196196 * @fc: The superblock configuration to fill in.
197197 * @data: The data to parse
198+ * @sep: callback for separating next option
198199 *
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 .
201202 *
202203 * Returns 0 on success or the error returned by the ->parse_option() fs_context
203204 * operation on failure.
204205 */
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 * * ))
206208{
207209 char * options = data , * key ;
208210 int ret = 0 ;
@@ -214,7 +216,7 @@ int generic_parse_monolithic(struct fs_context *fc, void *data)
214216 if (ret )
215217 return ret ;
216218
217- while ((key = strsep (& options , "," )) != NULL ) {
219+ while ((key = sep (& options )) != NULL ) {
218220 if (* key ) {
219221 size_t v_len = 0 ;
220222 char * value = strchr (key , '=' );
@@ -233,6 +235,28 @@ int generic_parse_monolithic(struct fs_context *fc, void *data)
233235
234236 return ret ;
235237}
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+ }
236260EXPORT_SYMBOL (generic_parse_monolithic );
237261
238262/**
0 commit comments