/* Need to be kept consistent with checked flags in ioctl2ubifs() */ #define UBIFS_SETTABLE_IOCTL_FLAGS \
(FS_COMPR_FL | FS_SYNC_FL | FS_APPEND_FL | \
FS_IMMUTABLE_FL | FS_DIRSYNC_FL)
/* Need to be kept consistent with checked flags in ubifs2ioctl() */ #define UBIFS_GETTABLE_IOCTL_FLAGS \
(UBIFS_SETTABLE_IOCTL_FLAGS | FS_ENCRYPT_FL)
/** * ubifs_set_inode_flags - set VFS inode flags. * @inode: VFS inode to set flags for * * This function propagates flags from UBIFS inode object to VFS inode object.
*/ void ubifs_set_inode_flags(struct inode *inode)
{ unsignedint flags = ubifs_inode(inode)->flags;
inode->i_flags &= ~(S_SYNC | S_APPEND | S_IMMUTABLE | S_DIRSYNC |
S_ENCRYPTED); if (flags & UBIFS_SYNC_FL)
inode->i_flags |= S_SYNC; if (flags & UBIFS_APPEND_FL)
inode->i_flags |= S_APPEND; if (flags & UBIFS_IMMUTABLE_FL)
inode->i_flags |= S_IMMUTABLE; if (flags & UBIFS_DIRSYNC_FL)
inode->i_flags |= S_DIRSYNC; if (flags & UBIFS_CRYPT_FL)
inode->i_flags |= S_ENCRYPTED;
}
/* * ioctl2ubifs - convert ioctl inode flags to UBIFS inode flags. * @ioctl_flags: flags to convert * * This function converts ioctl flags (@FS_COMPR_FL, etc) to UBIFS inode flags * (@UBIFS_COMPR_FL, etc).
*/ staticint ioctl2ubifs(int ioctl_flags)
{ int ubifs_flags = 0;
if (ioctl_flags & FS_COMPR_FL)
ubifs_flags |= UBIFS_COMPR_FL; if (ioctl_flags & FS_SYNC_FL)
ubifs_flags |= UBIFS_SYNC_FL; if (ioctl_flags & FS_APPEND_FL)
ubifs_flags |= UBIFS_APPEND_FL; if (ioctl_flags & FS_IMMUTABLE_FL)
ubifs_flags |= UBIFS_IMMUTABLE_FL; if (ioctl_flags & FS_DIRSYNC_FL)
ubifs_flags |= UBIFS_DIRSYNC_FL;
return ubifs_flags;
}
/* * ubifs2ioctl - convert UBIFS inode flags to ioctl inode flags. * @ubifs_flags: flags to convert * * This function converts UBIFS inode flags (@UBIFS_COMPR_FL, etc) to ioctl * flags (@FS_COMPR_FL, etc).
*/ staticint ubifs2ioctl(int ubifs_flags)
{ int ioctl_flags = 0;
if (ubifs_flags & UBIFS_COMPR_FL)
ioctl_flags |= FS_COMPR_FL; if (ubifs_flags & UBIFS_SYNC_FL)
ioctl_flags |= FS_SYNC_FL; if (ubifs_flags & UBIFS_APPEND_FL)
ioctl_flags |= FS_APPEND_FL; if (ubifs_flags & UBIFS_IMMUTABLE_FL)
ioctl_flags |= FS_IMMUTABLE_FL; if (ubifs_flags & UBIFS_DIRSYNC_FL)
ioctl_flags |= FS_DIRSYNC_FL; if (ubifs_flags & UBIFS_CRYPT_FL)
ioctl_flags |= FS_ENCRYPT_FL;
case FS_IOC_GET_ENCRYPTION_POLICY_EX: return fscrypt_ioctl_get_policy_ex(file, (void __user *)arg);
case FS_IOC_ADD_ENCRYPTION_KEY: return fscrypt_ioctl_add_key(file, (void __user *)arg);
case FS_IOC_REMOVE_ENCRYPTION_KEY: return fscrypt_ioctl_remove_key(file, (void __user *)arg);
case FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS: return fscrypt_ioctl_remove_key_all_users(file,
(void __user *)arg); case FS_IOC_GET_ENCRYPTION_KEY_STATUS: return fscrypt_ioctl_get_key_status(file, (void __user *)arg);
case FS_IOC_GET_ENCRYPTION_NONCE: return fscrypt_ioctl_get_nonce(file, (void __user *)arg);
default: return -ENOTTY;
}
}
#ifdef CONFIG_COMPAT long ubifs_compat_ioctl(struct file *file, unsignedint cmd, unsignedlong arg)
{ switch (cmd) { case FS_IOC_SET_ENCRYPTION_POLICY: case FS_IOC_GET_ENCRYPTION_POLICY: case FS_IOC_GET_ENCRYPTION_POLICY_EX: case FS_IOC_ADD_ENCRYPTION_KEY: case FS_IOC_REMOVE_ENCRYPTION_KEY: case FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS: case FS_IOC_GET_ENCRYPTION_KEY_STATUS: case FS_IOC_GET_ENCRYPTION_NONCE: break; default: return -ENOIOCTLCMD;
} return ubifs_ioctl(file, cmd, (unsignedlong)compat_ptr(arg));
} #endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.