Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264668
b: refs/heads/master
c: 2dbc43d
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Nicholas Bellinger committed Oct 24, 2011
1 parent 6dffc2d commit 39c8aae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31afc39c0c93edec5a117371f1bd2a264cceafac
refs/heads/master: 2dbc43d256c5371ebc294e3534620663eb80a5ce
25 changes: 11 additions & 14 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,19 +1640,6 @@ static int transport_check_alloc_task_attr(struct se_cmd *cmd)
return 0;
}

void transport_free_se_cmd(
struct se_cmd *se_cmd)
{
if (se_cmd->se_tmr_req)
core_tmr_release_req(se_cmd->se_tmr_req);
/*
* Check and free any extended CDB buffer that was allocated
*/
if (se_cmd->t_task_cdb != se_cmd->__t_task_cdb)
kfree(se_cmd->t_task_cdb);
}
EXPORT_SYMBOL(transport_free_se_cmd);

static void transport_generic_wait_for_tasks(struct se_cmd *, int, int);

/* transport_generic_allocate_tasks():
Expand Down Expand Up @@ -4371,11 +4358,21 @@ static int transport_generic_write_pending(struct se_cmd *cmd)
return ret;
}

/**
* transport_release_cmd - free a command
* @cmd: command to free
*
* This routine unconditionally frees a command, and reference counting
* or list removal must be done in the caller.
*/
void transport_release_cmd(struct se_cmd *cmd)
{
BUG_ON(!cmd->se_tfo);

transport_free_se_cmd(cmd);
if (cmd->se_tmr_req)
core_tmr_release_req(cmd->se_tmr_req);
if (cmd->t_task_cdb != cmd->__t_task_cdb)
kfree(cmd->t_task_cdb);
cmd->se_tfo->release_cmd(cmd);
}
EXPORT_SYMBOL(transport_release_cmd);
Expand Down
1 change: 0 additions & 1 deletion trunk/include/target/target_core_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ extern void transport_init_se_cmd(struct se_cmd *,
unsigned char *);
void *transport_kmap_first_data_page(struct se_cmd *cmd);
void transport_kunmap_first_data_page(struct se_cmd *cmd);
extern void transport_free_se_cmd(struct se_cmd *);
extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
extern int transport_handle_cdb_direct(struct se_cmd *);
extern int transport_generic_handle_cdb_map(struct se_cmd *);
Expand Down

0 comments on commit 39c8aae

Please sign in to comment.