@@ -258,13 +258,6 @@ struct ecryptfs_inode_info {
258258 struct ecryptfs_crypt_stat crypt_stat ;
259259};
260260
261- /* dentry private data. Each dentry must keep track of a lower
262- * vfsmount too. */
263- struct ecryptfs_dentry_info {
264- struct path lower_path ;
265- struct rcu_head rcu ;
266- };
267-
268261/**
269262 * ecryptfs_global_auth_tok - A key used to encrypt all new files under the mountpoint
270263 * @flags: Status flags
@@ -348,6 +341,7 @@ struct ecryptfs_mount_crypt_stat {
348341/* superblock private data. */
349342struct ecryptfs_sb_info {
350343 struct super_block * wsi_sb ;
344+ struct vfsmount * lower_mnt ;
351345 struct ecryptfs_mount_crypt_stat mount_crypt_stat ;
352346};
353347
@@ -494,22 +488,25 @@ ecryptfs_set_superblock_lower(struct super_block *sb,
494488}
495489
496490static inline void
497- ecryptfs_set_dentry_private (struct dentry * dentry ,
498- struct ecryptfs_dentry_info * dentry_info )
491+ ecryptfs_set_dentry_lower (struct dentry * dentry ,
492+ struct dentry * lower_dentry )
499493{
500- dentry -> d_fsdata = dentry_info ;
494+ dentry -> d_fsdata = lower_dentry ;
501495}
502496
503497static inline struct dentry *
504498ecryptfs_dentry_to_lower (struct dentry * dentry )
505499{
506- return (( struct ecryptfs_dentry_info * ) dentry -> d_fsdata ) -> lower_path . dentry ;
500+ return dentry -> d_fsdata ;
507501}
508502
509- static inline const struct path *
510- ecryptfs_dentry_to_lower_path (struct dentry * dentry )
503+ static inline struct path
504+ ecryptfs_lower_path (struct dentry * dentry )
511505{
512- return & ((struct ecryptfs_dentry_info * )dentry -> d_fsdata )-> lower_path ;
506+ return (struct path ){
507+ .mnt = ecryptfs_superblock_to_private (dentry -> d_sb )-> lower_mnt ,
508+ .dentry = ecryptfs_dentry_to_lower (dentry )
509+ };
513510}
514511
515512#define ecryptfs_printk (type , fmt , arg ...) \
@@ -532,7 +529,6 @@ extern unsigned int ecryptfs_number_of_users;
532529
533530extern struct kmem_cache * ecryptfs_auth_tok_list_item_cache ;
534531extern struct kmem_cache * ecryptfs_file_info_cache ;
535- extern struct kmem_cache * ecryptfs_dentry_info_cache ;
536532extern struct kmem_cache * ecryptfs_inode_info_cache ;
537533extern struct kmem_cache * ecryptfs_sb_info_cache ;
538534extern struct kmem_cache * ecryptfs_header_cache ;
@@ -557,7 +553,6 @@ int ecryptfs_encrypt_and_encode_filename(
557553 size_t * encoded_name_size ,
558554 struct ecryptfs_mount_crypt_stat * mount_crypt_stat ,
559555 const char * name , size_t name_size );
560- struct dentry * ecryptfs_lower_dentry (struct dentry * this_dentry );
561556void ecryptfs_dump_hex (char * data , int bytes );
562557int virt_to_scatterlist (const void * addr , int size , struct scatterlist * sg ,
563558 int sg_size );
0 commit comments