On Thu, Aug 15, 2019 at 12:36:32AM +0100, Al Viro wrote: > On Wed, Aug 14, 2019 at 02:18:28PM +0200, Sascha Hauer wrote: > > +/** > > + * reference_super - get a reference to a given superblock > > + * @sb: superblock to get the reference from > > + * > > + * Takes a reference to a superblock. Can be used as when the superblock > > + * is known and leaves it in a state as if get_super had been called. > > + */ > > +void reference_super(struct super_block *sb) > > +{ > > + spin_lock(&sb_lock); > > + sb->s_count++; > > + spin_unlock(&sb_lock); > > + > > + down_read(&sb->s_umount); > > +} > > +EXPORT_SYMBOL_GPL(reference_super); > > NAK, for a plenty of reasons > > 1) introduction of EXPORT_SYMBOL_GPL garbage > 2) aforementioned garbage on something that doesn't need to be exported > 3) *way* too easily abused - get_super() is, at least, not tempting to > play with in random code. This one is, and it's too low-level to > allow. ... and this is a crap userland API. *IF* you want mountpoint-based variants of quotactl() commands, by all means, add those. Do not overload the old ones. And for path-based you don't need to mess with superblock references - just keep the struct path until the end. That will keep the superblock alive and active just fine. ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/