ubifs.h (3eb66e91a25497065c5322b1268cbc3953642227) ubifs.h (643fa9612bf1a29153eee46fd398117632f93cbe)
1/*
2 * This file is part of UBIFS.
3 *
4 * Copyright (C) 2006-2008 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.

--- 29 unchanged lines hidden (view full) ---

38#include <linux/backing-dev.h>
39#include <linux/security.h>
40#include <linux/xattr.h>
41#include <linux/random.h>
42#include <crypto/hash_info.h>
43#include <crypto/hash.h>
44#include <crypto/algapi.h>
45
1/*
2 * This file is part of UBIFS.
3 *
4 * Copyright (C) 2006-2008 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.

--- 29 unchanged lines hidden (view full) ---

38#include <linux/backing-dev.h>
39#include <linux/security.h>
40#include <linux/xattr.h>
41#include <linux/random.h>
42#include <crypto/hash_info.h>
43#include <crypto/hash.h>
44#include <crypto/algapi.h>
45
46#define __FS_HAS_ENCRYPTION IS_ENABLED(CONFIG_UBIFS_FS_ENCRYPTION)
47#include <linux/fscrypt.h>
48
49#include "ubifs-media.h"
50
51/* Version of this UBIFS implementation */
52#define UBIFS_VERSION 1
53
54/* UBIFS file system VFS magic number */

--- 82 unchanged lines hidden (view full) ---

137
138/*
139 * Some compressors, like LZO, may end up with more data then the input buffer.
140 * So UBIFS always allocates larger output buffer, to be sure the compressor
141 * will not corrupt memory in case of worst case compression.
142 */
143#define WORST_COMPR_FACTOR 2
144
46#include <linux/fscrypt.h>
47
48#include "ubifs-media.h"
49
50/* Version of this UBIFS implementation */
51#define UBIFS_VERSION 1
52
53/* UBIFS file system VFS magic number */

--- 82 unchanged lines hidden (view full) ---

136
137/*
138 * Some compressors, like LZO, may end up with more data then the input buffer.
139 * So UBIFS always allocates larger output buffer, to be sure the compressor
140 * will not corrupt memory in case of worst case compression.
141 */
142#define WORST_COMPR_FACTOR 2
143
145#ifdef CONFIG_UBIFS_FS_ENCRYPTION
144#ifdef CONFIG_FS_ENCRYPTION
146#define UBIFS_CIPHER_BLOCK_SIZE FS_CRYPTO_BLOCK_SIZE
147#else
148#define UBIFS_CIPHER_BLOCK_SIZE 0
149#endif
150
151/*
152 * How much memory is needed for a buffer where we compress a data node.
153 */

--- 1913 unchanged lines hidden (view full) ---

2067 void *out_buf, int *out_len, int *compr_type);
2068int ubifs_decompress(const struct ubifs_info *c, const void *buf, int len,
2069 void *out, int *out_len, int compr_type);
2070
2071#include "debug.h"
2072#include "misc.h"
2073#include "key.h"
2074
145#define UBIFS_CIPHER_BLOCK_SIZE FS_CRYPTO_BLOCK_SIZE
146#else
147#define UBIFS_CIPHER_BLOCK_SIZE 0
148#endif
149
150/*
151 * How much memory is needed for a buffer where we compress a data node.
152 */

--- 1913 unchanged lines hidden (view full) ---

2066 void *out_buf, int *out_len, int *compr_type);
2067int ubifs_decompress(const struct ubifs_info *c, const void *buf, int len,
2068 void *out, int *out_len, int compr_type);
2069
2070#include "debug.h"
2071#include "misc.h"
2072#include "key.h"
2073
2075#ifndef CONFIG_UBIFS_FS_ENCRYPTION
2074#ifndef CONFIG_FS_ENCRYPTION
2076static inline int ubifs_encrypt(const struct inode *inode,
2077 struct ubifs_data_node *dn,
2078 unsigned int in_len, unsigned int *out_len,
2079 int block)
2080{
2081 struct ubifs_info *c = inode->i_sb->s_fs_info;
2082 ubifs_assert(c, 0);
2083 return -EOPNOTSUPP;

--- 44 unchanged lines hidden ---
2075static inline int ubifs_encrypt(const struct inode *inode,
2076 struct ubifs_data_node *dn,
2077 unsigned int in_len, unsigned int *out_len,
2078 int block)
2079{
2080 struct ubifs_info *c = inode->i_sb->s_fs_info;
2081 ubifs_assert(c, 0);
2082 return -EOPNOTSUPP;

--- 44 unchanged lines hidden ---