Skip to content

Commit fbc6bdd

Browse files
committed
cleanup: rename _cleanup_nvme_global_ctx_ to __cleanup_nvme_global_ctx
Follow the new naming pattern of the compiler attributes which is just __NAME. This is what the kernel is using as well. Signed-off-by: Daniel Wagner <[email protected]>
1 parent e2c77a7 commit fbc6bdd

46 files changed

Lines changed: 325 additions & 325 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fabrics.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ int fabrics_discovery(const char *desc, int argc, char **argv, bool connect)
479479
char *config_file = PATH_NVMF_CONFIG;
480480
char *context = NULL;
481481
nvme_print_flags_t flags;
482-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
482+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
483483
_cleanup_nvmf_context_ struct libnvmf_context *fctx = NULL;
484484
int ret;
485485
struct libnvme_fabrics_config cfg;
@@ -591,7 +591,7 @@ int fabrics_connect(const char *desc, int argc, char **argv)
591591
__cleanup_free char *hid = NULL;
592592
char *config_file = NULL;
593593
char *context = NULL;
594-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
594+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
595595
_cleanup_nvmf_context_ struct libnvmf_context *fctx = NULL;
596596
__cleanup_nvme_ctrl libnvme_ctrl_t c = NULL;
597597
int ret;
@@ -736,7 +736,7 @@ static void nvmf_disconnect_nqn(struct libnvme_global_ctx *ctx, char *nqn)
736736
int fabrics_disconnect(const char *desc, int argc, char **argv)
737737
{
738738
const char *device = "nvme device handle";
739-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
739+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
740740
libnvme_ctrl_t c;
741741
char *p;
742742
int ret;
@@ -820,7 +820,7 @@ int fabrics_disconnect(const char *desc, int argc, char **argv)
820820

821821
int fabrics_disconnect_all(const char *desc, int argc, char **argv)
822822
{
823-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
823+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
824824
libnvme_host_t h;
825825
libnvme_subsystem_t s;
826826
libnvme_ctrl_t c;
@@ -887,7 +887,7 @@ int fabrics_disconnect_all(const char *desc, int argc, char **argv)
887887
int fabrics_config(const char *desc, int argc, char **argv)
888888
{
889889
bool scan_tree = false, modify_config = false, update_config = false;
890-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
890+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
891891
char *config_file = PATH_NVMF_CONFIG;
892892
struct libnvme_fabrics_config cfg;
893893
struct nvmf_args fa = { };
@@ -998,7 +998,7 @@ static int dim_operation(libnvme_ctrl_t c, enum nvmf_dim_tas tas, const char *na
998998

999999
int fabrics_dim(const char *desc, int argc, char **argv)
10001000
{
1001-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
1001+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
10021002
enum nvmf_dim_tas tas;
10031003
libnvme_ctrl_t c;
10041004
char *p;

nvme-rpmb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ int rpmb_cmd_option(int argc, char **argv, struct command *acmd, struct plugin *
871871

872872
__cleanup_free unsigned char *key_buf = NULL;
873873
__cleanup_free unsigned char *msg_buf = NULL;
874-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
874+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
875875
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
876876
unsigned int write_cntr = 0;
877877
unsigned int msg_size = 0;

nvme.c

Lines changed: 102 additions & 102 deletions
Large diffs are not rendered by default.

plugins/amzn/amzn-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static int get_stats(int argc, char **argv, struct command *acmd,
562562
{
563563
const char *desc = "display command latency statistics";
564564
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
565-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
565+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
566566
struct amzn_latency_log_page log = { 0 };
567567
nvme_print_flags_t flags = 0;
568568
struct libnvme_passthru_cmd cmd;

plugins/dapustor/dapustor-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ static int dapustor_additional_smart_log(int argc, char **argv, struct command *
513513

514514
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
515515
struct nvme_extended_additional_smart_log ext_smart_log;
516-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
516+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
517517
struct nvme_additional_smart_log smart_log;
518518
nvme_print_flags_t flags;
519519
bool has_ext = false;

plugins/dera/dera-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int get_status(int argc, char **argv, struct command *acmd, struct plugin
119119
{
120120
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
121121
enum dera_device_status state = DEVICE_STATUS_FATAL_ERROR;
122-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
122+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
123123
char *desc = "Get the Dera device status";
124124
struct nvme_dera_smart_info_log log;
125125
int err;

plugins/fdp/fdp.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static int fdp_configs(int argc, char **argv, struct command *acmd,
2727
const char *human_readable = "show log in readable format";
2828
const char *raw = "use binary output";
2929

30-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
30+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
3131
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
3232
__cleanup_free void *log = NULL;
3333
struct nvme_fdp_config_log hdr;
@@ -97,7 +97,7 @@ static int fdp_usage(int argc, char **argv, struct command *acmd, struct plugin
9797
const char *egid = "Endurance group identifier";
9898
const char *raw = "use binary output";
9999

100-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
100+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
101101
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
102102
__cleanup_free void *log = NULL;
103103
struct nvme_fdp_ruhu_log hdr;
@@ -161,7 +161,7 @@ static int fdp_stats(int argc, char **argv, struct command *acmd, struct plugin
161161
const char *egid = "Endurance group identifier";
162162
const char *raw = "use binary output";
163163

164-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
164+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
165165
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
166166
struct nvme_fdp_stats_log stats;
167167
nvme_print_flags_t flags;
@@ -219,7 +219,7 @@ static int fdp_events(int argc, char **argv, struct command *acmd, struct plugin
219219
const char *host_events = "Get host events";
220220
const char *raw = "use binary output";
221221

222-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
222+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
223223
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
224224
struct nvme_fdp_events_log events;
225225
nvme_print_flags_t flags;
@@ -279,7 +279,7 @@ static int fdp_status(int argc, char **argv, struct command *acmd, struct plugin
279279
const char *raw = "use binary output";
280280

281281
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
282-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
282+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
283283
__cleanup_free void *buf = NULL;
284284
struct nvme_fdp_ruh_status hdr;
285285
struct libnvme_passthru_cmd cmd;
@@ -352,7 +352,7 @@ static int fdp_update(int argc, char **argv, struct command *acmd, struct plugin
352352
const char *_pids = "Comma-separated list of placement identifiers to update";
353353

354354
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
355-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
355+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
356356
struct libnvme_passthru_cmd cmd;
357357
unsigned short pids[256];
358358
__u16 buf[256];
@@ -417,7 +417,7 @@ static int fdp_set_events(int argc, char **argv, struct command *acmd, struct pl
417417
const char *ph = "Placement Handle";
418418
const char *sv = "specifies that the controller shall save the attribute";
419419

420-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
420+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
421421
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
422422
unsigned short evts[255];
423423
__u8 buf[255];
@@ -495,7 +495,7 @@ static int fdp_feature(int argc, char **argv, struct command *acmd, struct plugi
495495
const char *endurance_group = "Endurance group ID";
496496
const char *disable = "Disable current FDP configuration";
497497

498-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
498+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
499499
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
500500
bool enabling_conf_idx = false;
501501
__u64 result;

plugins/feat/feat-nvme.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static int feat_power_mgmt(int argc, char **argv, struct command *acmd, struct p
139139
const char *wh = "workload hint";
140140
const __u8 fid = NVME_FEAT_FID_POWER_MGMT;
141141

142-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
142+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
143143
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
144144
int err;
145145

@@ -234,7 +234,7 @@ static int feat_perfc(int argc, char **argv, struct command *acmd, struct plugin
234234
const char *attrl = "attribute length";
235235
const char *vs_data = "vendor specific data";
236236

237-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
237+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
238238
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
239239
int err;
240240
__u8 fid = NVME_FEAT_FID_PERF_CHARACTERISTICS;
@@ -298,7 +298,7 @@ static int feat_hctm(int argc, char **argv, struct command *acmd, struct plugin
298298
{
299299
const __u8 fid = NVME_FEAT_FID_HCTM;
300300

301-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
301+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
302302
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
303303
int err;
304304

@@ -361,7 +361,7 @@ static int feat_timestamp(int argc, char **argv, struct command *acmd, struct pl
361361
const __u8 fid = NVME_FEAT_FID_TIMESTAMP;
362362
const char *tstmp = "timestamp";
363363

364-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
364+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
365365
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
366366
int err;
367367

@@ -445,7 +445,7 @@ static int feat_temp_thresh(int argc, char **argv, struct command *acmd, struct
445445
const char *thsel = "threshold type select";
446446
const char *tmpthh = "temperature threshold hysteresis";
447447

448-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
448+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
449449
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
450450
int err;
451451

@@ -533,7 +533,7 @@ static int feat_arbitration(int argc, char **argv, struct command *acmd, struct
533533
const char *mpw = "medium priority weight";
534534
const char *hpw = "high priority weight";
535535

536-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
536+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
537537
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
538538
int err;
539539

@@ -585,7 +585,7 @@ static int feat_volatile_wc(int argc, char **argv, struct command *acmd, struct
585585
const __u8 fid = NVME_FEAT_FID_VOLATILE_WC;
586586
const char *wce = "volatile write cache enable";
587587

588-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
588+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
589589
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
590590
int err;
591591

@@ -644,7 +644,7 @@ static int feat_power_limit(int argc, char **argv, struct command *acmd,
644644
const char *pls = "power limit scale";
645645
const __u8 fid = NVME_FEAT_FID_POWER_LIMIT;
646646

647-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
647+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
648648

649649
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
650650
NULL;
@@ -716,7 +716,7 @@ static int feat_power_thresh(int argc, char **argv, struct command *acmd,
716716
const char *ept = "enable power threshold";
717717
const __u8 fid = NVME_FEAT_FID_POWER_THRESH;
718718

719-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
719+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
720720

721721
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
722722
NULL;
@@ -793,7 +793,7 @@ static int feat_power_meas(int argc, char **argv, struct command *cmd,
793793
const char *smt = "stop measurement time";
794794
const __u8 fid = NVME_FEAT_FID_POWER_MEASUREMENT;
795795

796-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
796+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
797797

798798
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
799799
NULL;
@@ -862,7 +862,7 @@ static int feat_err_recovery(int argc, char **argv, struct command *acmd,
862862
{
863863
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
864864
NULL;
865-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
865+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
866866

867867
const char *dulbe =
868868
"deallocated or unwritten logical block error enable";
@@ -947,7 +947,7 @@ static int feat_num_queues(int argc, char **argv, struct command *acmd,
947947
{
948948
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
949949
NULL;
950-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
950+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
951951

952952
const char *ncqr = "number of I/O completion queues requested";
953953
const char *nsqr = "number of I/O submission queues requested";

plugins/huawei/huawei-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static void huawei_print_list_items(struct huawei_list_item *list_items, unsigne
296296
static int huawei_list(int argc, char **argv, struct command *acmd,
297297
struct plugin *plugin)
298298
{
299-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx =
299+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx =
300300
libnvme_create_global_ctx(stdout, DEFAULT_LOGLEVEL);
301301
char path[264];
302302
struct dirent **devices;

plugins/ibm/ibm-nvme.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int get_ibm_addi_smart_log(int argc, char **argv, struct command *cmd, st
225225
const char *desc = "Get IBM specific additional smart log and show it.";
226226
const char *raw = "Dump output in binary format";
227227

228-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
228+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
229229
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
230230
struct nvme_ibm_additional_smart_log smart_log;
231231
int err;
@@ -352,7 +352,7 @@ static void show_ibm_vpd_log(struct nvme_ibm_vpd_log *vpd, const char *devname)
352352

353353
static int get_ibm_vpd_log(int argc, char **argv, struct command *cmd, struct plugin *plugin)
354354
{
355-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
355+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
356356
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
357357
struct nvme_ibm_vpd_log vpd_log;
358358
int err;
@@ -525,7 +525,7 @@ static int get_ibm_persistent_event_log(int argc, char **argv,
525525
const char *action = "action the controller shall take during "
526526
"processing this persistent log page command.";
527527
const char *log_len = "number of bytes to retrieve";
528-
_cleanup_nvme_global_ctx_ struct libnvme_global_ctx *ctx = NULL;
528+
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
529529
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
530530
struct nvme_persistent_event_log pevent_log;
531531
void *pevent_log_info = NULL;

0 commit comments

Comments
 (0)