The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/fs/efs/file.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * file.c
    3  *
    4  * Copyright (c) 1999 Al Smith
    5  *
    6  * Portions derived from work (c) 1995,1996 Christian Vogelgsang.
    7  */
    8 
    9 #include <linux/efs_fs.h>
   10 
   11 int efs_get_block(struct inode *inode, long iblock,
   12                   struct buffer_head *bh_result, int create)
   13 {
   14         int error = -EROFS;
   15         long phys;
   16 
   17         if (create)
   18                 return error;
   19         if (iblock >= inode->i_blocks) {
   20 #ifdef DEBUG
   21                 /*
   22                  * i have no idea why this happens as often as it does
   23                  */
   24                 printk(KERN_WARNING "EFS: bmap(): block %d >= %ld (filesize %ld)\n",
   25                         block,
   26                         inode->i_blocks,
   27                         inode->i_size);
   28 #endif
   29                 return 0;
   30         }
   31         phys = efs_map_block(inode, iblock);
   32         if (phys) {
   33                 bh_result->b_dev = inode->i_dev;
   34                 bh_result->b_blocknr = phys;
   35                 bh_result->b_state |= (1UL << BH_Mapped);
   36         }
   37         return 0;
   38 }
   39 
   40 int efs_bmap(struct inode *inode, efs_block_t block) {
   41 
   42         if (block < 0) {
   43                 printk(KERN_WARNING "EFS: bmap(): block < 0\n");
   44                 return 0;
   45         }
   46 
   47         /* are we about to read past the end of a file ? */
   48         if (!(block < inode->i_blocks)) {
   49 #ifdef DEBUG
   50                 /*
   51                  * i have no idea why this happens as often as it does
   52                  */
   53                 printk(KERN_WARNING "EFS: bmap(): block %d >= %ld (filesize %ld)\n",
   54                         block,
   55                         inode->i_blocks,
   56                         inode->i_size);
   57 #endif
   58                 return 0;
   59         }
   60 
   61         return efs_map_block(inode, block);
   62 }

Cache object: 7ca2b6df6e24ad2985dcf046aa9fe786


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.