Lines Matching refs:policy
33 struct inode *inode, const struct f2fs_encryption_policy *policy) in f2fs_is_encryption_context_consistent_with_policy() argument
43 return (memcmp(ctx.master_key_descriptor, policy->master_key_descriptor, in f2fs_is_encryption_context_consistent_with_policy()
45 (ctx.flags == policy->flags) && in f2fs_is_encryption_context_consistent_with_policy()
47 policy->contents_encryption_mode) && in f2fs_is_encryption_context_consistent_with_policy()
49 policy->filenames_encryption_mode)); in f2fs_is_encryption_context_consistent_with_policy()
53 struct inode *inode, const struct f2fs_encryption_policy *policy) in f2fs_create_encryption_context_from_policy() argument
58 memcpy(ctx.master_key_descriptor, policy->master_key_descriptor, in f2fs_create_encryption_context_from_policy()
61 if (!f2fs_valid_contents_enc_mode(policy->contents_encryption_mode)) { in f2fs_create_encryption_context_from_policy()
64 policy->contents_encryption_mode); in f2fs_create_encryption_context_from_policy()
68 if (!f2fs_valid_filenames_enc_mode(policy->filenames_encryption_mode)) { in f2fs_create_encryption_context_from_policy()
71 policy->filenames_encryption_mode); in f2fs_create_encryption_context_from_policy()
75 if (policy->flags & ~F2FS_POLICY_FLAGS_VALID) in f2fs_create_encryption_context_from_policy()
78 ctx.contents_encryption_mode = policy->contents_encryption_mode; in f2fs_create_encryption_context_from_policy()
79 ctx.filenames_encryption_mode = policy->filenames_encryption_mode; in f2fs_create_encryption_context_from_policy()
80 ctx.flags = policy->flags; in f2fs_create_encryption_context_from_policy()
89 int f2fs_process_policy(const struct f2fs_encryption_policy *policy, in f2fs_process_policy() argument
92 if (policy->version != 0) in f2fs_process_policy()
102 policy); in f2fs_process_policy()
105 if (f2fs_is_encryption_context_consistent_with_policy(inode, policy)) in f2fs_process_policy()
113 int f2fs_get_policy(struct inode *inode, struct f2fs_encryption_policy *policy) in f2fs_get_policy() argument
129 policy->version = 0; in f2fs_get_policy()
130 policy->contents_encryption_mode = ctx.contents_encryption_mode; in f2fs_get_policy()
131 policy->filenames_encryption_mode = ctx.filenames_encryption_mode; in f2fs_get_policy()
132 policy->flags = ctx.flags; in f2fs_get_policy()
133 memcpy(&policy->master_key_descriptor, ctx.master_key_descriptor, in f2fs_get_policy()