From patchwork Sat Mar 12 00:00:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 629501 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2C00N4I015263 for ; Sat, 12 Mar 2011 00:00:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677Ab1CLAAV (ORCPT ); Fri, 11 Mar 2011 19:00:21 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:65330 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634Ab1CLAAV (ORCPT ); Fri, 11 Mar 2011 19:00:21 -0500 Received: by iyb26 with SMTP id 26so3157619iyb.19 for ; Fri, 11 Mar 2011 16:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=SjcsU+8SNEN3vMxabT3u08O0uhng5G1UAxnueoWXgak=; b=i35w6YH7bNZWFuznSLd98NNgBqzaS79nT5IMzK5eeUPPV5OFKwWpKHjRS33DjHTqm7 DpcoX1tGRKtSzJE8eHBkRF8SDb4HnfM7C0HwniowdnKk+79O9SUteWgDZnoMshFCZ7yo qcEYfl7H44XOJWcVomCnOmT8IdMhc2FY19wy0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=a3C8/owRGhdAIenZMeNUgfQ5Q7AssEgoy4uZ5d5rR5YbvjNAH380EzUo/ueAAbAN36 bN06XDTQxGaeoscY4oIVWEXukcYKScHkcO9PkcjLbzdxXT83001aqlmbnuo3VK0nztBf 0/Na1WVFy6N/t7mabnNXurxMn8I10mBmLwoI8= MIME-Version: 1.0 Received: by 10.42.156.67 with SMTP id y3mr5366028icw.381.1299888020409; Fri, 11 Mar 2011 16:00:20 -0800 (PST) Received: by 10.42.148.195 with HTTP; Fri, 11 Mar 2011 16:00:20 -0800 (PST) Date: Fri, 11 Mar 2011 18:00:20 -0600 Message-ID: Subject: mid structures cifs vs. smb2 From: Steve French To: Jeff Layton , linux-cifs@vger.kernel.org Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 12 Mar 2011 00:00:23 +0000 (UTC) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index d69e1e6..ce378ed 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -591,20 +591,20 @@ typedef void (mid_callback_t)(struct mid_q_entry *mid); /* one of these for every pending CIFS request to the server */ struct mid_q_entry { struct list_head qhead; /* mids waiting on reply from this server */ - __u16 mid; /* multiplex id */ - __u16 pid; /* process id */ __u32 sequence_number; /* for CIFS signing */ + int midState; /* wish this were enum but can not pass to wait_event */ unsigned long when_alloc; /* when mid was created */ #ifdef CONFIG_CIFS_STATS2 unsigned long when_sent; /* time when smb send finished */ unsigned long when_received; /* when demux complete (taken off wire) */ #endif + bool largeBuf:1; /* if valid response, is pointer to large buf */ mid_callback_t *callback; /* call completion callback */ void *callback_data; /* general purpose pointer for callback */ + __u16 mid; /* multiplex id */ + __u8 command; /* smb command code */ + __u16 pid; /* process id */ struct smb_hdr *resp_buf; /* response buffer */ - int midState; /* wish this were enum but can not pass to wait_event */ - __u8 command; /* smb command code */ - bool largeBuf:1; /* if valid response, is pointer to large buf */ bool multiRsp:1; /* multiple trans2 responses for one request */ bool multiEnd:1; /* both received */ }; diff --git a/fs/cifs/smb2glob.h b/fs/cifs/smb2glob.h index 66c01db..909cf39 100644 --- a/fs/cifs/smb2glob.h +++ b/fs/cifs/smb2glob.h @@ -160,29 +160,37 @@ struct page_req { struct mid_q_entry *midq; /* queue structure for demultiplex */ }; +struct smb2_mid_entry; + +typedef void (smb2_mid_callback_t)(struct smb2_mid_entry *mid); + /* one of these for every pending SMB2 request to the server */ struct smb2_mid_entry { struct list_head qhead; /* mids waiting on reply from this server */ - __u64 mid; /* multiplex id(s) */ - __u16 pid; /* process id */ __u32 sequence_number; /* for signing */ /* BB check if needed */ + int mid_state; /* wish this were enum but can not pass to wait_event */ unsigned long when_alloc; /* when mid was created */ #ifdef CONFIG_CIFS_STATS2 unsigned long when_sent; /* time when smb send finished */ unsigned long when_received; /* when demux complete (taken off wire) */ #endif - struct task_struct *tsk; /* task waiting for response */ + bool large_buf:1; /* if valid response, is pointer to large buf */ + smb2_mid_callback_t *callback; + void *callback_data; + __u64 mid; /* multiplex id(s), bigger for smb2 */ + __le16 command; /* smb2 command code */ + pid_t pid; /* process id - bigger for smb2 than cifs */ struct smb2_hdr *resp_buf; /* response buffer */ + + /* Additional fields below needed for handling async smb2 responses + and for asynchronous smb2_writepages support have been temporarily + removed from the port and will be reenabled as that gets merged in */ + +#if 0 /* Fields needed for smb2_writepages, compound ops, async support */ char **pagebuf_list; /* response buffer */ int num_pages; - int mid_state; /* wish this were enum but can not pass to wait_event */ - __le16 command; /* smb command code */ bool async_resp_rcvd:1; /* if server has responded with interim resp */ - bool large_buf:1; /* if valid response, is pointer to large buf */ bool is_kmap_buf:1; -/* bool multi_rsp:1; BB do we have to account for something in SMB2 like - we saw multiple trans2 responses for one request (possible in CIFS) */ - /* Async things */ __u64 *mid_list; /* multiplex id(s) */ int *mid_state_list; short int *large_buf_list; @@ -196,8 +204,7 @@ struct smb2_mid_entry { bool complex_mid:1; /* complex entry - consists of several messages */ int result; unsigned long last_rsp_time; - int (*callback)(struct smb2_mid_entry * , void *); - void *callback_data; +#endif }; This makes the mids looks as follows. For cifs: