aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/ioctl.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-08-29 14:06:16 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-09-30 14:52:28 -0400
commit36695673b012096228ebdc1b39a6a5850daa474e (patch)
tree4b617e27256750f367b2b50653981c70db0ce2d0 /fs/hfsplus/ioctl.c
parent863d5b822c02d0e7215fb84ca79e9f8c3e35f04e (diff)
[PATCH] BLOCK: Move common FS-specific ioctls to linux/fs.h [try #6]
Move common FS-specific ioctls from linux/ext2_fs.h to linux/fs.h as FS_IOC_* and FS_IOC32_* and have the users of them use those as a base. Also move the GETFLAGS/SETFLAGS flags to linux/fs.h as FS_*_FL macros, and then have the other users use them as a base. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/hfsplus/ioctl.c')
-rw-r--r--fs/hfsplus/ioctl.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
index 13cf848ac833..79fd10402ea3 100644
--- a/fs/hfsplus/ioctl.c
+++ b/fs/hfsplus/ioctl.c
@@ -28,11 +28,11 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
28 case HFSPLUS_IOC_EXT2_GETFLAGS: 28 case HFSPLUS_IOC_EXT2_GETFLAGS:
29 flags = 0; 29 flags = 0;
30 if (HFSPLUS_I(inode).rootflags & HFSPLUS_FLG_IMMUTABLE) 30 if (HFSPLUS_I(inode).rootflags & HFSPLUS_FLG_IMMUTABLE)
31 flags |= EXT2_FLAG_IMMUTABLE; /* EXT2_IMMUTABLE_FL */ 31 flags |= FS_IMMUTABLE_FL; /* EXT2_IMMUTABLE_FL */
32 if (HFSPLUS_I(inode).rootflags & HFSPLUS_FLG_APPEND) 32 if (HFSPLUS_I(inode).rootflags & HFSPLUS_FLG_APPEND)
33 flags |= EXT2_FLAG_APPEND; /* EXT2_APPEND_FL */ 33 flags |= FS_APPEND_FL; /* EXT2_APPEND_FL */
34 if (HFSPLUS_I(inode).userflags & HFSPLUS_FLG_NODUMP) 34 if (HFSPLUS_I(inode).userflags & HFSPLUS_FLG_NODUMP)
35 flags |= EXT2_FLAG_NODUMP; /* EXT2_NODUMP_FL */ 35 flags |= FS_NODUMP_FL; /* EXT2_NODUMP_FL */
36 return put_user(flags, (int __user *)arg); 36 return put_user(flags, (int __user *)arg);
37 case HFSPLUS_IOC_EXT2_SETFLAGS: { 37 case HFSPLUS_IOC_EXT2_SETFLAGS: {
38 if (IS_RDONLY(inode)) 38 if (IS_RDONLY(inode))
@@ -44,32 +44,31 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
44 if (get_user(flags, (int __user *)arg)) 44 if (get_user(flags, (int __user *)arg))
45 return -EFAULT; 45 return -EFAULT;
46 46
47 if (flags & (EXT2_FLAG_IMMUTABLE|EXT2_FLAG_APPEND) || 47 if (flags & (FS_IMMUTABLE_FL|FS_APPEND_FL) ||
48 HFSPLUS_I(inode).rootflags & (HFSPLUS_FLG_IMMUTABLE|HFSPLUS_FLG_APPEND)) { 48 HFSPLUS_I(inode).rootflags & (HFSPLUS_FLG_IMMUTABLE|HFSPLUS_FLG_APPEND)) {
49 if (!capable(CAP_LINUX_IMMUTABLE)) 49 if (!capable(CAP_LINUX_IMMUTABLE))
50 return -EPERM; 50 return -EPERM;
51 } 51 }
52 52
53 /* don't silently ignore unsupported ext2 flags */ 53 /* don't silently ignore unsupported ext2 flags */
54 if (flags & ~(EXT2_FLAG_IMMUTABLE|EXT2_FLAG_APPEND| 54 if (flags & ~(FS_IMMUTABLE_FL|FS_APPEND_FL|FS_NODUMP_FL))
55 EXT2_FLAG_NODUMP))
56 return -EOPNOTSUPP; 55 return -EOPNOTSUPP;
57 56
58 if (flags & EXT2_FLAG_IMMUTABLE) { /* EXT2_IMMUTABLE_FL */ 57 if (flags & FS_IMMUTABLE_FL) { /* EXT2_IMMUTABLE_FL */
59 inode->i_flags |= S_IMMUTABLE; 58 inode->i_flags |= S_IMMUTABLE;
60 HFSPLUS_I(inode).rootflags |= HFSPLUS_FLG_IMMUTABLE; 59 HFSPLUS_I(inode).rootflags |= HFSPLUS_FLG_IMMUTABLE;
61 } else { 60 } else {
62 inode->i_flags &= ~S_IMMUTABLE; 61 inode->i_flags &= ~S_IMMUTABLE;
63 HFSPLUS_I(inode).rootflags &= ~HFSPLUS_FLG_IMMUTABLE; 62 HFSPLUS_I(inode).rootflags &= ~HFSPLUS_FLG_IMMUTABLE;
64 } 63 }
65 if (flags & EXT2_FLAG_APPEND) { /* EXT2_APPEND_FL */ 64 if (flags & FS_APPEND_FL) { /* EXT2_APPEND_FL */
66 inode->i_flags |= S_APPEND; 65 inode->i_flags |= S_APPEND;
67 HFSPLUS_I(inode).rootflags |= HFSPLUS_FLG_APPEND; 66 HFSPLUS_I(inode).rootflags |= HFSPLUS_FLG_APPEND;
68 } else { 67 } else {
69 inode->i_flags &= ~S_APPEND; 68 inode->i_flags &= ~S_APPEND;
70 HFSPLUS_I(inode).rootflags &= ~HFSPLUS_FLG_APPEND; 69 HFSPLUS_I(inode).rootflags &= ~HFSPLUS_FLG_APPEND;
71 } 70 }
72 if (flags & EXT2_FLAG_NODUMP) /* EXT2_NODUMP_FL */ 71 if (flags & FS_NODUMP_FL) /* EXT2_NODUMP_FL */
73 HFSPLUS_I(inode).userflags |= HFSPLUS_FLG_NODUMP; 72 HFSPLUS_I(inode).userflags |= HFSPLUS_FLG_NODUMP;
74 else 73 else
75 HFSPLUS_I(inode).userflags &= ~HFSPLUS_FLG_NODUMP; 74 HFSPLUS_I(inode).userflags &= ~HFSPLUS_FLG_NODUMP;