4 * Copyright (c) 1999 Al Smith
6 * Portions derived from work (c) 1995,1996 Christian Vogelgsang.
9 #include <linux/efs_fs.h>
11 int efs_get_block(struct inode
*inode
, long iblock
,
12 struct buffer_head
*bh_result
, int create
)
19 if (iblock
>= inode
->i_blocks
) {
22 * i have no idea why this happens as often as it does
24 printk(KERN_WARNING
"EFS: bmap(): block %d >= %ld (filesize %ld)\n",
31 phys
= efs_map_block(inode
, iblock
);
33 bh_result
->b_dev
= inode
->i_dev
;
34 bh_result
->b_blocknr
= phys
;
35 bh_result
->b_state
|= (1UL << BH_Mapped
);
40 int efs_bmap(struct inode
*inode
, efs_block_t block
) {
43 printk(KERN_WARNING
"EFS: bmap(): block < 0\n");
47 /* are we about to read past the end of a file ? */
48 if (!(block
< inode
->i_blocks
)) {
51 * i have no idea why this happens as often as it does
53 printk(KERN_WARNING
"EFS: bmap(): block %d >= %ld (filesize %ld)\n",
61 return efs_map_block(inode
, block
);
64 static struct file_operations efs_file_operations
= {
66 generic_file_read
, /* read */
71 generic_file_mmap
, /* mmap */
77 NULL
, /* check_media_change */
81 struct inode_operations efs_file_inode_operations
= {
82 &efs_file_operations
, /* default file operations */
93 NULL
, /* follow_link */
94 efs_get_block
, /* get_block */
95 block_read_full_page
, /* readpage */
99 NULL
, /* permission */
101 NULL
/* revalidate */