@@ -2423,6 +2423,14 @@ static int f2fs_ioc_get_encryption_key_status(struct file *filp,
2423
2423
return fscrypt_ioctl_get_key_status (filp , (void __user * )arg );
2424
2424
}
2425
2425
2426
+ static int f2fs_ioc_get_encryption_nonce (struct file * filp , unsigned long arg )
2427
+ {
2428
+ if (!f2fs_sb_has_encrypt (F2FS_I_SB (file_inode (filp ))))
2429
+ return - EOPNOTSUPP ;
2430
+
2431
+ return fscrypt_ioctl_get_nonce (filp , (void __user * )arg );
2432
+ }
2433
+
2426
2434
static int f2fs_ioc_gc (struct file * filp , unsigned long arg )
2427
2435
{
2428
2436
struct inode * inode = file_inode (filp );
@@ -3437,6 +3445,8 @@ long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
3437
3445
return f2fs_ioc_remove_encryption_key_all_users (filp , arg );
3438
3446
case FS_IOC_GET_ENCRYPTION_KEY_STATUS :
3439
3447
return f2fs_ioc_get_encryption_key_status (filp , arg );
3448
+ case FS_IOC_GET_ENCRYPTION_NONCE :
3449
+ return f2fs_ioc_get_encryption_nonce (filp , arg );
3440
3450
case F2FS_IOC_GARBAGE_COLLECT :
3441
3451
return f2fs_ioc_gc (filp , arg );
3442
3452
case F2FS_IOC_GARBAGE_COLLECT_RANGE :
@@ -3611,6 +3621,7 @@ long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
3611
3621
case FS_IOC_REMOVE_ENCRYPTION_KEY :
3612
3622
case FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS :
3613
3623
case FS_IOC_GET_ENCRYPTION_KEY_STATUS :
3624
+ case FS_IOC_GET_ENCRYPTION_NONCE :
3614
3625
case F2FS_IOC_GARBAGE_COLLECT :
3615
3626
case F2FS_IOC_GARBAGE_COLLECT_RANGE :
3616
3627
case F2FS_IOC_WRITE_CHECKPOINT :
0 commit comments