loader: use new dentry manipulation interface 29/191029/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 28 Sep 2018 14:42:58 +0000 (17:42 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 11 Oct 2018 18:51:56 +0000 (21:51 +0300)
Change-Id: Ibc5e1a3264f8e7ed8bff50366ace22e11725bae9
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
modules/loader/loader_debugfs.c
modules/loader/loader_storage.c

index 6d7b3ffce16598716ec5f71c4c980c7cba57e0f8..094148e4537b79285b91fa756efee7a118ddd9f3 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/limits.h>
 #include <linux/uaccess.h>
 #include <master/swap_debugfs.h>
-#include <us_manager/us_common_file.h>
+#include <us_manager/swap_dcache.h>
 #include "loader_defs.h"
 #include "loader_debugfs.h"
 #include "loader_module.h"
@@ -49,7 +49,7 @@ static void set_loader_file(char *path)
 {
        __loader_info.path = path;
        dentry_lock();
-       __loader_info.dentry = swap_get_dentry(__loader_info.path);
+       __loader_info.dentry = swap_dget_by_path(__loader_info.path);
        dentry_unlock();
 }
 
@@ -77,12 +77,9 @@ static void clean_loader_info(void)
        __loader_info.path = NULL;
 
        dentry_lock();
-       if (__loader_info.dentry != NULL)
-               swap_put_dentry(__loader_info.dentry);
-
+       swap_dput(__loader_info.dentry);
        __loader_info.dentry = NULL;
        __loader_info.offset = 0;
-
        dentry_unlock();
 }
 
index 2be688e2a72001ff0f6f46e5d6baaa5ec0e612d7..88ac03bd875c5b3bfe8c30a524a8410644ce0cd1 100644 (file)
@@ -4,7 +4,7 @@
 #include <linux/fs.h>
 #include <linux/list.h>
 #include <ks_features/ks_map.h>
-#include <us_manager/us_common_file.h>
+#include <us_manager/swap_dcache.h>
 #include "loader_defs.h"
 #include "loader_module.h"
 #include "loader_storage.h"
@@ -37,7 +37,7 @@ static inline int __add_handler(const char *path)
        struct bin_info_el *bin;
        int ret = 0;
 
-       dentry = swap_get_dentry(path);
+       dentry = swap_dget_by_path(path);
        if (!dentry) {
                ret = -ENOENT;
                goto add_handler_out;
@@ -72,7 +72,7 @@ add_handler_fail_free_bin:
        kfree(bin);
 
 add_handler_fail_release_dentry:
-       swap_put_dentry(dentry);
+       swap_dput(dentry);
 
 add_handler_out:
        return ret;
@@ -81,7 +81,7 @@ add_handler_out:
 static inline void __remove_handler(struct bin_info_el *bin)
 {
        list_del(&bin->list);
-       swap_put_dentry(bin->dentry);
+       swap_dput(bin->dentry);
        kfree(bin->path);
        kfree(bin);
 }
@@ -117,7 +117,7 @@ static inline int __init_linker_info(char *path)
                goto init_linker_fail;
        }
 
-       dentry = swap_get_dentry(path);
+       dentry = swap_dget_by_path(path);
        if (!dentry) {
                ret = -ENOENT;
                goto init_linker_fail_free;
@@ -142,8 +142,7 @@ static inline void __drop_linker_info(void)
        kfree(__linker_info.path);
        __linker_info.path = NULL;
 
-       if (__linker_info.dentry)
-               swap_put_dentry(__linker_info.dentry);
+       swap_dput(__linker_info.dentry);
        __linker_info.dentry = NULL;
 }