Skip to content

Commit

Permalink
provide generic_block_fiemap() only with BLOCK=y
Browse files Browse the repository at this point in the history
This fixes the following compile error with CONFIG_BLOCK=n caused by
commit 68c9d70 ("generic block based
fiemap implementation"):

    CC      fs/ioctl.o
  fs/ioctl.c: In function 'generic_block_fiemap':
  fs/ioctl.c:249: error: storage size of 'tmp' isn't known
  fs/ioctl.c:272: error: invalid application of 'sizeof' to incomplete type 'struct buffer_head'
  fs/ioctl.c:280: error: implicit declaration of function 'buffer_mapped'
  fs/ioctl.c:249: warning: unused variable 'tmp'
  make[2]: *** [fs/ioctl.o] Error 1

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Oct 12, 2008
1 parent 0dab9cf commit 06270d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ static int ioctl_fiemap(struct file *filp, unsigned long arg)
return error;
}

#ifdef CONFIG_BLOCK

#define blk_to_logical(inode, blk) (blk << (inode)->i_blkbits)
#define logical_to_blk(inode, offset) (offset >> (inode)->i_blkbits);

Expand Down Expand Up @@ -342,6 +344,8 @@ int generic_block_fiemap(struct inode *inode,
}
EXPORT_SYMBOL(generic_block_fiemap);

#endif /* CONFIG_BLOCK */

static int file_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{
Expand Down

0 comments on commit 06270d5

Please sign in to comment.