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(
578
578
}
579
579
580
580
/* Dispatch metadata scrubbing. */
581
- int
581
+ STATIC int
582
582
xfs_scrub_metadata (
583
583
struct file * file ,
584
584
struct xfs_scrub_metadata * sm )
@@ -724,3 +724,28 @@ xfs_scrub_metadata(
724
724
run .retries ++ ;
725
725
goto retry_op ;
726
726
}
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 7
7
#define __XFS_SCRUB_H__
8
8
9
9
#ifndef CONFIG_XFS_ONLINE_SCRUB
10
- # define xfs_scrub_metadata ( file , sm ) (-ENOTTY)
10
+ # define xfs_ioc_scrub_metadata ( f , a ) (-ENOTTY)
11
11
#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 );
13
13
#endif /* CONFIG_XFS_ONLINE_SCRUB */
14
14
15
15
#endif /* __XFS_SCRUB_H__ */
Original file line number Diff line number Diff line change @@ -1055,30 +1055,6 @@ xfs_ioc_getfsmap(
1055
1055
return error ;
1056
1056
}
1057
1057
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
-
1082
1058
int
1083
1059
xfs_ioc_swapext (
1084
1060
xfs_swapext_t * sxp )
You can’t perform that action at this time.
0 commit comments