From 55084ba194290eb8869bae34c5c35701e49034cb Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 19 May 2013 16:51:52 +0000 Subject: [PATCH] fcst: Minimize diffs of ft_send_read_data() and ft_recv_write_data() with upstream git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4861 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/ft_io.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fcst/ft_io.c b/fcst/ft_io.c index a06184a1c..70eafb883 100644 --- a/fcst/ft_io.c +++ b/fcst/ft_io.c @@ -154,10 +154,10 @@ int ft_send_read_data(struct scst_cmd *cmd) frame_len -= tlen; } - mem_len -= tlen; mem_off += tlen; - remaining -= tlen; + mem_len -= tlen; frame_off += tlen; + remaining -= tlen; if (frame_len) continue; @@ -211,15 +211,11 @@ void ft_recv_write_data(struct scst_cmd *cmd, struct fc_frame *fp) fcmd = scst_cmd_get_tgt_priv(cmd); fh = fc_frame_header_get(fp); - frame_len = fr_len(fp); - rel_off = ntohl(fh->fh_parm_offset); - - FT_IO_DBG("sid %x oxid %x payload_len %zd rel_off %x\n", - ntoh24(fh->fh_s_id), ntohs(fh->fh_ox_id), - frame_len - sizeof(*fh), rel_off); if (!(ntoh24(fh->fh_f_ctl) & FC_FC_REL_OFF)) goto drop; + rel_off = ntohl(fh->fh_parm_offset); + frame_len = fr_len(fp); if (frame_len <= sizeof(*fh)) goto drop; frame_len -= sizeof(*fh);