FreeBSD kernel CAM code
cam_iosched.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CAM_IOSCHED_TIME_SHIFT   8
 

Typedefs

typedef void(* cam_iosched_latfcn_t) (void *, sbintime_t, struct bio *)
 

Functions

static uintptr_t cam_iosched_now (void)
 
static uintptr_t cam_iosched_delta_t (uintptr_t then)
 
static sbintime_t cam_iosched_sbintime_t (uintptr_t delta)
 
int cam_iosched_init (struct cam_iosched_softc **, struct cam_periph *periph)
 
void cam_iosched_fini (struct cam_iosched_softc *)
 
void cam_iosched_sysctl_init (struct cam_iosched_softc *, struct sysctl_ctx_list *, struct sysctl_oid *)
 
struct bio * cam_iosched_next_trim (struct cam_iosched_softc *isc)
 
struct bio * cam_iosched_get_trim (struct cam_iosched_softc *isc)
 
struct bio * cam_iosched_next_bio (struct cam_iosched_softc *isc)
 
void cam_iosched_queue_work (struct cam_iosched_softc *isc, struct bio *bp)
 
void cam_iosched_flush (struct cam_iosched_softc *isc, struct devstat *stp, int err)
 
void cam_iosched_schedule (struct cam_iosched_softc *isc, struct cam_periph *periph)
 
void cam_iosched_finish_trim (struct cam_iosched_softc *isc)
 
void cam_iosched_submit_trim (struct cam_iosched_softc *isc)
 
void cam_iosched_put_back_trim (struct cam_iosched_softc *isc, struct bio *bp)
 
void cam_iosched_set_sort_queue (struct cam_iosched_softc *isc, int val)
 
int cam_iosched_has_work_flags (struct cam_iosched_softc *isc, uint32_t flags)
 
void cam_iosched_set_work_flags (struct cam_iosched_softc *isc, uint32_t flags)
 
void cam_iosched_clr_work_flags (struct cam_iosched_softc *isc, uint32_t flags)
 
void cam_iosched_trim_done (struct cam_iosched_softc *isc)
 
int cam_iosched_bio_complete (struct cam_iosched_softc *isc, struct bio *bp, union ccb *done_ccb)
 
void cam_iosched_set_latfcn (struct cam_iosched_softc *isc, cam_iosched_latfcn_t, void *)
 
void cam_iosched_set_trim_goal (struct cam_iosched_softc *isc, int goal)
 
void cam_iosched_set_trim_ticks (struct cam_iosched_softc *isc, int ticks)
 

Macro Definition Documentation

◆ CAM_IOSCHED_TIME_SHIFT

#define CAM_IOSCHED_TIME_SHIFT   8

Definition at line 57 of file cam_iosched.h.

Typedef Documentation

◆ cam_iosched_latfcn_t

typedef void(* cam_iosched_latfcn_t) (void *, sbintime_t, struct bio *)

Definition at line 83 of file cam_iosched.h.

Function Documentation

◆ cam_iosched_bio_complete()

int cam_iosched_bio_complete ( struct cam_iosched_softc isc,
struct bio *  bp,
union ccb done_ccb 
)

Definition at line 1693 of file cam_iosched.c.

References cam_iosched_sbintime_t(), CAM_QOS_VALID, ccb::ccb_h, iosched_debug, ccb_qos_area::periph_data, ccb_hdr::qos, and ccb_hdr::status.

Referenced by adadone(), dadone(), and ndadone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_iosched_clr_work_flags()

void cam_iosched_clr_work_flags ( struct cam_iosched_softc isc,
uint32_t  flags 
)

Definition at line 1780 of file cam_iosched.c.

References cam_iosched_softc::flags.

Referenced by dastart().

Here is the caller graph for this function:

◆ cam_iosched_delta_t()

static uintptr_t cam_iosched_delta_t ( uintptr_t  then)
inlinestatic

Definition at line 68 of file cam_iosched.h.

References cam_iosched_now().

Referenced by xpt_done(), and xpt_done_direct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_iosched_fini()

void cam_iosched_fini ( struct cam_iosched_softc isc)

Definition at line 1176 of file cam_iosched.c.

References CAM_IOSCHED_FLAG_CALLOUT_ACTIVE, cam_iosched_flush(), and cam_iosched_softc::flags.

Referenced by adacleanup(), dacleanup(), and ndacleanup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_iosched_finish_trim()

void cam_iosched_finish_trim ( struct cam_iosched_softc isc)

◆ cam_iosched_flush()

void cam_iosched_flush ( struct cam_iosched_softc isc,
struct devstat *  stp,
int  err 
)

Definition at line 1313 of file cam_iosched.c.

References cam_iosched_softc::bio_queue, and cam_iosched_softc::trim_queue.

Referenced by adaoninvalidate(), cam_iosched_fini(), dadone(), daoninvalidate(), and ndaoninvalidate().

Here is the caller graph for this function:

◆ cam_iosched_get_trim()

struct bio * cam_iosched_get_trim ( struct cam_iosched_softc isc)

Definition at line 1440 of file cam_iosched.c.

References cam_iosched_softc::bio_queue, cam_iosched_has_more_trim(), cam_iosched_next_trim(), iosched_debug, and cam_iosched_softc::trim_queue.

Referenced by cam_iosched_next_bio().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_iosched_has_work_flags()

int cam_iosched_has_work_flags ( struct cam_iosched_softc isc,
uint32_t  flags 
)

Definition at line 1768 of file cam_iosched.c.

References cam_iosched_softc::flags.

Referenced by daasync(), damediapoll(), and dastart().

Here is the caller graph for this function:

◆ cam_iosched_init()

int cam_iosched_init ( struct cam_iosched_softc **  iscp,
struct cam_periph periph 
)

Definition at line 1136 of file cam_iosched.c.

References CAM_IOSCHED_FLAG_CALLOUT_ACTIVE, cam_periph_mtx(), and iosched_debug.

Referenced by adaregister(), daregister(), and ndaregister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_iosched_next_bio()

struct bio * cam_iosched_next_bio ( struct cam_iosched_softc isc)

Definition at line 1505 of file cam_iosched.c.

References cam_iosched_softc::bio_queue, cam_iosched_get_trim(), and iosched_debug.

Referenced by adastart(), dastart(), and ndastart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_iosched_next_trim()

struct bio * cam_iosched_next_trim ( struct cam_iosched_softc isc)

◆ cam_iosched_now()

static uintptr_t cam_iosched_now ( void  )
inlinestatic

Definition at line 60 of file cam_iosched.h.

References CAM_IOSCHED_TIME_SHIFT.

Referenced by cam_iosched_delta_t(), and xpt_run_devq().

Here is the caller graph for this function:

◆ cam_iosched_put_back_trim()

void cam_iosched_put_back_trim ( struct cam_iosched_softc isc,
struct bio *  bp 
)

Definition at line 1393 of file cam_iosched.c.

References cam_iosched_softc::last_trim_tick, cam_iosched_softc::queued_trims, and cam_iosched_softc::trim_queue.

Referenced by ada_dsmtrim_req_create(), da_delete_trim(), da_delete_unmap(), and da_delete_ws().

Here is the caller graph for this function:

◆ cam_iosched_queue_work()

void cam_iosched_queue_work ( struct cam_iosched_softc isc,
struct bio *  bp 
)

◆ cam_iosched_sbintime_t()

static sbintime_t cam_iosched_sbintime_t ( uintptr_t  delta)
inlinestatic

Definition at line 76 of file cam_iosched.h.

References CAM_IOSCHED_TIME_SHIFT.

Referenced by cam_iosched_bio_complete().

Here is the caller graph for this function:

◆ cam_iosched_schedule()

void cam_iosched_schedule ( struct cam_iosched_softc isc,
struct cam_periph periph 
)

Definition at line 1671 of file cam_iosched.c.

References cam_iosched_has_work(), CAM_PRIORITY_NORMAL, and xpt_schedule().

Referenced by adaschedule(), daschedule(), and ndaschedule().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cam_iosched_set_latfcn()

void cam_iosched_set_latfcn ( struct cam_iosched_softc isc,
cam_iosched_latfcn_t  fnp,
void *  argp 
)

Definition at line 1263 of file cam_iosched.c.

◆ cam_iosched_set_sort_queue()

void cam_iosched_set_sort_queue ( struct cam_iosched_softc isc,
int  val 
)

Definition at line 1761 of file cam_iosched.c.

References cam_iosched_softc::sort_io_queue.

Referenced by adaregister(), dadone_probeata(), dadone_probebdc(), and ndaregister().

Here is the caller graph for this function:

◆ cam_iosched_set_trim_goal()

void cam_iosched_set_trim_goal ( struct cam_iosched_softc isc,
int  goal 
)

Definition at line 1294 of file cam_iosched.c.

References cam_iosched_softc::trim_goal.

◆ cam_iosched_set_trim_ticks()

void cam_iosched_set_trim_ticks ( struct cam_iosched_softc isc,
int  ticks 
)

Definition at line 1301 of file cam_iosched.c.

References cam_iosched_softc::trim_ticks.

◆ cam_iosched_set_work_flags()

void cam_iosched_set_work_flags ( struct cam_iosched_softc isc,
uint32_t  flags 
)

Definition at line 1774 of file cam_iosched.c.

References cam_iosched_softc::flags.

Referenced by daasync(), and damediapoll().

Here is the caller graph for this function:

◆ cam_iosched_submit_trim()

void cam_iosched_submit_trim ( struct cam_iosched_softc isc)

Definition at line 1751 of file cam_iosched.c.

References CAM_IOSCHED_FLAG_TRIM_ACTIVE, and cam_iosched_softc::flags.

Referenced by adastart(), da_delete_trim(), and da_delete_unmap().

Here is the caller graph for this function:

◆ cam_iosched_sysctl_init()

void cam_iosched_sysctl_init ( struct cam_iosched_softc isc,
struct sysctl_ctx_list *  ctx,
struct sysctl_oid *  node 
)

Definition at line 1201 of file cam_iosched.c.

References cam_iosched_softc::sort_io_queue, and cam_iosched_softc::trim_goal.

Referenced by adasysctlinit(), dasysctlinit(), and ndasysctlinit().

Here is the caller graph for this function:

◆ cam_iosched_trim_done()

void cam_iosched_trim_done ( struct cam_iosched_softc isc)

Definition at line 1682 of file cam_iosched.c.

References cam_iosched_softc::flags.

Referenced by adadone(), and dadone().

Here is the caller graph for this function: