Re: [PATCH] wait_for_free_request needs to wait on credits returned by server for SMB2

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

 



On Thu, Mar 17, 2011 at 9:36 AM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>>  #ifdef CONFIG_CIFS_STATS2
>>                       atomic_inc(&server->num_waiters);
>> @@ -283,6 +284,20 @@ static int wait_for_free_request(struct
>> TCP_Server_Info *server,
>>                       atomic_dec(&server->num_waiters);
>>  #endif
>>                       spin_lock(&GlobalMid_Lock);
>> +#ifdef CONFIG_CIFS_SMB2
>> +             } else if (server->is_smb2 &&
>> +                       (atomic_read(&server->credits) < 1)) {
>> +                     spin_unlock(&GlobalMid_Lock);
>> +#ifdef CONFIG_CIFS_STATS2
>> +                     atomic_inc(&server->num_waiters);
>> +#endif
>> +                     wait_event(server->request_q,
>> +                                atomic_read(&server->credits) > 0);
>> +#ifdef CONFIG_CIFS_STATS2
>> +                     atomic_dec(&server->num_waiters);
>> +#endif
>> +                     spin_lock(&GlobalMid_Lock);
>> +#endif /* CONFIG_CIFS_SMB2 */
>
> This ifdef mania is madness.  Please make sure to hide the stats
> and smb2 code in properly abstracted helpers that get compiled out if
> not actually used.

I don't mind that change, and I agree it would make it more readable.
The stats ifdef
was used as cifs uses it to keep consistency initially.


-- 
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