Commit 7549e93a authored by Radostin Stoyanov's avatar Radostin Stoyanov Committed by Andrei Vagin

files: Simplify get_mem_dev_ops

Signed-off-by: 's avatarRadostin Stoyanov <rstoyanov1@gmail.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@gmail.com>
parent adaad53b
......@@ -426,21 +426,14 @@ static const struct fdtype_ops *get_mem_dev_ops(struct fd_parms *p, int minor)
{
const struct fdtype_ops *ops = NULL;
switch (minor) {
case 11:
/*
* If /dev/kmsg is opened in write-only mode the file position
* should not be set up upon restore, kernel doesn't allow that.
*/
if ((p->flags & O_ACCMODE) == O_WRONLY && p->pos == 0)
if (minor == 11 && (p->flags & O_ACCMODE) == O_WRONLY && p->pos == 0)
p->pos = -1ULL;
/*
* Fallthrough.
*/
default:
ops = &regfile_dump_ops;
break;
};
return ops;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment