Re: [PATCH v4 28/28] tools/testing/cxl: Add DC Regions to mock mem data

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

 



Jonathan Cameron wrote:
> On Mon, 07 Oct 2024 18:16:34 -0500
> Ira Weiny <ira.weiny@xxxxxxxxx> wrote:
> 

[snip]

> > 
> > Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
> 
> Superficial review only.
> 
> Looks fine to me but I've been reviewing too long today to be at all sure
> I'd spot if it was wrong in a subtle way.  So no tag for now.

Thanks.

> 
> > +static void dc_delete_extent(struct device *dev, unsigned long long start,
> > +			     unsigned long long length)
> > +{
> > +	struct cxl_mockmem_data *mdata = dev_get_drvdata(dev);
> > +	unsigned long long end = start + length;
> > +	struct cxl_extent_data *ext;
> > +	unsigned long index;
> > +
> > +	dev_dbg(dev, "Deleting extent at %#llx len:%#llx\n", start, length);
> > +
> > +	guard(mutex)(&mdata->ext_lock);
> > +	xa_for_each(&mdata->dc_extents, index, ext) {
> > +		u64 extent_end = ext->dpa_start + ext->length;
> > +
> > +		/*
> > +		 * Any extent which 'touches' the released delete range will be
> > +		 * removed.
> > +		 */
> > +		if ((start <= ext->dpa_start && ext->dpa_start < end) ||
> > +		    (start <= extent_end && extent_end < end)) {
> Really trivial but no {} for single line statement

Sure. done.

> 
> > +			xa_erase(&mdata->dc_extents, ext->dpa_start);
> > +		}
> > +	}
> > +
> > +	/*
> > +	 * If the extent was accepted let it be for the host to drop
> > +	 * later.
> > +	 */
> > +}
> 
> > @@ -1703,14 +2146,261 @@ static ssize_t sanitize_timeout_store(struct device *dev,
> >  
> >  	return count;
> >  }
> > -
> Noise.

Fixed.

Ira




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux