[RFC 1/2] nvme: add whitelisting infrastructure

Keith Busch kbusch at kernel.org
Mon Sep 26 09:16:36 PDT 2022


On Sun, Sep 18, 2022 at 06:19:17PM +0200, Joel Granados wrote:
> On Fri, Sep 09, 2022 at 10:03:06PM +0530, Kanchan Joshi wrote:
> >  
> > +bool nvme_io_cmd_allowed(u8 opcode, fmode_t mode)
> > +{
> > +	/* allow write/read based on what was allowed for open */
> > +	/* TBD: try to use nvme_is_write() here */
> > +	if (opcode & 1)
> I know that this is an RFC, but this would eventually be nvme_cmd_write
> instead of 1.
> right?

'1' is the data direction bit of the opcdoe, and nvme_cmd_write is just an
opcode that happens to also be '1'.



More information about the Linux-nvme mailing list