Skip to content

Commit 1ee7787

Browse files
ubifs: Constify struct inode pointer in ubifs_crypt_is_encrypted()
...and provide a non const variant for fscrypto Signed-off-by: Richard Weinberger <[email protected]>
1 parent f1f52d6 commit 1ee7787

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

fs/ubifs/crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct fscrypt_operations ubifs_crypt_operations = {
3939
.flags = FS_CFLG_INPLACE_ENCRYPTION,
4040
.get_context = ubifs_crypt_get_context,
4141
.set_context = ubifs_crypt_set_context,
42-
.is_encrypted = ubifs_crypt_is_encrypted,
42+
.is_encrypted = __ubifs_crypt_is_encrypted,
4343
.empty_dir = ubifs_crypt_empty_dir,
4444
.max_namelen = ubifs_crypt_max_namelen,
4545
.key_prefix = ubifs_key_prefix,

fs/ubifs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi)
20002000

20012001
#ifndef CONFIG_UBIFS_FS_ENCRYPTION
20022002
struct fscrypt_operations ubifs_crypt_operations = {
2003-
.is_encrypted = ubifs_crypt_is_encrypted,
2003+
.is_encrypted = __ubifs_crypt_is_encrypted,
20042004
};
20052005
#endif
20062006

fs/ubifs/ubifs.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,13 +1805,18 @@ extern struct fscrypt_operations ubifs_crypt_operations;
18051805
#define fscrypt_fname_usr_to_disk fscrypt_notsupp_fname_usr_to_disk
18061806
#endif
18071807

1808-
static inline bool ubifs_crypt_is_encrypted(struct inode *inode)
1808+
static inline bool __ubifs_crypt_is_encrypted(struct inode *inode)
18091809
{
18101810
struct ubifs_inode *ui = ubifs_inode(inode);
18111811

18121812
return ui->flags & UBIFS_CRYPT_FL;
18131813
}
18141814

1815+
static inline bool ubifs_crypt_is_encrypted(const struct inode *inode)
1816+
{
1817+
return __ubifs_crypt_is_encrypted((struct inode *)inode);
1818+
}
1819+
18151820
/* Normal UBIFS messages */
18161821
__printf(2, 3)
18171822
void ubifs_msg(const struct ubifs_info *c, const char *fmt, ...);

0 commit comments

Comments
 (0)