[linux-cifs-client] [PATCH 2/6] cifs: move allocation of new TCP_Server_Info into separate function

Jeff Layton jlayton at redhat.com
Sun Nov 30 16:52:20 GMT 2008


On Sun, 30 Nov 2008 11:46:22 -0500
Christoph Hellwig <hch at infradead.org> wrote:

> On Sun, Nov 30, 2008 at 08:57:21AM -0500, Jeff Layton wrote:
> > +	struct TCP_Server_Info *srvTcp;
> 
> No studdly caps, please.  Just call this info or srv_info.
> 

Good point. I'm not a fan of camelcase either. I mainly did it this way since
it made it easier to cut and paste the code into the new function.

> > +	if (addr->sa_family == AF_INET6) {
> > +		cFYI(1, ("attempting ipv6 connect"));
> > +		/* BB should we allow ipv6 on port 139? */
> > +		/* other OS never observed in Wild doing 139 with v6 */
> > +		memcpy(&srvTcp->addr.sockAddr6, sin_server6,
> > +			sizeof(struct sockaddr_in6));
> > +		sin_server6->sin6_port = htons(volume_info->port);
> > +		rc = ipv6_connect(sin_server6, &srvTcp->ssocket,
> > +				volume_info->noblocksnd);
> > +	} else {
> > +		memcpy(&srvTcp->addr.sockAddr, sin_server,
> > +			sizeof(struct sockaddr_in));
> > +		sin_server->sin_port = htons(volume_info->port);
> > +		rc = ipv4_connect(sin_server, &srvTcp->ssocket,
> > +			  volume_info->source_rfc1001_name,
> > +			  volume_info->target_rfc1001_name,
> > +			  volume_info->noblocksnd,
> > +			  volume_info->noautotune);
> > +	}
> 
> Any reason the declaration of sin_server and sin_Server6 aren't inside
> these blocks?

I was thinking the same thing today after I sent this. I'll look and
see if I can move that out of cifs_mount as well.

Thanks,
-- 
Jeff Layton <jlayton at redhat.com>


More information about the linux-cifs-client mailing list