Skip to content

Commit 746cfc0

Browse files
authored
Merge pull request #301 from Arunpandian15/doc_20
Streamlining documentation
2 parents 131ee68 + 9430bda commit 746cfc0

2 files changed

Lines changed: 46 additions & 42 deletions

File tree

src/nvme/fabrics.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ void nvmf_default_config(struct nvme_fabrics_config *cfg);
170170

171171
/**
172172
* nvmf_add_ctrl() - Connect a controller and update topology
173-
* @h: Host to which the controller should be attached
174-
* @c: Controller to be connected
175-
* @cfg: Default configuration for the controller
173+
* @h: Host to which the controller should be attached
174+
* @c: Controller to be connected
175+
* @cfg: Default configuration for the controller
176176
*
177177
* Issues a 'connect' command to the NVMe-oF controller and inserts @c
178178
* into the topology using @h as parent.
@@ -185,9 +185,9 @@ int nvmf_add_ctrl(nvme_host_t h, nvme_ctrl_t c,
185185

186186
/**
187187
* nvmf_get_discovery_log() - Return the discovery log page
188-
* @c: Discover controller to use
189-
* @logp: Pointer to the log page to be returned
190-
* @max_retries: maximum number of log page entries to be returned
188+
* @c: Discover controller to use
189+
* @logp: Pointer to the log page to be returned
190+
* @max_retries: maximum number of log page entries to be returned
191191
*
192192
* Return: 0 on success; on failure -1 is returned and errno is set
193193
*/
@@ -219,10 +219,10 @@ char *nvmf_hostid_from_file();
219219

220220
/**
221221
* nvmf_connect_disc_entry() - Connect controller based on the discovery log page entry
222-
* @h: Host to which the controller should be connected
223-
* @e: Discovery log page entry
224-
* @defcfg: Default configurationn to be used for the new controller
225-
* @discover: Set to 'true' if the new controller is a discovery controller
222+
* @h: Host to which the controller should be connected
223+
* @e: Discovery log page entry
224+
* @defcfg: Default configurationn to be used for the new controller
225+
* @discover: Set to 'true' if the new controller is a discovery controller
226226
*
227227
* Return: Pointer to the new controller
228228
*/

src/nvme/ioctl.c

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ int nvme_set_features(struct nvme_set_features_args *args)
455455
}
456456

457457
static int __nvme_set_features(int fd, __u8 fid, __u32 cdw11, bool save,
458-
__u32 *result)
458+
__u32 *result)
459459
{
460460
struct nvme_set_features_args args = {
461461
.args_size = sizeof(args),
@@ -476,7 +476,7 @@ static int __nvme_set_features(int fd, __u8 fid, __u32 cdw11, bool save,
476476
}
477477

478478
int nvme_set_features_arbitration(int fd, __u8 ab, __u8 lpw, __u8 mpw,
479-
__u8 hpw, bool save, __u32 *result)
479+
__u8 hpw, bool save, __u32 *result)
480480
{
481481
__u32 value = NVME_SET(ab, FEAT_ARBITRATION_BURST) |
482482
NVME_SET(lpw, FEAT_ARBITRATION_LPW) |
@@ -488,7 +488,7 @@ int nvme_set_features_arbitration(int fd, __u8 ab, __u8 lpw, __u8 mpw,
488488
}
489489

490490
int nvme_set_features_power_mgmt(int fd, __u8 ps, __u8 wh, bool save,
491-
__u32 *result)
491+
__u32 *result)
492492
{
493493
__u32 value = NVME_SET(ps, FEAT_PWRMGMT_PS) |
494494
NVME_SET(wh, FEAT_PWRMGMT_PS);
@@ -504,7 +504,8 @@ int nvme_set_features_lba_range(int fd, __u32 nsid, __u32 nr_ranges, bool save,
504504
}
505505

506506
int nvme_set_features_temp_thresh(int fd, __u16 tmpth, __u8 tmpsel,
507-
enum nvme_feat_tmpthresh_thsel thsel, bool save, __u32 *result)
507+
enum nvme_feat_tmpthresh_thsel thsel,
508+
bool save, __u32 *result)
508509
{
509510
__u32 value = NVME_SET(tmpth, FEAT_TT_TMPTH) |
510511
NVME_SET(tmpsel, FEAT_TT_TMPSEL) |
@@ -515,7 +516,7 @@ int nvme_set_features_temp_thresh(int fd, __u16 tmpth, __u8 tmpsel,
515516
}
516517

517518
int nvme_set_features_err_recovery(int fd, __u32 nsid, __u16 tler, bool dulbe,
518-
bool save, __u32 *result)
519+
bool save, __u32 *result)
519520
{
520521
__u32 value = NVME_SET(tler, FEAT_ERROR_RECOVERY_TLER) |
521522
NVME_SET(!!dulbe, FEAT_ERROR_RECOVERY_DULBE);
@@ -533,7 +534,7 @@ int nvme_set_features_volatile_wc(int fd, bool wce, bool save, __u32 *result)
533534
}
534535

535536
int nvme_set_features_irq_coalesce(int fd, __u8 thr, __u8 time, bool save,
536-
__u32 *result)
537+
__u32 *result)
537538
{
538539
__u32 value = NVME_SET(thr, FEAT_IRQC_TIME) |
539540
NVME_SET(time, FEAT_IRQC_THR);
@@ -543,7 +544,7 @@ int nvme_set_features_irq_coalesce(int fd, __u8 thr, __u8 time, bool save,
543544
}
544545

545546
int nvme_set_features_irq_config(int fd, __u16 iv, bool cd, bool save,
546-
__u32 *result)
547+
__u32 *result)
547548
{
548549
__u32 value = NVME_SET(iv, FEAT_ICFG_IV) |
549550
NVME_SET(!!cd, FEAT_ICFG_CD);
@@ -561,14 +562,14 @@ int nvme_set_features_write_atomic(int fd, bool dn, bool save, __u32 *result)
561562
}
562563

563564
int nvme_set_features_async_event(int fd, __u32 events,
564-
bool save, __u32 *result)
565+
bool save, __u32 *result)
565566
{
566567
return __nvme_set_features(fd, NVME_FEAT_FID_ASYNC_EVENT, events, save,
567568
result);
568569
}
569570

570571
int nvme_set_features_auto_pst(int fd, bool apste, bool save,
571-
struct nvme_feat_auto_pst *apst, __u32 *result)
572+
struct nvme_feat_auto_pst *apst, __u32 *result)
572573
{
573574
__u32 value = NVME_SET(!!apste, FEAT_APST_APSTE);
574575

@@ -600,7 +601,7 @@ int nvme_set_features_timestamp(int fd, bool save, __u64 timestamp)
600601
}
601602

602603
int nvme_set_features_hctm(int fd, __u16 tmt2, __u16 tmt1,
603-
bool save, __u32 *result)
604+
bool save, __u32 *result)
604605
{
605606
__u32 value = NVME_SET(tmt2, FEAT_HCTM_TMT2) |
606607
NVME_SET(tmt1, FEAT_HCTM_TMT1);
@@ -618,7 +619,7 @@ int nvme_set_features_nopsc(int fd, bool noppme, bool save, __u32 *result)
618619
}
619620

