File tree Expand file tree Collapse file tree 3 files changed +28
-27
lines changed
Expand file tree Collapse file tree 3 files changed +28
-27
lines changed Original file line number Diff line number Diff line change @@ -578,7 +578,7 @@ xchk_scrub_create_subord(
578578}
579579
580580/* Dispatch metadata scrubbing. */
581- int
581+ STATIC int
582582xfs_scrub_metadata (
583583 struct file * file ,
584584 struct xfs_scrub_metadata * sm )
@@ -724,3 +724,28 @@ xfs_scrub_metadata(
724724 run .retries ++ ;
725725 goto retry_op ;
726726}
727+
728+ /* Scrub one aspect of one piece of metadata. */
729+ int
730+ xfs_ioc_scrub_metadata (
731+ struct file * file ,
732+ void __user * arg )
733+ {
734+ struct xfs_scrub_metadata scrub ;
735+ int error ;
736+
737+ if (!capable (CAP_SYS_ADMIN ))
738+ return - EPERM ;
739+
740+ if (copy_from_user (& scrub , arg , sizeof (scrub )))
741+ return - EFAULT ;
742+
743+ error = xfs_scrub_metadata (file , & scrub );
744+ if (error )
745+ return error ;
746+
747+ if (copy_to_user (arg , & scrub , sizeof (scrub )))
748+ return - EFAULT ;
749+
750+ return 0 ;
751+ }
Original file line number Diff line number Diff line change 77#define __XFS_SCRUB_H__
88
99#ifndef CONFIG_XFS_ONLINE_SCRUB
10- # define xfs_scrub_metadata ( file , sm ) (-ENOTTY)
10+ # define xfs_ioc_scrub_metadata ( f , a ) (-ENOTTY)
1111#else
12- int xfs_scrub_metadata (struct file * file , struct xfs_scrub_metadata * sm );
12+ int xfs_ioc_scrub_metadata (struct file * file , void __user * arg );
1313#endif /* CONFIG_XFS_ONLINE_SCRUB */
1414
1515#endif /* __XFS_SCRUB_H__ */
Original file line number Diff line number Diff line change @@ -1055,30 +1055,6 @@ xfs_ioc_getfsmap(
10551055 return error ;
10561056}
10571057
1058- STATIC int
1059- xfs_ioc_scrub_metadata (
1060- struct file * file ,
1061- void __user * arg )
1062- {
1063- struct xfs_scrub_metadata scrub ;
1064- int error ;
1065-
1066- if (!capable (CAP_SYS_ADMIN ))
1067- return - EPERM ;
1068-
1069- if (copy_from_user (& scrub , arg , sizeof (scrub )))
1070- return - EFAULT ;
1071-
1072- error = xfs_scrub_metadata (file , & scrub );
1073- if (error )
1074- return error ;
1075-
1076- if (copy_to_user (arg , & scrub , sizeof (scrub )))
1077- return - EFAULT ;
1078-
1079- return 0 ;
1080- }
1081-
10821058int
10831059xfs_ioc_swapext (
10841060 xfs_swapext_t * sxp )
You can’t perform that action at this time.
0 commit comments