Re: [RFC 1/2] nvme: add whitelisting infrastructure

Keith Busch
2022-09-26T16:16:51Z

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'.