us_manager: add automatic dentry capture 26/191026/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 25 Sep 2018 18:30:28 +0000 (21:30 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 11 Oct 2018 18:47:50 +0000 (21:47 +0300)
Don't wait pf_unregister_probe() call after pf_register_probe()
one to release dentry because dentry is captured and released
automatically.

Change-Id: Ia2cc749487a7dc815d1a26205771011a0cac4108
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
modules/us_manager/img/img_file.c

index ea8d094301113952f1b26796b2bc4adc14424390..f1bdc28560b2b82186e86989d6497d0cea717a65 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/slab.h>
 #include <linux/dcache.h>
 #include <linux/atomic.h>
+#include <us_manager/swap_dcache.h>
 
 
 static atomic_t file_counter = ATOMIC_INIT(0);
@@ -53,7 +54,7 @@ struct img_file *img_file_create(struct dentry *dentry)
        }
        atomic_inc(&file_counter);
 
-       file->dentry = dentry;
+       file->dentry = swap_dget(dentry);
        INIT_LIST_HEAD(&file->list);
        INIT_LIST_HEAD(&file->ips.head);
        mutex_init(&file->ips.mtx);
@@ -79,6 +80,7 @@ static void img_file_free(struct img_file *file)
        }
 
        atomic_dec(&file_counter);
+       swap_dput(file->dentry);
        kfree(file);
 }