Skip to contentSkip to conversation

Get NFTLrecord reference from mtd_blktrans_dev argument

DISCUSSION Niraj Kulkarni 1 participant 1 message May 2, 2011 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi all,
I've observed that in kernel 2.6.38 (and maybe in previous
versions), in mtd_blktrans_ops callbacks provided by NFTL (nftlcore.c), reference to NFTLrecord struct is obtained by just typecasting given mtd_blktrans_dev. Though it works well, it highly position dependent method and may break for mtd_blktrans_dev struct change. Given that blktrans_dev struct already have a private field (void *priv) and it is uninitialized in nftl, is it ok to write a trivial patch to assign NFTLrecord pointer to mtd_blktrans_dev->priv?

Niraj