lightnvm: centralize permission check for lightnvm ioctl
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 29 Mar 2018 22:05:07 +0000 (00:05 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Mar 2018 23:29:09 +0000 (17:29 -0600)
commit40f962d78a969e3b476451ebc82deffdee4309c2
tree15a5c44e22829a2d4f298c22a8772c20a6f430a4
parenta38c78d82dd38ce178c994a777751fae61ae31c8
lightnvm: centralize permission check for lightnvm ioctl

Currently all functions for handling the lightnvm core ioctl commands
do a check for CAP_SYS_ADMIN.

Change this to fail early in nvm_ctl_ioctl(), so we don't have to
duplicate the permission checks all over.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/core.c