Skip to content

Commit

Permalink
[PATCH] move block_device_operations to blkdev.h
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 21, 2008
1 parent 647b3d0 commit 08f8585
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
1 change: 1 addition & 0 deletions fs/ext2/xip.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/buffer_head.h>
#include <linux/ext2_fs_sb.h>
#include <linux/ext2_fs.h>
#include <linux/blkdev.h>
#include "ext2.h"
#include "xip.h"

Expand Down
17 changes: 17 additions & 0 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,23 @@ static inline int blk_integrity_rq(struct request *rq)

#endif /* CONFIG_BLK_DEV_INTEGRITY */

struct file;
struct inode;

struct block_device_operations {
int (*open) (struct inode *, struct file *);
int (*release) (struct inode *, struct file *);
int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
long (*unlocked_ioctl) (struct file *, unsigned, unsigned long);
long (*compat_ioctl) (struct file *, unsigned, unsigned long);
int (*direct_access) (struct block_device *, sector_t,
void **, unsigned long *);
int (*media_changed) (struct gendisk *);
int (*revalidate_disk) (struct gendisk *);
int (*getgeo)(struct block_device *, struct hd_geometry *);
struct module *owner;
};

#else /* CONFIG_BLOCK */
/*
* stubs for when the block layer is configured out
Expand Down
15 changes: 1 addition & 14 deletions include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1270,20 +1270,7 @@ int generic_osync_inode(struct inode *, struct address_space *, int);
* to have different dirent layouts depending on the binary type.
*/
typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned);

struct block_device_operations {
int (*open) (struct inode *, struct file *);
int (*release) (struct inode *, struct file *);
int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
long (*unlocked_ioctl) (struct file *, unsigned, unsigned long);
long (*compat_ioctl) (struct file *, unsigned, unsigned long);
int (*direct_access) (struct block_device *, sector_t,
void **, unsigned long *);
int (*media_changed) (struct gendisk *);
int (*revalidate_disk) (struct gendisk *);
int (*getgeo)(struct block_device *, struct hd_geometry *);
struct module *owner;
};
struct block_device_operations;

/* These macros are for out of kernel modules to test that
* the kernel supports the unlocked_ioctl and compat_ioctl
Expand Down

0 comments on commit 08f8585

Please sign in to comment.