2874c5fd28426 (Thomas Gleixner 2019-05-27 08:55:01 +0200 1) // SPDX-License-Identifier: GPL-2.0-or-later
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 2) /* no-block.c: implementation of routines required for non-BLOCK configuration
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 3) *
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 4) * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 5) * Written by David Howells (dhowells@redhat.com)
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 6) */
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 7)
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 8) #include <linux/kernel.h>
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 9) #include <linux/fs.h>
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 10)
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 11) static int no_blkdev_open(struct inode * inode, struct file * filp)
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 12) {
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 13) return -ENODEV;
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 14) }
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 15)
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 16) const struct file_operations def_blk_fops = {
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 17) .open = no_blkdev_open,
6038f373a3dc1 (Arnd Bergmann 2010-08-15 18:52:59 +0200 18) .llseek = noop_llseek,
9361401eb7619 (David Howells 2006-09-30 20:45:40 +0200 19) };