Message ID | 20250312085424.1201148-7-sughosh.ganu@linaro.org |
---|---|
State | New |
Headers | show |
Series | Add pmem node for preserving distro ISO's | expand |
On 12.03.25 09:54, Sughosh Ganu wrote: > Add information about the type of blkmap slice as an attribute in the %s/blkmap slice/blkmap slices/ > corresponding slice structure. Put information in the blkmap slice > structure to identify if it is associated with a memory or linear > mapped device. Which can then be used to take specific action based on > the type of the blkmap slice. > > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> > Reviewed-by: Tobias Waldekranz <tobias@waldekranz.com> > Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> > --- > Changes since V7: None > > drivers/block/blkmap.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/block/blkmap.c b/drivers/block/blkmap.c > index 34eed1380dc..453510cca62 100644 > --- a/drivers/block/blkmap.c > +++ b/drivers/block/blkmap.c > @@ -16,6 +16,10 @@ > > struct blkmap; > > +/* Attributes of blkmap slice */ Please, provide a description of the constants in Sphinx style explaining what linear and and memory slices are. Cf. https://docs.kernel.org/doc-guide/kernel-doc.html#object-like-macro-documentation Best regards Heinrich > +#define BLKMAP_SLICE_LINEAR BIT(0) > +#define BLKMAP_SLICE_MEM BIT(1) > + > /** > * struct blkmap_slice - Region mapped to a blkmap > * > @@ -25,12 +29,14 @@ struct blkmap; > * @node: List node used to associate this slice with a blkmap > * @blknr: Start block number of the mapping > * @blkcnt: Number of blocks covered by this mapping > + * @attr: Attributes of blkmap slice > */ > struct blkmap_slice { > struct list_head node; > > lbaint_t blknr; > lbaint_t blkcnt; > + uint attr; > > /** > * @read: - Read from slice > @@ -169,6 +175,7 @@ int blkmap_map_linear(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, > .slice = { > .blknr = blknr, > .blkcnt = blkcnt, > + .attr = BLKMAP_SLICE_LINEAR, > > .read = blkmap_linear_read, > .write = blkmap_linear_write, > @@ -248,6 +255,7 @@ int __blkmap_map_mem(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, > .slice = { > .blknr = blknr, > .blkcnt = blkcnt, > + .attr = BLKMAP_SLICE_MEM, > > .read = blkmap_mem_read, > .write = blkmap_mem_write,
On Thu, 13 Mar 2025 at 02:27, Heinrich Schuchardt <heinrich.schuchardt@canonical.com> wrote: > > On 12.03.25 09:54, Sughosh Ganu wrote: > > Add information about the type of blkmap slice as an attribute in the > > %s/blkmap slice/blkmap slices/ Will change > > > corresponding slice structure. Put information in the blkmap slice > > structure to identify if it is associated with a memory or linear > > mapped device. Which can then be used to take specific action based on > > the type of the blkmap slice. > > > > Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> > > Reviewed-by: Tobias Waldekranz <tobias@waldekranz.com> > > Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> > > --- > > Changes since V7: None > > > > drivers/block/blkmap.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/block/blkmap.c b/drivers/block/blkmap.c > > index 34eed1380dc..453510cca62 100644 > > --- a/drivers/block/blkmap.c > > +++ b/drivers/block/blkmap.c > > @@ -16,6 +16,10 @@ > > > > struct blkmap; > > > > +/* Attributes of blkmap slice */ > > Please, provide a description of the constants in Sphinx style > explaining what linear and and memory slices are. Okay -sughosh > > Cf. > https://docs.kernel.org/doc-guide/kernel-doc.html#object-like-macro-documentation > > Best regards > > Heinrich > > > +#define BLKMAP_SLICE_LINEAR BIT(0) > > +#define BLKMAP_SLICE_MEM BIT(1) > > + > > /** > > * struct blkmap_slice - Region mapped to a blkmap > > * > > @@ -25,12 +29,14 @@ struct blkmap; > > * @node: List node used to associate this slice with a blkmap > > * @blknr: Start block number of the mapping > > * @blkcnt: Number of blocks covered by this mapping > > + * @attr: Attributes of blkmap slice > > */ > > struct blkmap_slice { > > struct list_head node; > > > > lbaint_t blknr; > > lbaint_t blkcnt; > > + uint attr; > > > > /** > > * @read: - Read from slice > > @@ -169,6 +175,7 @@ int blkmap_map_linear(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, > > .slice = { > > .blknr = blknr, > > .blkcnt = blkcnt, > > + .attr = BLKMAP_SLICE_LINEAR, > > > > .read = blkmap_linear_read, > > .write = blkmap_linear_write, > > @@ -248,6 +255,7 @@ int __blkmap_map_mem(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, > > .slice = { > > .blknr = blknr, > > .blkcnt = blkcnt, > > + .attr = BLKMAP_SLICE_MEM, > > > > .read = blkmap_mem_read, > > .write = blkmap_mem_write, >
diff --git a/drivers/block/blkmap.c b/drivers/block/blkmap.c index 34eed1380dc..453510cca62 100644 --- a/drivers/block/blkmap.c +++ b/drivers/block/blkmap.c @@ -16,6 +16,10 @@ struct blkmap; +/* Attributes of blkmap slice */ +#define BLKMAP_SLICE_LINEAR BIT(0) +#define BLKMAP_SLICE_MEM BIT(1) + /** * struct blkmap_slice - Region mapped to a blkmap * @@ -25,12 +29,14 @@ struct blkmap; * @node: List node used to associate this slice with a blkmap * @blknr: Start block number of the mapping * @blkcnt: Number of blocks covered by this mapping + * @attr: Attributes of blkmap slice */ struct blkmap_slice { struct list_head node; lbaint_t blknr; lbaint_t blkcnt; + uint attr; /** * @read: - Read from slice @@ -169,6 +175,7 @@ int blkmap_map_linear(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, .slice = { .blknr = blknr, .blkcnt = blkcnt, + .attr = BLKMAP_SLICE_LINEAR, .read = blkmap_linear_read, .write = blkmap_linear_write, @@ -248,6 +255,7 @@ int __blkmap_map_mem(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, .slice = { .blknr = blknr, .blkcnt = blkcnt, + .attr = BLKMAP_SLICE_MEM, .read = blkmap_mem_read, .write = blkmap_mem_write,