Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8f45cdd9
Commit
8f45cdd9
authored
Feb 28, 2004
by
Timothy Shimmin
Committed by
Nathan Scott
Feb 28, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Add XFS_FS_GOINGDOWN interface to xfs.
SGI Modid: xfs-linux:xfs-kern:166489a
parent
23d5a8c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
18 deletions
+58
-18
fs/xfs/linux/xfs_ioctl.c
fs/xfs/linux/xfs_ioctl.c
+21
-18
fs/xfs/xfs_fs.h
fs/xfs/xfs_fs.h
+7
-0
fs/xfs/xfs_fsops.c
fs/xfs/xfs_fsops.c
+25
-0
fs/xfs/xfs_fsops.h
fs/xfs/xfs_fsops.h
+5
-0
No files found.
fs/xfs/linux/xfs_ioctl.c
View file @
8f45cdd9
...
...
@@ -699,9 +699,7 @@ xfs_ioctl(
error
=
xfs_set_dmattrs
(
bdp
,
dmi
.
fsd_dmevmask
,
dmi
.
fsd_dmstate
,
NULL
);
if
(
error
)
return
-
error
;
return
0
;
return
-
error
;
}
case
XFS_IOC_GETBMAP
:
...
...
@@ -733,9 +731,7 @@ xfs_ioctl(
case
XFS_IOC_SWAPEXT
:
{
error
=
xfs_swapext
((
struct
xfs_swapext
*
)
arg
);
if
(
error
)
return
-
error
;
return
0
;
return
-
error
;
}
case
XFS_IOC_FSCOUNTS
:
{
...
...
@@ -763,6 +759,8 @@ xfs_ioctl(
/* input parameter is passed in resblks field of structure */
in
=
inout
.
resblks
;
error
=
xfs_reserve_blocks
(
mp
,
&
in
,
&
inout
);
if
(
error
)
return
-
error
;
if
(
copy_to_user
((
char
*
)
arg
,
&
inout
,
sizeof
(
inout
)))
return
-
XFS_ERROR
(
EFAULT
);
...
...
@@ -795,9 +793,7 @@ xfs_ioctl(
return
-
XFS_ERROR
(
EFAULT
);
error
=
xfs_growfs_data
(
mp
,
&
in
);
if
(
error
)
return
-
error
;
return
0
;
return
-
error
;
}
case
XFS_IOC_FSGROWFSLOG
:
{
...
...
@@ -810,9 +806,7 @@ xfs_ioctl(
return
-
XFS_ERROR
(
EFAULT
);
error
=
xfs_growfs_log
(
mp
,
&
in
);
if
(
error
)
return
-
error
;
return
0
;
return
-
error
;
}
case
XFS_IOC_FSGROWFSRT
:
{
...
...
@@ -825,9 +819,7 @@ xfs_ioctl(
return
-
XFS_ERROR
(
EFAULT
);
error
=
xfs_growfs_rt
(
mp
,
&
in
);
if
(
error
)
return
-
error
;
return
0
;
return
-
error
;
}
case
XFS_IOC_FREEZE
:
...
...
@@ -842,6 +834,19 @@ xfs_ioctl(
xfs_fs_thaw
(
mp
);
return
0
;
case
XFS_IOC_GOINGDOWN
:
{
__uint32_t
in
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
if
(
get_user
(
in
,
(
__uint32_t
*
)
arg
))
return
-
XFS_ERROR
(
EFAULT
);
error
=
xfs_fs_goingdown
(
mp
,
in
);
return
-
error
;
}
case
XFS_IOC_ERROR_INJECTION
:
{
xfs_error_injection_t
in
;
...
...
@@ -849,9 +854,7 @@ xfs_ioctl(
return
-
XFS_ERROR
(
EFAULT
);
error
=
xfs_errortag_add
(
in
.
errtag
,
mp
);
if
(
error
)
return
-
error
;
return
0
;
return
-
error
;
}
case
XFS_IOC_ERROR_CLEARALL
:
...
...
fs/xfs/xfs_fs.h
View file @
8f45cdd9
...
...
@@ -437,6 +437,12 @@ typedef struct xfs_handle {
#define FSHSIZE sizeof(fsid_t)
/*
* Flags for going down operation
*/
#define XFS_FSOP_GOING_FLAGS_DEFAULT 0x0
/* going down */
#define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1
/* flush log but not data */
#define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2
/* don't flush log nor data */
/*
* ioctl commands that replace IRIX fcntl()'s
...
...
@@ -490,6 +496,7 @@ typedef struct xfs_handle {
#define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
#define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
#define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom)
#define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t)
/* XFS_IOC_GETFSUUID ---------- deprecated 140 */
...
...
fs/xfs/xfs_fsops.c
View file @
8f45cdd9
...
...
@@ -626,3 +626,28 @@ xfs_fs_thaw(
xfs_finish_freeze
(
mp
);
return
0
;
}
int
xfs_fs_goingdown
(
xfs_mount_t
*
mp
,
__uint32_t
inflags
)
{
switch
(
inflags
)
{
case
XFS_FSOP_GOING_FLAGS_DEFAULT
:
xfs_fs_freeze
(
mp
);
xfs_force_shutdown
(
mp
,
XFS_FORCE_UMOUNT
);
xfs_fs_thaw
(
mp
);
break
;
case
XFS_FSOP_GOING_FLAGS_LOGFLUSH
:
xfs_force_shutdown
(
mp
,
XFS_FORCE_UMOUNT
);
break
;
case
XFS_FSOP_GOING_FLAGS_NOLOGFLUSH
:
xfs_force_shutdown
(
mp
,
XFS_FORCE_UMOUNT
|
XFS_LOG_IO_ERROR
);
break
;
default:
return
XFS_ERROR
(
EINVAL
);
}
return
0
;
}
fs/xfs/xfs_fsops.h
View file @
8f45cdd9
...
...
@@ -67,4 +67,9 @@ int
xfs_fs_thaw
(
xfs_mount_t
*
mp
);
int
xfs_fs_goingdown
(
xfs_mount_t
*
mp
,
__uint32_t
inflags
);
#endif
/* __XFS_FSOPS_H__ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment