@@ -716,37 +716,6 @@ struct ORANGEFS_dev_map_desc32 {
716
716
__s32 count ;
717
717
};
718
718
719
- static unsigned long translate_dev_map26 (unsigned long args , long * error )
720
- {
721
- struct ORANGEFS_dev_map_desc32 __user * p32 = (void __user * )args ;
722
- /*
723
- * Depending on the architecture, allocate some space on the
724
- * user-call-stack based on our expected layout.
725
- */
726
- struct ORANGEFS_dev_map_desc __user * p =
727
- compat_alloc_user_space (sizeof (* p ));
728
- compat_uptr_t addr ;
729
-
730
- * error = 0 ;
731
- /* get the ptr from the 32 bit user-space */
732
- if (get_user (addr , & p32 -> ptr ))
733
- goto err ;
734
- /* try to put that into a 64-bit layout */
735
- if (put_user (compat_ptr (addr ), & p -> ptr ))
736
- goto err ;
737
- /* copy the remaining fields */
738
- if (copy_in_user (& p -> total_size , & p32 -> total_size , sizeof (__s32 )))
739
- goto err ;
740
- if (copy_in_user (& p -> size , & p32 -> size , sizeof (__s32 )))
741
- goto err ;
742
- if (copy_in_user (& p -> count , & p32 -> count , sizeof (__s32 )))
743
- goto err ;
744
- return (unsigned long )p ;
745
- err :
746
- * error = - EFAULT ;
747
- return 0 ;
748
- }
749
-
750
719
/*
751
720
* 32 bit user-space apps' ioctl handlers when kernel modules
752
721
* is compiled as a 64 bit one
@@ -755,25 +724,26 @@ static long orangefs_devreq_compat_ioctl(struct file *filp, unsigned int cmd,
755
724
unsigned long args )
756
725
{
757
726
long ret ;
758
- unsigned long arg = args ;
759
727
760
728
/* Check for properly constructed commands */
761
729
ret = check_ioctl_command (cmd );
762
730
if (ret < 0 )
763
731
return ret ;
764
732
if (cmd == ORANGEFS_DEV_MAP ) {
765
- /*
766
- * convert the arguments to what we expect internally
767
- * in kernel space
768
- */
769
- arg = translate_dev_map26 (args , & ret );
770
- if (ret < 0 ) {
771
- gossip_err ("Could not translate dev map\n" );
772
- return ret ;
773
- }
733
+ struct ORANGEFS_dev_map_desc desc ;
734
+ struct ORANGEFS_dev_map_desc32 d32 ;
735
+
736
+ if (copy_from_user (& d32 , (void __user * )args , sizeof (d32 )))
737
+ return - EFAULT ;
738
+
739
+ desc .ptr = compat_ptr (d32 .ptr );
740
+ desc .total_size = d32 .total_size ;
741
+ desc .size = d32 .size ;
742
+ desc .count = d32 .count ;
743
+ return orangefs_bufmap_initialize (& desc );
774
744
}
775
745
/* no other ioctl requires translation */
776
- return dispatch_ioctl_command (cmd , arg );
746
+ return dispatch_ioctl_command (cmd , args );
777
747
}
778
748
779
749
#endif /* CONFIG_COMPAT is in .config */
0 commit comments