[XFS] Fix directory inodes ioctl compat code, minor code consistency cleanups

SGI Modid: xfs-linux:xfs-kern:21810a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Christoph Hellwig <hch@sgi.com>

authored by Nathan Scott and committed by Christoph Hellwig d3870398 68d1498c

+28 -17
+5 -2
fs/xfs/linux-2.6/xfs_file.c
··· 565 .sendfile = linvfs_sendfile, 566 .unlocked_ioctl = linvfs_ioctl, 567 #ifdef CONFIG_COMPAT 568 - .compat_ioctl = xfs_compat_ioctl, 569 #endif 570 .mmap = linvfs_file_mmap, 571 .open = linvfs_open, ··· 587 .sendfile = linvfs_sendfile, 588 .unlocked_ioctl = linvfs_ioctl_invis, 589 #ifdef CONFIG_COMPAT 590 - .compat_ioctl = xfs_compat_invis_ioctl, 591 #endif 592 .mmap = linvfs_file_mmap, 593 .open = linvfs_open, ··· 600 .read = generic_read_dir, 601 .readdir = linvfs_readdir, 602 .unlocked_ioctl = linvfs_ioctl, 603 .fsync = linvfs_fsync, 604 }; 605
··· 565 .sendfile = linvfs_sendfile, 566 .unlocked_ioctl = linvfs_ioctl, 567 #ifdef CONFIG_COMPAT 568 + .compat_ioctl = linvfs_compat_ioctl, 569 #endif 570 .mmap = linvfs_file_mmap, 571 .open = linvfs_open, ··· 587 .sendfile = linvfs_sendfile, 588 .unlocked_ioctl = linvfs_ioctl_invis, 589 #ifdef CONFIG_COMPAT 590 + .compat_ioctl = linvfs_compat_invis_ioctl, 591 #endif 592 .mmap = linvfs_file_mmap, 593 .open = linvfs_open, ··· 600 .read = generic_read_dir, 601 .readdir = linvfs_readdir, 602 .unlocked_ioctl = linvfs_ioctl, 603 + #ifdef CONFIG_COMPAT 604 + .compat_ioctl = linvfs_compat_ioctl, 605 + #endif 606 .fsync = linvfs_fsync, 607 }; 608
+19 -10
fs/xfs/linux-2.6/xfs_ioctl32.c
··· 1 /* 2 - * Copyright (c) 2004 Silicon Graphics, Inc. All Rights Reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of version 2 of the GNU General Public License as ··· 58 __s32 ocount; /* output count pointer */ 59 } xfs_fsop_bulkreq32_t; 60 61 - static unsigned long 62 - xfs_ioctl32_bulkstat(unsigned long arg) 63 { 64 xfs_fsop_bulkreq32_t __user *p32 = (void __user *)arg; 65 xfs_fsop_bulkreq_t __user *p = compat_alloc_user_space(sizeof(*p)); ··· 79 } 80 #endif 81 82 - static long 83 - __xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) 84 { 85 int error; 86 - struct inode *inode = f->f_dentry->d_inode; 87 vnode_t *vp = LINVFS_GET_VP(inode); 88 89 switch (cmd) { ··· 153 return error; 154 } 155 156 - long xfs_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg) 157 { 158 - return __xfs_compat_ioctl(0, f, cmd, arg); 159 } 160 161 - long xfs_compat_invis_ioctl(struct file *f, unsigned cmd, unsigned long arg) 162 { 163 - return __xfs_compat_ioctl(IO_INVIS, f, cmd, arg); 164 }
··· 1 /* 2 + * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of version 2 of the GNU General Public License as ··· 58 __s32 ocount; /* output count pointer */ 59 } xfs_fsop_bulkreq32_t; 60 61 + STATIC unsigned long 62 + xfs_ioctl32_bulkstat( 63 + unsigned long arg) 64 { 65 xfs_fsop_bulkreq32_t __user *p32 = (void __user *)arg; 66 xfs_fsop_bulkreq_t __user *p = compat_alloc_user_space(sizeof(*p)); ··· 78 } 79 #endif 80 81 + STATIC long 82 + __linvfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) 83 { 84 int error; 85 + struct inode *inode = f->f_dentry->d_inode; 86 vnode_t *vp = LINVFS_GET_VP(inode); 87 88 switch (cmd) { ··· 152 return error; 153 } 154 155 + long 156 + linvfs_compat_ioctl( 157 + struct file *f, 158 + unsigned cmd, 159 + unsigned long arg) 160 { 161 + return __linvfs_compat_ioctl(0, f, cmd, arg); 162 } 163 164 + long 165 + linvfs_compat_invis_ioctl( 166 + struct file *f, 167 + unsigned cmd, 168 + unsigned long arg) 169 { 170 + return __linvfs_compat_ioctl(IO_INVIS, f, cmd, arg); 171 }
+3 -3
fs/xfs/linux-2.6/xfs_ioctl32.h
··· 1 /* 2 - * Copyright (c) 2004 Silicon Graphics, Inc. All Rights Reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of version 2 of the GNU General Public License as ··· 30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ 31 */ 32 33 - long xfs_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg); 34 - long xfs_compat_invis_ioctl(struct file *f, unsigned cmd, unsigned long arg);
··· 1 /* 2 + * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of version 2 of the GNU General Public License as ··· 30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ 31 */ 32 33 + long linvfs_compat_ioctl(struct file *f, unsigned cmd, unsigned long arg); 34 + long linvfs_compat_invis_ioctl(struct file *f, unsigned cmd, unsigned long arg);
+1 -2
fs/xfs/linux-2.6/xfs_super.c
··· 1 /* 2 - * Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of version 2 of the GNU General Public License as ··· 66 #include "xfs_buf_item.h" 67 #include "xfs_utils.h" 68 #include "xfs_version.h" 69 - #include "xfs_ioctl32.h" 70 71 #include <linux/namei.h> 72 #include <linux/init.h>
··· 1 /* 2 + * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of version 2 of the GNU General Public License as ··· 66 #include "xfs_buf_item.h" 67 #include "xfs_utils.h" 68 #include "xfs_version.h" 69 70 #include <linux/namei.h> 71 #include <linux/init.h>