@@ -337,7 +337,7 @@ EXPORT_SYMBOL(ceph_destroy_options);
337
337
338
338
/* get secret from key store */
339
339
static int get_secret (struct ceph_crypto_key * dst , const char * name ,
340
- struct fs_context * fc )
340
+ struct p_log * log )
341
341
{
342
342
struct key * ukey ;
343
343
int key_err ;
@@ -351,19 +351,19 @@ static int get_secret(struct ceph_crypto_key *dst, const char *name,
351
351
key_err = PTR_ERR (ukey );
352
352
switch (key_err ) {
353
353
case - ENOKEY :
354
- errorf ( fc , "libceph: Failed due to key not found: %s" ,
354
+ error_plog ( log , "Failed due to key not found: %s" ,
355
355
name );
356
356
break ;
357
357
case - EKEYEXPIRED :
358
- errorf ( fc , "libceph: Failed due to expired key: %s" ,
358
+ error_plog ( log , "Failed due to expired key: %s" ,
359
359
name );
360
360
break ;
361
361
case - EKEYREVOKED :
362
- errorf ( fc , "libceph: Failed due to revoked key: %s" ,
362
+ error_plog ( log , "Failed due to revoked key: %s" ,
363
363
name );
364
364
break ;
365
365
default :
366
- errorf ( fc , "libceph: Failed due to key error %d: %s" ,
366
+ error_plog ( log , "Failed due to key error %d: %s" ,
367
367
key_err , name );
368
368
}
369
369
err = - EPERM ;
@@ -385,13 +385,14 @@ static int get_secret(struct ceph_crypto_key *dst, const char *name,
385
385
int ceph_parse_mon_ips (const char * buf , size_t len , struct ceph_options * opt ,
386
386
struct fs_context * fc )
387
387
{
388
+ struct p_log log = {.prefix = "libceph" , .log = fc ? fc -> log : NULL };
388
389
int ret ;
389
390
390
391
/* ip1[:port1][,ip2[:port2]...] */
391
392
ret = ceph_parse_ips (buf , buf + len , opt -> mon_addr , CEPH_MAX_MON ,
392
393
& opt -> num_mon );
393
394
if (ret ) {
394
- errorf ( fc , "libceph: Failed to parse monitor IPs: %d" , ret );
395
+ error_plog ( & log , "Failed to parse monitor IPs: %d" , ret );
395
396
return ret ;
396
397
}
397
398
@@ -404,6 +405,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
404
405
{
405
406
struct fs_parse_result result ;
406
407
int token , err ;
408
+ struct p_log log = {.prefix = "libceph" , .log = fc ? fc -> log : NULL };
407
409
408
410
token = fs_parse (fc , & ceph_parameters , param , & result );
409
411
dout ("%s fs_parse '%s' token %d\n" , __func__ , param -> key , token );
@@ -417,7 +419,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
417
419
& opt -> my_addr ,
418
420
1 , NULL );
419
421
if (err ) {
420
- errorf ( fc , "libceph: Failed to parse ip: %d" , err );
422
+ error_plog ( & log , "Failed to parse ip: %d" , err );
421
423
return err ;
422
424
}
423
425
opt -> flags |= CEPH_OPT_MYIP ;
@@ -426,7 +428,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
426
428
case Opt_fsid :
427
429
err = parse_fsid (param -> string , & opt -> fsid );
428
430
if (err ) {
429
- errorf ( fc , "libceph: Failed to parse fsid: %d" , err );
431
+ error_plog ( & log , "Failed to parse fsid: %d" , err );
430
432
return err ;
431
433
}
432
434
opt -> flags |= CEPH_OPT_FSID ;
@@ -445,7 +447,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
445
447
return - ENOMEM ;
446
448
err = ceph_crypto_key_unarmor (opt -> key , param -> string );
447
449
if (err ) {
448
- errorf ( fc , "libceph: Failed to parse secret: %d" , err );
450
+ error_plog ( & log , "Failed to parse secret: %d" , err );
449
451
return err ;
450
452
}
451
453
break ;
@@ -456,10 +458,10 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
456
458
opt -> key = kzalloc (sizeof (* opt -> key ), GFP_KERNEL );
457
459
if (!opt -> key )
458
460
return - ENOMEM ;
459
- return get_secret (opt -> key , param -> string , fc );
461
+ return get_secret (opt -> key , param -> string , & log );
460
462
461
463
case Opt_osdtimeout :
462
- warnf ( fc , "libceph: Ignoring osdtimeout" );
464
+ warn_plog ( & log , "Ignoring osdtimeout" );
463
465
break ;
464
466
case Opt_osdkeepalivetimeout :
465
467
/* 0 isn't well defined right now, reject it */
@@ -530,7 +532,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
530
532
return 0 ;
531
533
532
534
out_of_range :
533
- return invalf ( fc , "libceph: %s out of range" , param -> key );
535
+ return inval_plog ( & log , "%s out of range" , param -> key );
534
536
}
535
537
EXPORT_SYMBOL (ceph_parse_param );
536
538
0 commit comments