Re: [PATCH] [CIFS] Add structure definitions for SMB2 PDUs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 11, 2011 at 1:59 PM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> On Fri, 25 Feb 2011 23:25:08 -0600
> Steve French <smfrench@xxxxxxxxx> wrote:
>  +
>> +/* 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 */
>> +     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 */
>> +     struct smb2_hdr *resp_buf;      /* response buffer */
>> +     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;
>> +     unsigned int num_mid;
>> +     unsigned int act_num_mid;
>> +     unsigned int num_received;
>> +     unsigned int cur_id;
>> +     struct smb2_hdr **resp_buf_list;        /* response buffer */
>> +     __le16 *command_list;
>> +     bool async:1;
>> +     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;
>> +};
>> +
>>
>
> Holy cow, this thing is a porker.
>
> Can we eliminate some of these fields? For instance, you have a
> callback and callback_data field like in the cifs variant, but you also
> have a tsk pointer. That should no longer be needed. There also seem to
> be a lot of fields that are not used in any of the code that has yet
> been merged.

I would prefer not to convert Pavel's smb2_writepages code from
the old smb2.git tree to this (in cifs.ko instead of smb2.ko) yet.
There are other pieces of the code conversion that need to
be posted first before we get to Pavel's writepages work (e.g. the
conversion of the transport workers, and as I mentioned in the earlier email
the restructuring of cifs_demultiplex to be able to call out to
smb2 handlers).

It sounds riskier to take the smb2 mid fields out (they were
tested, working and mostly reviewed last summer and had been
in tree in the old implementation for a while).   During this part
of the conversion, I want to focus on the things which
changed by moving to this one module approach - the additional sharing
between cifs and smb2 which you had suggested (mostly
around the three, now common, structures - for socket, ses and tcon).
The allocate mid code as a result had to change.


-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux