ioctl.c (01b944fe1cd4e21a2a9ed51adbdbafe2d5e905ba) ioctl.c (5955102c9984fa081b2d570cfac75c97eecf8f3b)
1/*
2 * linux/fs/hfsplus/ioctl.c
3 *
4 * Copyright (C) 2003
5 * Ethan Benson <erbenson@alaska.net>
6 * partially derived from linux/fs/ext2/ioctl.c
7 * Copyright (C) 1993, 1994, 1995
8 * Remy Card (card@masi.ibp.fr)

--- 79 unchanged lines hidden (view full) ---

88 goto out_drop_write;
89 }
90
91 if (get_user(flags, user_flags)) {
92 err = -EFAULT;
93 goto out_drop_write;
94 }
95
1/*
2 * linux/fs/hfsplus/ioctl.c
3 *
4 * Copyright (C) 2003
5 * Ethan Benson <erbenson@alaska.net>
6 * partially derived from linux/fs/ext2/ioctl.c
7 * Copyright (C) 1993, 1994, 1995
8 * Remy Card (card@masi.ibp.fr)

--- 79 unchanged lines hidden (view full) ---

88 goto out_drop_write;
89 }
90
91 if (get_user(flags, user_flags)) {
92 err = -EFAULT;
93 goto out_drop_write;
94 }
95
96 mutex_lock(&inode->i_mutex);
96 inode_lock(inode);
97
98 if ((flags & (FS_IMMUTABLE_FL|FS_APPEND_FL)) ||
99 inode->i_flags & (S_IMMUTABLE|S_APPEND)) {
100 if (!capable(CAP_LINUX_IMMUTABLE)) {
101 err = -EPERM;
102 goto out_unlock_inode;
103 }
104 }

--- 16 unchanged lines hidden (view full) ---

121 hip->userflags |= HFSPLUS_FLG_NODUMP;
122 else
123 hip->userflags &= ~HFSPLUS_FLG_NODUMP;
124
125 inode->i_ctime = CURRENT_TIME_SEC;
126 mark_inode_dirty(inode);
127
128out_unlock_inode:
97
98 if ((flags & (FS_IMMUTABLE_FL|FS_APPEND_FL)) ||
99 inode->i_flags & (S_IMMUTABLE|S_APPEND)) {
100 if (!capable(CAP_LINUX_IMMUTABLE)) {
101 err = -EPERM;
102 goto out_unlock_inode;
103 }
104 }

--- 16 unchanged lines hidden (view full) ---

121 hip->userflags |= HFSPLUS_FLG_NODUMP;
122 else
123 hip->userflags &= ~HFSPLUS_FLG_NODUMP;
124
125 inode->i_ctime = CURRENT_TIME_SEC;
126 mark_inode_dirty(inode);
127
128out_unlock_inode:
129 mutex_unlock(&inode->i_mutex);
129 inode_unlock(inode);
130out_drop_write:
131 mnt_drop_write_file(file);
132out:
133 return err;
134}
135
136long hfsplus_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
137{

--- 13 unchanged lines hidden ---
130out_drop_write:
131 mnt_drop_write_file(file);
132out:
133 return err;
134}
135
136long hfsplus_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
137{

--- 13 unchanged lines hidden ---