ioctl.c (664b0bae0b87f69bc9deb098f5e0158b9cf18e04) ioctl.c (643fa9612bf1a29153eee46fd398117632f93cbe)
1/*
2 * This file is part of UBIFS.
3 *
4 * Copyright (C) 2006-2008 Nokia Corporation.
5 * Copyright (C) 2006, 2007 University of Szeged, Hungary
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by

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

180 if (err)
181 return err;
182 dbg_gen("set flags: %#x, i_flags %#x", flags, inode->i_flags);
183 err = setflags(inode, flags);
184 mnt_drop_write_file(file);
185 return err;
186 }
187 case FS_IOC_SET_ENCRYPTION_POLICY: {
1/*
2 * This file is part of UBIFS.
3 *
4 * Copyright (C) 2006-2008 Nokia Corporation.
5 * Copyright (C) 2006, 2007 University of Szeged, Hungary
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by

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

180 if (err)
181 return err;
182 dbg_gen("set flags: %#x, i_flags %#x", flags, inode->i_flags);
183 err = setflags(inode, flags);
184 mnt_drop_write_file(file);
185 return err;
186 }
187 case FS_IOC_SET_ENCRYPTION_POLICY: {
188#ifdef CONFIG_UBIFS_FS_ENCRYPTION
188#ifdef CONFIG_FS_ENCRYPTION
189 struct ubifs_info *c = inode->i_sb->s_fs_info;
190
191 err = ubifs_enable_encryption(c);
192 if (err)
193 return err;
194
195 return fscrypt_ioctl_set_policy(file, (const void __user *)arg);
196#else
197 return -EOPNOTSUPP;
198#endif
199 }
200 case FS_IOC_GET_ENCRYPTION_POLICY: {
189 struct ubifs_info *c = inode->i_sb->s_fs_info;
190
191 err = ubifs_enable_encryption(c);
192 if (err)
193 return err;
194
195 return fscrypt_ioctl_set_policy(file, (const void __user *)arg);
196#else
197 return -EOPNOTSUPP;
198#endif
199 }
200 case FS_IOC_GET_ENCRYPTION_POLICY: {
201#ifdef CONFIG_UBIFS_FS_ENCRYPTION
201#ifdef CONFIG_FS_ENCRYPTION
202 return fscrypt_ioctl_get_policy(file, (void __user *)arg);
203#else
204 return -EOPNOTSUPP;
205#endif
206 }
207
208 default:
209 return -ENOTTY;

--- 22 unchanged lines hidden ---
202 return fscrypt_ioctl_get_policy(file, (void __user *)arg);
203#else
204 return -EOPNOTSUPP;
205#endif
206 }
207
208 default:
209 return -ENOTTY;

--- 22 unchanged lines hidden ---