123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
-
-
-
-
-
-
-
-
-
- struct job_progress {
-
-
- unsigned long completed
-
-
- unsigned long total
- }
-
- struct job_interface;
-
-
- struct job_interface_operations {
-
-
- void ( * done ) ( struct job_interface *job, int rc )
-
-
- void ( * kill ) ( struct job_interface *job )
-
-
- void ( * progress ) ( struct job_interface *job,
- struct job_progress *progress )
- }
-
-
- struct job_interface {
-
- struct interface intf
-
- struct job_interface_operations *op
- }
-
- extern struct job_interface null_job
- extern struct job_interface_operations null_job_ops
-
- extern void job_done ( struct job_interface *job, int rc )
-
- extern void ignore_job_done ( struct job_interface *job, int rc )
- extern void ignore_job_kill ( struct job_interface *job )
- extern void ignore_job_progress ( struct job_interface *job,
- struct job_progress *progress )
-
-
- static inline void job_init ( struct job_interface *job,
- struct job_interface_operations *op,
- struct refcnt *refcnt ) {
- job->intf.dest = &null_job.intf
- job->intf.refcnt = refcnt
- job->op = op
- }
-
-
- static inline __attribute__ (( always_inline )) struct job_interface *
- intf_to_job ( struct interface *intf ) {
- return container_of ( intf, struct job_interface, intf )
- }
-
-
- static inline __attribute__ (( always_inline )) struct job_interface *
- job_get_dest ( struct job_interface *job ) {
- return intf_to_job ( intf_get ( job->intf.dest ) )
- }
-
-
- static inline __attribute__ (( always_inline )) void
- job_put ( struct job_interface *job ) {
- intf_put ( &job->intf )
- }
-
-
- static inline void job_plug ( struct job_interface *job,
- struct job_interface *dest ) {
- plug ( &job->intf, &dest->intf )
- }
-
-
- static inline void job_plug_plug ( struct job_interface *a,
- struct job_interface *b ) {
- plug_plug ( &a->intf, &b->intf )
- }
-
-
- static inline void job_unplug ( struct job_interface *job ) {
- plug ( &job->intf, &null_job.intf )
- }
-
-
- static inline void job_nullify ( struct job_interface *job ) {
- job->op = &null_job_ops
- }
-
|