diff options
| author | Tristan Ye <tristan.ye@oracle.com> | 2010-03-02 00:59:42 -0500 |
|---|---|---|
| committer | Joel Becker <joel.becker@oracle.com> | 2010-03-02 17:10:20 -0500 |
| commit | 9df5778ecee8b301b447fc05706792d5f447ace5 (patch) | |
| tree | 5547e6fd6c26274ce8ee7710f42201db392940bf /fs | |
| parent | 5051f76883897ea3d3d034c92e7b84236da2ec57 (diff) | |
Ocfs2: Move ocfs2 ioctl definitions from ocfs2_fs.h to newly added ocfs2_ioctl.h
Currently we were adding ioctl cmds/structures for ocfs2 into ocfs2_fs.h
which was used for define ocfs2 on-disk layout. That sounds a little bit
confusing, and it may be quickly polluted espcially when growing the
ocfs2_info_request ioctls afterwards(it will grow i bet).
As a result, such OCFS2 IOCs do need to be placed somewhere other than
ocfs2_fs.h, a separated ocfs2_ioctl.h will be added to store such ioctl
structures and definitions which could also be used from userspace to
invoke ioctls call.
Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/ocfs2/ioctl.h | 6 | ||||
| -rw-r--r-- | fs/ocfs2/ocfs2.h | 1 | ||||
| -rw-r--r-- | fs/ocfs2/ocfs2_fs.h | 57 | ||||
| -rw-r--r-- | fs/ocfs2/ocfs2_ioctl.h | 79 |
4 files changed, 83 insertions, 60 deletions
diff --git a/fs/ocfs2/ioctl.h b/fs/ocfs2/ioctl.h index cf9a5ee30fef..0cd5323bd3f0 100644 --- a/fs/ocfs2/ioctl.h +++ b/fs/ocfs2/ioctl.h | |||
| @@ -7,10 +7,10 @@ | |||
| 7 | * | 7 | * |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #ifndef OCFS2_IOCTL_H | 10 | #ifndef OCFS2_IOCTL_PROTO_H |
| 11 | #define OCFS2_IOCTL_H | 11 | #define OCFS2_IOCTL_PROTO_H |
| 12 | 12 | ||
| 13 | long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); | 13 | long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
| 14 | long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg); | 14 | long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg); |
| 15 | 15 | ||
| 16 | #endif /* OCFS2_IOCTL_H */ | 16 | #endif /* OCFS2_IOCTL_PROTO_H */ |
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index b27fe2489e0c..1238b491db90 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | 42 | ||
| 43 | #include "ocfs2_fs.h" | 43 | #include "ocfs2_fs.h" |
| 44 | #include "ocfs2_lockid.h" | 44 | #include "ocfs2_lockid.h" |
| 45 | #include "ocfs2_ioctl.h" | ||
| 45 | 46 | ||
| 46 | /* For struct ocfs2_blockcheck_stats */ | 47 | /* For struct ocfs2_blockcheck_stats */ |
| 47 | #include "blockcheck.h" | 48 | #include "blockcheck.h" |
diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h index 7638a38c32bc..bb37218a7978 100644 --- a/fs/ocfs2/ocfs2_fs.h +++ b/fs/ocfs2/ocfs2_fs.h | |||
| @@ -254,63 +254,6 @@ | |||
| 254 | * refcount tree */ | 254 | * refcount tree */ |
| 255 | 255 | ||
| 256 | /* | 256 | /* |
| 257 | * ioctl commands | ||
| 258 | */ | ||
| 259 | #define OCFS2_IOC_GETFLAGS _IOR('f', 1, long) | ||
| 260 | #define OCFS2_IOC_SETFLAGS _IOW('f', 2, long) | ||
| 261 | #define OCFS2_IOC32_GETFLAGS _IOR('f', 1, int) | ||
| 262 | #define OCFS2_IOC32_SETFLAGS _IOW('f', 2, int) | ||
| 263 | |||
| 264 | /* | ||
| 265 | * Space reservation / allocation / free ioctls and argument structure | ||
| 266 | * are designed to be compatible with XFS. | ||
| 267 | * | ||
| 268 | * ALLOCSP* and FREESP* are not and will never be supported, but are | ||
| 269 | * included here for completeness. | ||
| 270 | */ | ||
| 271 | struct ocfs2_space_resv { | ||
| 272 | __s16 l_type; | ||
| 273 | __s16 l_whence; | ||
| 274 | __s64 l_start; | ||
| 275 | __s64 l_len; /* len == 0 means until end of file */ | ||
| 276 | __s32 l_sysid; | ||
| 277 | __u32 l_pid; | ||
| 278 | __s32 l_pad[4]; /* reserve area */ | ||
| 279 | }; | ||
| 280 | |||
| 281 | #define OCFS2_IOC_ALLOCSP _IOW ('X', 10, struct ocfs2_space_resv) | ||
| 282 | #define OCFS2_IOC_FREESP _IOW ('X', 11, struct ocfs2_space_resv) | ||
| 283 | #define OCFS2_IOC_RESVSP _IOW ('X', 40, struct ocfs2_space_resv) | ||
| 284 | #define OCFS2_IOC_UNRESVSP _IOW ('X', 41, struct ocfs2_space_resv) | ||
| 285 | #define OCFS2_IOC_ALLOCSP64 _IOW ('X', 36, struct ocfs2_space_resv) | ||
| 286 | #define OCFS2_IOC_FREESP64 _IOW ('X', 37, struct ocfs2_space_resv) | ||
| 287 | #define OCFS2_IOC_RESVSP64 _IOW ('X', 42, struct ocfs2_space_resv) | ||
| 288 | #define OCFS2_IOC_UNRESVSP64 _IOW ('X', 43, struct ocfs2_space_resv) | ||
| 289 | |||
| 290 | /* Used to pass group descriptor data when online resize is done */ | ||
| 291 | struct ocfs2_new_group_input { | ||
| 292 | __u64 group; /* Group descriptor's blkno. */ | ||
| 293 | __u32 clusters; /* Total number of clusters in this group */ | ||
| 294 | __u32 frees; /* Total free clusters in this group */ | ||
| 295 | __u16 chain; /* Chain for this group */ | ||
| 296 | __u16 reserved1; | ||
| 297 | __u32 reserved2; | ||
| 298 | }; | ||
| 299 | |||
| 300 | #define OCFS2_IOC_GROUP_EXTEND _IOW('o', 1, int) | ||
| 301 | #define OCFS2_IOC_GROUP_ADD _IOW('o', 2,struct ocfs2_new_group_input) | ||
| 302 | #define OCFS2_IOC_GROUP_ADD64 _IOW('o', 3,struct ocfs2_new_group_input) | ||
| 303 | |||
| 304 | /* Used to pass 2 file names to reflink. */ | ||
| 305 | struct reflink_arguments { | ||
| 306 | __u64 old_path; | ||
| 307 | __u64 new_path; | ||
| 308 | __u64 preserve; | ||
| 309 | }; | ||
| 310 | #define OCFS2_IOC_REFLINK _IOW('o', 4, struct reflink_arguments) | ||
| 311 | |||
| 312 | |||
| 313 | /* | ||
| 314 | * Journal Flags (ocfs2_dinode.id1.journal1.i_flags) | 257 | * Journal Flags (ocfs2_dinode.id1.journal1.i_flags) |
| 315 | */ | 258 | */ |
| 316 | #define OCFS2_JOURNAL_DIRTY_FL (0x00000001) /* Journal needs recovery */ | 259 | #define OCFS2_JOURNAL_DIRTY_FL (0x00000001) /* Journal needs recovery */ |
diff --git a/fs/ocfs2/ocfs2_ioctl.h b/fs/ocfs2/ocfs2_ioctl.h new file mode 100644 index 000000000000..2d3420af1a83 --- /dev/null +++ b/fs/ocfs2/ocfs2_ioctl.h | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | /* -*- mode: c; c-basic-offset: 8; -*- | ||
| 2 | * vim: noexpandtab sw=8 ts=8 sts=0: | ||
| 3 | * | ||
| 4 | * ocfs2_ioctl.h | ||
| 5 | * | ||
| 6 | * Defines OCFS2 ioctls. | ||
| 7 | * | ||
| 8 | * Copyright (C) 2010 Oracle. All rights reserved. | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public | ||
| 12 | * License, version 2, as published by the Free Software Foundation. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 17 | * General Public License for more details. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef OCFS2_IOCTL_H | ||
| 21 | #define OCFS2_IOCTL_H | ||
| 22 | |||
| 23 | /* | ||
| 24 | * ioctl commands | ||
| 25 | */ | ||
| 26 | #define OCFS2_IOC_GETFLAGS _IOR('f', 1, long) | ||
| 27 | #define OCFS2_IOC_SETFLAGS _IOW('f', 2, long) | ||
| 28 | #define OCFS2_IOC32_GETFLAGS _IOR('f', 1, int) | ||
| 29 | #define OCFS2_IOC32_SETFLAGS _IOW('f', 2, int) | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Space reservation / allocation / free ioctls and argument structure | ||
| 33 | * are designed to be compatible with XFS. | ||
| 34 | * | ||
| 35 | * ALLOCSP* and FREESP* are not and will never be supported, but are | ||
| 36 | * included here for completeness. | ||
| 37 | */ | ||
| 38 | struct ocfs2_space_resv { | ||
| 39 | __s16 l_type; | ||
| 40 | __s16 l_whence; | ||
| 41 | __s64 l_start; | ||
| 42 | __s64 l_len; /* len == 0 means until end of file */ | ||
| 43 | __s32 l_sysid; | ||
| 44 | __u32 l_pid; | ||
| 45 | __s32 l_pad[4]; /* reserve area */ | ||
| 46 | }; | ||
| 47 | |||
| 48 | #define OCFS2_IOC_ALLOCSP _IOW ('X', 10, struct ocfs2_space_resv) | ||
| 49 | #define OCFS2_IOC_FREESP _IOW ('X', 11, struct ocfs2_space_resv) | ||
| 50 | #define OCFS2_IOC_RESVSP _IOW ('X', 40, struct ocfs2_space_resv) | ||
| 51 | #define OCFS2_IOC_UNRESVSP _IOW ('X', 41, struct ocfs2_space_resv) | ||
| 52 | #define OCFS2_IOC_ALLOCSP64 _IOW ('X', 36, struct ocfs2_space_resv) | ||
| 53 | #define OCFS2_IOC_FREESP64 _IOW ('X', 37, struct ocfs2_space_resv) | ||
| 54 | #define OCFS2_IOC_RESVSP64 _IOW ('X', 42, struct ocfs2_space_resv) | ||
| 55 | #define OCFS2_IOC_UNRESVSP64 _IOW ('X', 43, struct ocfs2_space_resv) | ||
| 56 | |||
| 57 | /* Used to pass group descriptor data when online resize is done */ | ||
| 58 | struct ocfs2_new_group_input { | ||
| 59 | __u64 group; /* Group descriptor's blkno. */ | ||
| 60 | __u32 clusters; /* Total number of clusters in this group */ | ||
| 61 | __u32 frees; /* Total free clusters in this group */ | ||
| 62 | __u16 chain; /* Chain for this group */ | ||
| 63 | __u16 reserved1; | ||
| 64 | __u32 reserved2; | ||
| 65 | }; | ||
| 66 | |||
| 67 | #define OCFS2_IOC_GROUP_EXTEND _IOW('o', 1, int) | ||
| 68 | #define OCFS2_IOC_GROUP_ADD _IOW('o', 2,struct ocfs2_new_group_input) | ||
| 69 | #define OCFS2_IOC_GROUP_ADD64 _IOW('o', 3,struct ocfs2_new_group_input) | ||
| 70 | |||
| 71 | /* Used to pass 2 file names to reflink. */ | ||
| 72 | struct reflink_arguments { | ||
| 73 | __u64 old_path; | ||
| 74 | __u64 new_path; | ||
| 75 | __u64 preserve; | ||
| 76 | }; | ||
| 77 | #define OCFS2_IOC_REFLINK _IOW('o', 4, struct reflink_arguments) | ||
| 78 | |||
| 79 | #endif /* OCFS2_IOCTL_H */ | ||
