Re: [CIFS] Cleanup use of CONFIG_CIFS_STATS2 ifdef to make transport routines more readable

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

 



On Thu, 17 Mar 2011 14:12:23 -0500
Steve French <smfrench@xxxxxxxxx> wrote:

> Christoph had requested that the stats related code (in
> CONFIG_CIFS_STATS2) be moved into helpers to make code flow more
> readable.   This patch should help.   For example the following
> section from transport.c
> 
> 			spin_unlock(&GlobalMid_Lock);
> #ifdef CONFIG_CIFS_STATS2
> 			atomic_inc(&ses->server->num_waiters);
> #endif
> 			wait_event(ses->server->request_q,
> 				   atomic_read(&ses->server->inFlight)
> 				     < cifs_max_pending);
> #ifdef CONFIG_CIFS_STATS2
> 			atomic_dec(&ses->server->num_waiters);
> #endif
> 			spin_lock(&GlobalMid_Lock);
> 
> becomes simpler (with the patch below):
> 			spin_unlock(&GlobalMid_Lock);
> 			cifs_num_waiters_inc(server);
> 			wait_event(server->request_q,
> 				   atomic_read(&server->inFlight)
> 				     < cifs_max_pending);
> 			cifs_num_waiters_dec(server);
> 			spin_lock(&GlobalMid_Lock);
> 
> 
> 

Nice cleanup. Don't forget the SoB line though ;)

Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux