summaryrefslogtreecommitdiff
path: root/security/pfe/pfk.c
diff options
context:
space:
mode:
authorAndrey Markovytch <andreym@codeaurora.org>2016-02-02 21:15:00 +0200
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:24:10 -0700
commitaaf495b3ab5c8476bffdd2d1e4ec3157268647c1 (patch)
tree2762ebbddd3544fc2672c3012fc84800f4bcdc45 /security/pfe/pfk.c
parent5c84da193d13761baf6d6f6f9189142959db1c5a (diff)
pfk: added some additional debug prints
Also added useful function for translation between inode to filename Change-Id: If0d5db3545a71c85223ef53980ee61f9dbd002d9 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
Diffstat (limited to 'security/pfe/pfk.c')
-rw-r--r--security/pfe/pfk.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/security/pfe/pfk.c b/security/pfe/pfk.c
index f56e490a0ae8..911012eeb570 100644
--- a/security/pfe/pfk.c
+++ b/security/pfe/pfk.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -66,6 +66,29 @@ static int g_events_handle;
#define PFK_SUPPORTED_KEY_SIZE 32
#define PFK_SUPPORTED_SALT_SIZE 32
+
+/**
+ * inode_to_filename() - get the filename from inode pointer.
+ * @inode: inode pointer
+ *
+ * it is used for debug prints.
+ *
+ * Return: filename string or "unknown".
+ */
+static char *inode_to_filename(struct inode *inode)
+{
+ struct dentry *dentry = NULL;
+ char *filename = NULL;
+
+ if (hlist_empty(&inode->i_dentry))
+ return "unknown";
+
+ dentry = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);
+ filename = dentry->d_iname;
+
+ return filename;
+}
+
static int pfk_inode_alloc_security(struct inode *inode)
{
struct inode_security_struct *i_sec = NULL;
@@ -359,6 +382,8 @@ int pfk_load_key(const struct bio *bio, struct ice_crypto_setting *ice_setting)
goto end;
}
+ pr_debug("loading key for file %s\n", inode_to_filename(inode));
+
ret = pfk_get_page_index(bio, &offset);
if (ret != 0) {
pr_err("could not get page index from bio, probably bug %d\n",