620621
int nvme_set_features_rrl(int fd, __u8 rrl, __u16 nvmsetid,
621-
bool save, __u32 *result)
622+
bool save, __u32 *result)
622623
{
623624
struct nvme_set_features_args args = {
624625
.args_size = sizeof(args),
@@ -640,7 +641,7 @@ int nvme_set_features_rrl(int fd, __u8 rrl, __u16 nvmsetid,
640641
}
641642

642643
int nvme_set_features_plm_config(int fd, bool plm, __u16 nvmsetid, bool save,
643-
struct nvme_plm_config *data, __u32 *result)
644+
struct nvme_plm_config *data, __u32 *result)
644645
{
645646
struct nvme_set_features_args args = {
646647
.args_size = sizeof(args),
@@ -662,7 +663,7 @@ int nvme_set_features_plm_config(int fd, bool plm, __u16 nvmsetid, bool save,
662663
}
663664

664665
int nvme_set_features_plm_window(int fd, enum nvme_feat_plm_window_select sel,
665-
__u16 nvmsetid, bool save, __u32 *result)
666+
__u16 nvmsetid, bool save, __u32 *result)
666667
{
667668
__u32 cdw12 = NVME_SET(sel, FEAT_PLMW_WS);
668669
struct nvme_set_features_args args = {
@@ -685,7 +686,7 @@ int nvme_set_features_plm_window(int fd, enum nvme_feat_plm_window_select sel,
685686
}
686687

687688
int nvme_set_features_lba_sts_interval(int fd, __u16 lsiri, __u16 lsipi,
688-
bool save, __u32 *result)
689+
bool save, __u32 *result)
689690
{
690691
__u32 value = NVME_SET(lsiri, FEAT_LBAS_LSIRI) |
691692
NVME_SET(lsipi, FEAT_LBAS_LSIPI);
@@ -839,7 +840,7 @@ int nvme_get_features_arbitration(int fd, enum nvme_get_features_sel sel,
839840
}
840841

841842
int nvme_get_features_power_mgmt(int fd, enum nvme_get_features_sel sel,
842-
__u32 *result)
843+
__u32 *result)
843844
{
844845
return __nvme_get_features(fd, NVME_FEAT_FID_POWER_MGMT, sel, result);
845846
}
@@ -898,7 +899,7 @@ int nvme_get_features_irq_coalesce(int fd, enum nvme_get_features_sel sel,
898899
}
899900

900901
int nvme_get_features_irq_config(int fd, enum nvme_get_features_sel sel,
901-
__u16 iv, __u32 *result)
902+
__u16 iv, __u32 *result)
902903
{
903904
struct nvme_get_features_args args = {
904905
.args_size = sizeof(args),
@@ -956,8 +957,8 @@ int nvme_get_features_host_mem_buf(int fd, enum nvme_get_features_sel sel,
956957
return __nvme_get_features(fd, NVME_FEAT_FID_HOST_MEM_BUF, sel, result);
957958
}
958959

959-
int nvme_get_features_timestamp(int fd,
960-
enum nvme_get_features_sel sel, struct nvme_timestamp *ts)
960+
int nvme_get_features_timestamp(int fd, enum nvme_get_features_sel sel,
961+
struct nvme_timestamp *ts)
961962
{
962963
struct nvme_get_features_args args = {
963964
.args_size = sizeof(args),
@@ -997,7 +998,8 @@ int nvme_get_features_rrl(int fd, enum nvme_get_features_sel sel, __u32 *result)
997998
}
998999

9991000
int nvme_get_features_plm_config(int fd, enum nvme_get_features_sel sel,
1000-
__u16 nvmsetid, struct nvme_plm_config *data, __u32 *result)
1001+
__u16 nvmsetid, struct nvme_plm_config *data,
1002+
__u32 *result)
10011003
{
10021004
struct nvme_get_features_args args = {
10031005
.args_size = sizeof(args),
@@ -1017,7 +1019,7 @@ int nvme_get_features_plm_config(int fd, enum nvme_get_features_sel sel,
10171019
}
10181020

10191021
int nvme_get_features_plm_window(int fd, enum nvme_get_features_sel sel,
1020-
__u16 nvmsetid, __u32 *result)
1022+
__u16 nvmsetid, __u32 *result)
10211023
{
10221024
struct nvme_get_features_args args = {
10231025
.args_size = sizeof(args),
@@ -1558,14 +1560,15 @@ int nvme_submit_io_passthru64(int fd, struct nvme_passthru_cmd64 *cmd,
15581560
}
15591561

15601562
int nvme_io_passthru64(int fd, __u8 opcode, __u8 flags, __u16 rsvd,
1561-
__u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11,
1562-
__u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15,
1563-
__u32 data_len, void *data, __u32 metadata_len, void *metadata,
1564-
__u32 timeout_ms, __u64 *result)
1563+
__u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10,
1564+
__u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14,
1565+
__u32 cdw15, __u32 data_len, void *data, __u32 metadata_len,
1566+
void *metadata, __u32 timeout_ms, __u64 *result)
15651567
{
15661568
return nvme_passthru64(fd, NVME_IOCTL_IO64_CMD, opcode, flags, rsvd,
1567-
nsid, cdw2, cdw3, cdw10, cdw11, cdw12, cdw13, cdw14, cdw15,
1568-
data_len, data, metadata_len, metadata, timeout_ms, result);
1569+
nsid, cdw2, cdw3, cdw10, cdw11, cdw12, cdw13,
1570+
cdw14, cdw15, data_len, data, metadata_len, metadata,
1571+
timeout_ms, result);
15691572
}
15701573

15711574
int nvme_submit_io_passthru(int fd, struct nvme_passthru_cmd *cmd, __u32 *result)
@@ -1574,14 +1577,15 @@ int nvme_submit_io_passthru(int fd, struct nvme_passthru_cmd *cmd, __u32 *result
15741577
}
15751578

15761579
int nvme_io_passthru(int fd, __u8 opcode, __u8 flags, __u16 rsvd,
1577-
__u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11,
1578-
__u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15,
1579-
__u32 data_len, void *data, __u32 metadata_len, void *metadata,
1580-
__u32 timeout_ms, __u32 *result)
1580+
__u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10,
1581+
__u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14,
1582+
__u32 cdw15, __u32 data_len, void *data, __u32 metadata_len,
1583+
void *metadata, __u32 timeout_ms, __u32 *result)
15811584
{
15821585
return nvme_passthru(fd, NVME_IOCTL_IO_CMD, opcode, flags, rsvd, nsid,
1583-
cdw2, cdw3, cdw10, cdw11, cdw12, cdw13, cdw14, cdw15, data_len,
1584-
data, metadata_len, metadata, timeout_ms, result);
1586+
cdw2, cdw3, cdw10, cdw11, cdw12, cdw13, cdw14,
1587+
cdw15, data_len, data, metadata_len, metadata,
1588+
timeout_ms, result);
15851589
}
15861590

15871591
int nvme_io(struct nvme_io_args *args, __u8 opcode)

0 commit comments

Comments
 (0)