Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18463
b: refs/heads/master
c: 5685169
h: refs/heads/master
i:
  18461: d986c0b
  18459: 929ce4b
  18455: 3baff1e
  18447: a9c200f
  18431: 6570ea6
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Jan 14, 2006
1 parent 5c97638 commit 98dbadd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 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: 3e97c7e6cda933e3a1b518a8100d155c532a3cfc
refs/heads/master: 56851698c23430f0f291d6e50da344e6b414f3b9
16 changes: 9 additions & 7 deletions trunk/drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1318,15 +1318,15 @@ iscsi_conn_restore_callbacks(struct iscsi_conn *conn)
* to use tcp_sendmsg().
*/
static inline int
iscsi_send(struct socket *sk, struct iscsi_buf *buf, int size, int flags)
iscsi_send(struct iscsi_conn *conn, struct iscsi_buf *buf, int size, int flags)
{
struct socket *sk = conn->sock;
int res;

if ((int)buf->sg.offset >= 0) {
int offset = buf->sg.offset + buf->sent;

/* tcp_sendpage */
res = sk->ops->sendpage(sk, buf->sg.page, offset, size, flags);
res = conn->sendpage(sk, buf->sg.page, offset, size, flags);
} else {
struct msghdr msg;

Expand Down Expand Up @@ -1354,7 +1354,6 @@ iscsi_send(struct socket *sk, struct iscsi_buf *buf, int size, int flags)
static inline int
iscsi_sendhdr(struct iscsi_conn *conn, struct iscsi_buf *buf, int datalen)
{
struct socket *sk = conn->sock;
int flags = 0; /* MSG_DONTWAIT; */
int res, size;

Expand All @@ -1363,7 +1362,7 @@ iscsi_sendhdr(struct iscsi_conn *conn, struct iscsi_buf *buf, int datalen)
if (buf->sent + size != buf->sg.length || datalen)
flags |= MSG_MORE;

res = iscsi_send(sk, buf, size, flags);
res = iscsi_send(conn, buf, size, flags);
debug_tcp("sendhdr %d bytes, sent %d res %d\n", size, buf->sent, res);
if (res >= 0) {
conn->txdata_octets += res;
Expand Down Expand Up @@ -1394,7 +1393,6 @@ static inline int
iscsi_sendpage(struct iscsi_conn *conn, struct iscsi_buf *buf,
int *count, int *sent)
{
struct socket *sk = conn->sock;
int flags = 0; /* MSG_DONTWAIT; */
int res, size;

Expand All @@ -1405,7 +1403,7 @@ iscsi_sendpage(struct iscsi_conn *conn, struct iscsi_buf *buf,
if (buf->sent + size != buf->sg.length || *count != size)
flags |= MSG_MORE;

res = iscsi_send(sk, buf, size, flags);
res = iscsi_send(conn, buf, size, flags);
debug_tcp("sendpage: %d bytes, sent %d left %d sent %d res %d\n",
size, buf->sent, *count, *sent, res);
if (res >= 0) {
Expand Down Expand Up @@ -2713,6 +2711,8 @@ iscsi_conn_bind(iscsi_sessionh_t sessionh, iscsi_connh_t connh,
*/
iscsi_conn_set_callbacks(conn);

conn->sendpage = conn->sock->ops->sendpage;

/*
* set receive state machine into initial state
*/
Expand Down Expand Up @@ -3467,6 +3467,8 @@ iscsi_conn_set_param(iscsi_connh_t connh, enum iscsi_param param,
if (conn->data_rx_tfm)
crypto_free_tfm(conn->data_rx_tfm);
}
conn->sendpage = conn->datadgst_en ?
sock_no_sendpage : conn->sock->ops->sendpage;
break;
case ISCSI_PARAM_INITIAL_R2T_EN:
session->initial_r2t_en = value;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/scsi/iscsi_tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ struct iscsi_conn {
uint32_t sendpage_failures_cnt;
uint32_t discontiguous_hdr_cnt;
uint32_t eh_abort_cnt;

ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int);
};

struct iscsi_session {
Expand Down

0 comments on commit 98dbadd

Please sign in to comment.