Whamcloud - gitweb
LU-6142 lustre: remove non-static 'inline' markings.
[fs/lustre-release.git] / lustre / llite / crypto.c
index 110928a..764c9ed 100644 (file)
 
 static int ll_get_context(struct inode *inode, void *ctx, size_t len)
 {
-       struct dentry *dentry;
+       struct dentry *dentry = d_find_any_alias(inode);
        int rc;
 
-       if (hlist_empty(&inode->i_dentry))
-               return -ENODATA;
-
-       hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
-               break;
-       }
-
        rc = ll_vfs_getxattr(dentry, inode, LL_XATTR_NAME_ENCRYPTION_CONTEXT,
                             ctx, len);
+       if (dentry)
+               dput(dentry);
 
        /* used as encryption unit size */
        if (S_ISREG(inode->i_mode))
@@ -118,13 +113,13 @@ static int ll_set_context(struct inode *inode, const void *ctx, size_t len,
        return ll_set_encflags(inode, (void *)ctx, len, false);
 }
 
-inline void llcrypt_free_ctx(void *encctx, __u32 size)
+void llcrypt_free_ctx(void *encctx, __u32 size)
 {
        if (encctx)
                OBD_FREE(encctx, size);
 }
 
-inline bool ll_sbi_has_test_dummy_encryption(struct ll_sb_info *sbi)
+bool ll_sbi_has_test_dummy_encryption(struct ll_sb_info *sbi)
 {
        return unlikely(sbi->ll_flags & LL_SBI_TEST_DUMMY_ENCRYPTION);
 }
@@ -136,12 +131,12 @@ static bool ll_dummy_context(struct inode *inode)
        return sbi ? ll_sbi_has_test_dummy_encryption(sbi) : false;
 }
 
-inline bool ll_sbi_has_encrypt(struct ll_sb_info *sbi)
+bool ll_sbi_has_encrypt(struct ll_sb_info *sbi)
 {
        return sbi->ll_flags & LL_SBI_ENCRYPT;
 }
 
-inline void ll_sbi_set_encrypt(struct ll_sb_info *sbi, bool set)
+void ll_sbi_set_encrypt(struct ll_sb_info *sbi, bool set)
 {
        if (set)
                sbi->ll_flags |= LL_SBI_ENCRYPT;
@@ -177,21 +172,21 @@ int ll_set_encflags(struct inode *inode, void *encctx, __u32 encctxlen,
        return 0;
 }
 
-inline void llcrypt_free_ctx(void *encctx, __u32 size)
+void llcrypt_free_ctx(void *encctx, __u32 size)
 {
 }
 
-inline bool ll_sbi_has_test_dummy_encryption(struct ll_sb_info *sbi)
+bool ll_sbi_has_test_dummy_encryption(struct ll_sb_info *sbi)
 {
        return false;
 }
 
-inline bool ll_sbi_has_encrypt(struct ll_sb_info *sbi)
+bool ll_sbi_has_encrypt(struct ll_sb_info *sbi)
 {
        return false;
 }
 
-inline void ll_sbi_set_encrypt(struct ll_sb_info *sbi, bool set)
+void ll_sbi_set_encrypt(struct ll_sb_info *sbi, bool set)
 {
 }
 #endif