• Home
  • Raw
  • Download

Lines Matching full:key

24  * This header contains various key-related definitions and helper function.
25 * UBIFS allows several key schemes, so we access key fields only via these
26 * helpers. At the moment only one key scheme is supported.
28 * Simple key scheme
32 * in case of direntry key). Next 3 bits are node type. The last 29 bits are
38 * Lot's of the key helpers require a struct ubifs_info *c as the first parameter.
40 * different c->key_format. But right now, there is only one key type, UBIFS_SIMPLE_KEY_FMT.
97 * ino_key_init - initialize inode key.
99 * @key: key to initialize
103 union ubifs_key *key, ino_t inum) in ino_key_init() argument
105 key->u32[0] = inum; in ino_key_init()
106 key->u32[1] = UBIFS_INO_KEY << UBIFS_S_KEY_BLOCK_BITS; in ino_key_init()
110 * ino_key_init_flash - initialize on-flash inode key.
112 * @k: key to initialize
118 union ubifs_key *key = k; in ino_key_init_flash() local
120 key->j32[0] = cpu_to_le32(inum); in ino_key_init_flash()
121 key->j32[1] = cpu_to_le32(UBIFS_INO_KEY << UBIFS_S_KEY_BLOCK_BITS); in ino_key_init_flash()
126 * lowest_ino_key - get the lowest possible inode key.
128 * @key: key to initialize
132 union ubifs_key *key, ino_t inum) in lowest_ino_key() argument
134 key->u32[0] = inum; in lowest_ino_key()
135 key->u32[1] = 0; in lowest_ino_key()
139 * highest_ino_key - get the highest possible inode key.
141 * @key: key to initialize
145 union ubifs_key *key, ino_t inum) in highest_ino_key() argument
147 key->u32[0] = inum; in highest_ino_key()
148 key->u32[1] = 0xffffffff; in highest_ino_key()
152 * dent_key_init - initialize directory entry key.
154 * @key: key to initialize
159 union ubifs_key *key, ino_t inum, in dent_key_init() argument
166 key->u32[0] = inum; in dent_key_init()
167 key->u32[1] = hash | (UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS); in dent_key_init()
171 * dent_key_init_hash - initialize directory entry key without re-calculating
174 * @key: key to initialize
179 union ubifs_key *key, ino_t inum, in dent_key_init_hash() argument
183 key->u32[0] = inum; in dent_key_init_hash()
184 key->u32[1] = hash | (UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS); in dent_key_init_hash()
188 * dent_key_init_flash - initialize on-flash directory entry key.
190 * @k: key to initialize
198 union ubifs_key *key = k; in dent_key_init_flash() local
202 key->j32[0] = cpu_to_le32(inum); in dent_key_init_flash()
203 key->j32[1] = cpu_to_le32(hash | in dent_key_init_flash()
209 * lowest_dent_key - get the lowest possible directory entry key.
211 * @key: where to store the lowest key
215 union ubifs_key *key, ino_t inum) in lowest_dent_key() argument
217 key->u32[0] = inum; in lowest_dent_key()
218 key->u32[1] = UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS; in lowest_dent_key()
222 * xent_key_init - initialize extended attribute entry key.
224 * @key: key to initialize
229 union ubifs_key *key, ino_t inum, in xent_key_init() argument
235 key->u32[0] = inum; in xent_key_init()
236 key->u32[1] = hash | (UBIFS_XENT_KEY << UBIFS_S_KEY_HASH_BITS); in xent_key_init()
240 * xent_key_init_flash - initialize on-flash extended attribute entry key.
242 * @k: key to initialize
249 union ubifs_key *key = k; in xent_key_init_flash() local
253 key->j32[0] = cpu_to_le32(inum); in xent_key_init_flash()
254 key->j32[1] = cpu_to_le32(hash | in xent_key_init_flash()
260 * lowest_xent_key - get the lowest possible extended attribute entry key.
262 * @key: where to store the lowest key
266 union ubifs_key *key, ino_t inum) in lowest_xent_key() argument
268 key->u32[0] = inum; in lowest_xent_key()
269 key->u32[1] = UBIFS_XENT_KEY << UBIFS_S_KEY_HASH_BITS; in lowest_xent_key()
273 * data_key_init - initialize data key.
275 * @key: key to initialize
280 union ubifs_key *key, ino_t inum, in data_key_init() argument
284 key->u32[0] = inum; in data_key_init()
285 key->u32[1] = block | (UBIFS_DATA_KEY << UBIFS_S_KEY_BLOCK_BITS); in data_key_init()
289 * highest_data_key - get the highest possible data key for an inode.
291 * @key: key to initialize
295 union ubifs_key *key, ino_t inum) in highest_data_key() argument
297 data_key_init(c, key, inum, UBIFS_S_KEY_BLOCK_MASK); in highest_data_key()
301 * trun_key_init - initialize truncation node key.
303 * @key: key to initialize
310 union ubifs_key *key, ino_t inum) in trun_key_init() argument
312 key->u32[0] = inum; in trun_key_init()
313 key->u32[1] = UBIFS_TRUN_KEY << UBIFS_S_KEY_BLOCK_BITS; in trun_key_init()
317 * invalid_key_init - initialize invalid node key.
319 * @key: key to initialize
321 * This is a helper function which marks a @key object as invalid.
324 union ubifs_key *key) in invalid_key_init() argument
326 key->u32[0] = 0xDEADBEAF; in invalid_key_init()
327 key->u32[1] = UBIFS_INVALID_KEY; in invalid_key_init()
331 * key_type - get key type.
333 * @key: key to get type of
336 const union ubifs_key *key) in key_type() argument
338 return key->u32[1] >> UBIFS_S_KEY_BLOCK_BITS; in key_type()
342 * key_type_flash - get type of a on-flash formatted key.
344 * @k: key to get type of
348 const union ubifs_key *key = k; in key_type_flash() local
350 return le32_to_cpu(key->j32[1]) >> UBIFS_S_KEY_BLOCK_BITS; in key_type_flash()
354 * key_inum - fetch inode number from key.
356 * @k: key to fetch inode number from
360 const union ubifs_key *key = k; in key_inum() local
362 return key->u32[0]; in key_inum()
366 * key_inum_flash - fetch inode number from an on-flash formatted key.
368 * @k: key to fetch inode number from
372 const union ubifs_key *key = k; in key_inum_flash() local
374 return le32_to_cpu(key->j32[0]); in key_inum_flash()
380 * @key: the key to get hash from
383 const union ubifs_key *key) in key_hash() argument
385 return key->u32[1] & UBIFS_S_KEY_HASH_MASK; in key_hash()
389 * key_hash_flash - get directory entry hash from an on-flash formatted key.
391 * @k: the key to get hash from
395 const union ubifs_key *key = k; in key_hash_flash() local
397 return le32_to_cpu(key->j32[1]) & UBIFS_S_KEY_HASH_MASK; in key_hash_flash()
403 * @key: the key to get the block number from
406 const union ubifs_key *key) in key_block() argument
408 return key->u32[1] & UBIFS_S_KEY_BLOCK_MASK; in key_block()
412 * key_block_flash - get data block number from an on-flash formatted key.
414 * @k: the key to get the block number from
419 const union ubifs_key *key = k; in key_block_flash() local
421 return le32_to_cpu(key->j32[1]) & UBIFS_S_KEY_BLOCK_MASK; in key_block_flash()
425 * key_read - transform a key to in-memory format.
427 * @from: the key to transform
428 * @to: the key to store the result
440 * key_write - transform a key from in-memory format.
442 * @from: the key to transform
443 * @to: the key to store the result
456 * key_write_idx - transform a key from in-memory format for the index.
458 * @from: the key to transform
459 * @to: the key to store the result
471 * key_copy - copy a key.
473 * @from: the key to copy from
474 * @to: the key to copy to
485 * @key1: the first key to compare
486 * @key2: the second key to compare
510 * @key1: the first key to compare
511 * @key2: the second key to compare
528 * is_hash_key - is a key vulnerable to hash collisions.
530 * @key: key
532 * This function returns %1 if @key is a hashed key or %0 otherwise.
535 const union ubifs_key *key) in is_hash_key() argument
537 int type = key_type(c, key); in is_hash_key()
543 * key_max_inode_size - get maximum file size allowed by current key format.