[Open-FCoE] [RFC PATCH 05/16] libfc: use dummy rport and work for gpn_id and gnn_id

Robert Love robert.w.love at intel.com
Tue Sep 9 22:10:16 UTC 2008


On Tue, 2008-09-09 at 14:45 -0700, Joe Eykholt wrote:
> Robert Love wrote:
> > This patch does three things:
> > 
> > 1) Creates dummy fc_rport and fc_rport_libfc_priv objects
> >    to use durring gpn_id and gnn_id instead of fc_ns_port
> >    objects. This will be used in a later patch that will
> >    move gpn_id and gnn_id into the RP state machine. The
> >    RP state machine passes around fc_rport's not
> >    fc_ns_port's.
> > 
> > 2) Uses stack memory to allocate the temporary fc_ns_port
> >    for each discovered port. There's no need to dynamically
> >    allocate memory if it's just going to be freed in the
> >    same block.
> > 
> > Signed-off-by: Robert Love <robert.w.love at intel.com>
> > ---
> 
> > @@ -71,6 +59,32 @@ static void fc_ns_retry(struct fc_lport *lp);
> >  static void fc_ns_single(struct fc_lport *, struct fc_ns_port *);
> >  static int fc_ns_restart(struct fc_lport *);
> >  
> > +struct fc_rport *fc_ns_create_dummy_rport(struct fc_ns_port *dp)
> > +{
> > +	struct fc_rport *rp;
> > +	struct fc_rport_libfc_priv *rpp;
> > +	rp = kzalloc(sizeof(*rp) + sizeof(*rpp), GFP_KERNEL);
> 
> Should check for NULL here.

Thanks Joe. I made the change in my local patch-set so it'll be there in
my next posting.




More information about the devel mailing list