Message ID | 20170125233646.2243-12-bart.vanassche@sandisk.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On 01/26/2017 12:36 AM, Bart Van Assche wrote: > transport_wait_for_tasks() not only waits for command completion > but also sets CMD_T_STOP. Additionally, this function is not only > called by frontend drivers but also by the target core. Update > the transport_wait_for_tasks() documentation to reflect this. > > Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> > Cc: Christoph Hellwig <hch@lst.de> > Cc: Andy Grover <agrover@redhat.com> > Cc: David Disseldorp <ddiss@suse.de> > --- > drivers/target/target_core_transport.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c > index 9b1dced4534a..6c451ea4f429 100644 > --- a/drivers/target/target_core_transport.c > +++ b/drivers/target/target_core_transport.c > @@ -2756,11 +2756,12 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, > } > > /** > - * transport_wait_for_tasks - wait for completion to occur > - * @cmd: command to wait > + * transport_wait_for_tasks - set CMD_T_STOP and wait for t_transport_stop_comp > + * @cmd: command to wait on > * > - * Called from frontend fabric context to wait for storage engine > - * to pause and/or release frontend generated struct se_cmd. > + * Returns immediately if CMD_T_ACTIVE has not been set. If CMD_T_ACTIVE has > + * been set, sets the CMD_T_STOP flag, waits for t_transport_stop_comp and > + * clears CMD_T_STOP and CMD_T_ACTIVE. > */ > bool transport_wait_for_tasks(struct se_cmd *cmd) > { > Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 9b1dced4534a..6c451ea4f429 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2756,11 +2756,12 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, } /** - * transport_wait_for_tasks - wait for completion to occur - * @cmd: command to wait + * transport_wait_for_tasks - set CMD_T_STOP and wait for t_transport_stop_comp + * @cmd: command to wait on * - * Called from frontend fabric context to wait for storage engine - * to pause and/or release frontend generated struct se_cmd. + * Returns immediately if CMD_T_ACTIVE has not been set. If CMD_T_ACTIVE has + * been set, sets the CMD_T_STOP flag, waits for t_transport_stop_comp and + * clears CMD_T_STOP and CMD_T_ACTIVE. */ bool transport_wait_for_tasks(struct se_cmd *cmd) {
transport_wait_for_tasks() not only waits for command completion but also sets CMD_T_STOP. Additionally, this function is not only called by frontend drivers but also by the target core. Update the transport_wait_for_tasks() documentation to reflect this. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Andy Grover <agrover@redhat.com> Cc: David Disseldorp <ddiss@suse.de> --- drivers/target/target_core_transport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)