]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/inode.c
ovl: fix some xino configurations
[linux.git] / fs / inode.c
index c7418b0b4168613ef7e4d507588115ba6062cce3..7d57068b6b7aedbc3ddde2b91179853b7e8c6f43 100644 (file)
@@ -1599,25 +1599,31 @@ void iput(struct inode *inode)
 }
 EXPORT_SYMBOL(iput);
 
+#ifdef CONFIG_BLOCK
 /**
  *     bmap    - find a block number in a file
- *     @inode: inode of file
- *     @block: block to find
- *
- *     Returns the block number on the device holding the inode that
- *     is the disk block number for the block of the file requested.
- *     That is, asked for block 4 of inode 1 the function will return the
- *     disk block relative to the disk start that holds that block of the
- *     file.
+ *     @inode:  inode owning the block number being requested
+ *     @block: pointer containing the block to find
+ *
+ *     Replaces the value in *block with the block number on the device holding
+ *     corresponding to the requested block number in the file.
+ *     That is, asked for block 4 of inode 1 the function will replace the
+ *     4 in *block, with disk block relative to the disk start that holds that
+ *     block of the file.
+ *
+ *     Returns -EINVAL in case of error, 0 otherwise. If mapping falls into a
+ *     hole, returns 0 and *block is also set to 0.
  */
-sector_t bmap(struct inode *inode, sector_t block)
+int bmap(struct inode *inode, sector_t *block)
 {
-       sector_t res = 0;
-       if (inode->i_mapping->a_ops->bmap)
-               res = inode->i_mapping->a_ops->bmap(inode->i_mapping, block);
-       return res;
+       if (!inode->i_mapping->a_ops->bmap)
+               return -EINVAL;
+
+       *block = inode->i_mapping->a_ops->bmap(inode->i_mapping, *block);
+       return 0;
 }
 EXPORT_SYMBOL(bmap);
+#endif
 
 /*
  * With relative atime, only update atime if the previous atime is