patch-2.3.43 linux/fs/ioctl.c
Next file: linux/fs/isofs/Makefile
Previous file: linux/fs/inode.c
Back to the patch index
Back to the overall index
- Lines: 28
- Date:
Thu Feb 10 12:16:58 2000
- Orig file:
v2.3.42/linux/fs/ioctl.c
- Orig date:
Thu Aug 26 13:05:40 1999
diff -u --recursive --new-file v2.3.42/linux/fs/ioctl.c linux/fs/ioctl.c
@@ -19,21 +19,18 @@
switch (cmd) {
case FIBMAP:
{
- struct buffer_head tmp;
-
- if (inode->i_op == NULL)
- return -EBADF;
- if (inode->i_op->get_block == NULL)
+ struct address_space *mapping = inode->i_mapping;
+ int res;
+ /* do we support this mess? */
+ if (!mapping->a_ops->bmap)
return -EINVAL;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
if ((error = get_user(block, (int *) arg)) != 0)
return error;
- tmp.b_state = 0;
- tmp.b_blocknr = 0;
- inode->i_op->get_block(inode, block, &tmp, 0);
- return put_user(tmp.b_blocknr, (int *) arg);
+ res = mapping->a_ops->bmap(mapping, block);
+ return put_user(res, (int *) arg);
}
case FIGETBSZ:
if (inode->i_sb == NULL)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)