History

ceph_parse_param(), ceph_parse_mon_ips(): switch to passing fc_log

... and now errorf() et.al. are never called with NULL fs_context, so we can get rid of conditional in those.

Al Viro committed 6 years ago

Commit c80c98f1 parent 7f5d3813 files · +9 −8Browse files

Unified · Split

3 files
  1. fs/ceph/super.c +2 −2
  2. include/linux/ceph/libceph.h +3 −2
  3. net/ceph/ceph_common.c +4 −4
fs/ceph/super.c+2−2
@@ -250,7 +250,7 @@ static int ceph_parse_source(struct fs_parameter *param, struct fs_context *fc) · 249 unmodified lines
250 dout("server path '%s'\n", fsopt->server_path);250 dout("server path '%s'\n", fsopt->server_path);
251 251
252 ret = ceph_parse_mon_ips(param->string, dev_name_end - dev_name,252 ret = ceph_parse_mon_ips(param->string, dev_name_end - dev_name,
253 pctx->copts, fc);253 pctx->copts, fc->log);
254 if (ret)254 if (ret)
255 return ret;255 return ret;
256 256
@@ -268,7 +268,7 @@ static int ceph_parse_mount_param(struct fs_context *fc, · 11 unmodified lines
268 unsigned int mode;268 unsigned int mode;
269 int token, ret;269 int token, ret;
270 270
271 ret = ceph_parse_param(param, pctx->copts, fc);271 ret = ceph_parse_param(param, pctx->copts, fc->log);
272 if (ret != -ENOPARAM)272 if (ret != -ENOPARAM)
273 return ret;273 return ret;
274 274
include/linux/ceph/libceph.h+3−2
@@ -281,11 +281,12 @@ extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); · 280 unmodified lines
281extern void *ceph_kvmalloc(size_t size, gfp_t flags);281extern void *ceph_kvmalloc(size_t size, gfp_t flags);
282 282
283struct fs_parameter;283struct fs_parameter;
284struct fc_log;
284struct ceph_options *ceph_alloc_options(void);285struct ceph_options *ceph_alloc_options(void);
285int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt,286int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt,
286 struct fs_context *fc);287 struct fc_log *l);
287int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,288int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
288 struct fs_context *fc);289 struct fc_log *l);
289int ceph_print_client_options(struct seq_file *m, struct ceph_client *client,290int ceph_print_client_options(struct seq_file *m, struct ceph_client *client,
290 bool show_all);291 bool show_all);
291extern void ceph_destroy_options(struct ceph_options *opt);292extern void ceph_destroy_options(struct ceph_options *opt);
net/ceph/ceph_common.c+4−4
@@ -383,9 +383,9 @@ out: · 382 unmodified lines
383}383}
384 384
385int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt,385int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt,
386 struct fs_context *fc)386 struct fc_log *l)
387{387{
388 struct p_log log = {.prefix = "libceph", .log = fc ? fc->log : NULL};388 struct p_log log = {.prefix = "libceph", .log = l};
389 int ret;389 int ret;
390 390
391 /* ip1[:port1][,ip2[:port2]...] */391 /* ip1[:port1][,ip2[:port2]...] */
@@ -401,11 +401,11 @@ int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt, · 9 unmodified lines
401EXPORT_SYMBOL(ceph_parse_mon_ips);401EXPORT_SYMBOL(ceph_parse_mon_ips);
402 402
403int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,403int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
404 struct fs_context *fc)404 struct fc_log *l)
405{405{
406 struct fs_parse_result result;406 struct fs_parse_result result;
407 int token, err;407 int token, err;
408 struct p_log log = {.prefix = "libceph", .log = fc ? fc->log : NULL};408 struct p_log log = {.prefix = "libceph", .log = l};
409 409
410 token = __fs_parse(&log, &ceph_parameters, param, &result);410 token = __fs_parse(&log, &ceph_parameters, param, &result);
411 dout("%s fs_parse '%s' token %d\n", __func__, param->key, token);411 dout("%s fs_parse '%s' token %d\n", __func__, param->key, token);