Lines Matching +full:1 +full:c

5  * Copyright (C) 2006-2008 Nokia Corporation.
26 * Lot's of the key helpers require a struct ubifs_info *c as the first parameter.
28 * different c->key_format. But right now, there is only one key type, UBIFS_SIMPLE_KEY_FMT.
38 * We use hash values as offset in directories, so values %0 and %1 are
86 * @c: UBIFS file-system description object
90 static inline void ino_key_init(const struct ubifs_info *c, in ino_key_init() argument
94 key->u32[1] = UBIFS_INO_KEY << UBIFS_S_KEY_BLOCK_BITS; in ino_key_init()
99 * @c: UBIFS file-system description object
103 static inline void ino_key_init_flash(const struct ubifs_info *c, void *k, in ino_key_init_flash() argument
109 key->j32[1] = cpu_to_le32(UBIFS_INO_KEY << UBIFS_S_KEY_BLOCK_BITS); in ino_key_init_flash()
115 * @c: UBIFS file-system description object
119 static inline void lowest_ino_key(const struct ubifs_info *c, in lowest_ino_key() argument
123 key->u32[1] = 0; in lowest_ino_key()
128 * @c: UBIFS file-system description object
132 static inline void highest_ino_key(const struct ubifs_info *c, in highest_ino_key() argument
136 key->u32[1] = 0xffffffff; in highest_ino_key()
141 * @c: UBIFS file-system description object
146 static inline void dent_key_init(const struct ubifs_info *c, in dent_key_init() argument
150 uint32_t hash = c->key_hash(fname_name(nm), fname_len(nm)); in dent_key_init()
152 ubifs_assert(c, !(hash & ~UBIFS_S_KEY_HASH_MASK)); in dent_key_init()
154 key->u32[1] = hash | (UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS); in dent_key_init()
160 * @c: UBIFS file-system description object
165 static inline void dent_key_init_hash(const struct ubifs_info *c, in dent_key_init_hash() argument
169 ubifs_assert(c, !(hash & ~UBIFS_S_KEY_HASH_MASK)); in dent_key_init_hash()
171 key->u32[1] = hash | (UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS); in dent_key_init_hash()
176 * @c: UBIFS file-system description object
181 static inline void dent_key_init_flash(const struct ubifs_info *c, void *k, in dent_key_init_flash() argument
186 uint32_t hash = c->key_hash(fname_name(nm), fname_len(nm)); in dent_key_init_flash()
188 ubifs_assert(c, !(hash & ~UBIFS_S_KEY_HASH_MASK)); in dent_key_init_flash()
190 key->j32[1] = cpu_to_le32(hash | in dent_key_init_flash()
197 * @c: UBIFS file-system description object
201 static inline void lowest_dent_key(const struct ubifs_info *c, in lowest_dent_key() argument
205 key->u32[1] = UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS; in lowest_dent_key()
210 * @c: UBIFS file-system description object
215 static inline void xent_key_init(const struct ubifs_info *c, in xent_key_init() argument
219 uint32_t hash = c->key_hash(fname_name(nm), fname_len(nm)); in xent_key_init()
221 ubifs_assert(c, !(hash & ~UBIFS_S_KEY_HASH_MASK)); in xent_key_init()
223 key->u32[1] = hash | (UBIFS_XENT_KEY << UBIFS_S_KEY_HASH_BITS); in xent_key_init()
228 * @c: UBIFS file-system description object
233 static inline void xent_key_init_flash(const struct ubifs_info *c, void *k, in xent_key_init_flash() argument
237 uint32_t hash = c->key_hash(fname_name(nm), fname_len(nm)); in xent_key_init_flash()
239 ubifs_assert(c, !(hash & ~UBIFS_S_KEY_HASH_MASK)); in xent_key_init_flash()
241 key->j32[1] = cpu_to_le32(hash | in xent_key_init_flash()
248 * @c: UBIFS file-system description object
252 static inline void lowest_xent_key(const struct ubifs_info *c, in lowest_xent_key() argument
256 key->u32[1] = UBIFS_XENT_KEY << UBIFS_S_KEY_HASH_BITS; in lowest_xent_key()
261 * @c: UBIFS file-system description object
266 static inline void data_key_init(const struct ubifs_info *c, in data_key_init() argument
270 ubifs_assert(c, !(block & ~UBIFS_S_KEY_BLOCK_MASK)); in data_key_init()
272 key->u32[1] = block | (UBIFS_DATA_KEY << UBIFS_S_KEY_BLOCK_BITS); in data_key_init()
277 * @c: UBIFS file-system description object
281 static inline void highest_data_key(const struct ubifs_info *c, in highest_data_key() argument
284 data_key_init(c, key, inum, UBIFS_S_KEY_BLOCK_MASK); in highest_data_key()
289 * @c: UBIFS file-system description object
296 static inline void trun_key_init(const struct ubifs_info *c, in trun_key_init() argument
300 key->u32[1] = UBIFS_TRUN_KEY << UBIFS_S_KEY_BLOCK_BITS; in trun_key_init()
305 * @c: UBIFS file-system description object
310 static inline void invalid_key_init(const struct ubifs_info *c, in invalid_key_init() argument
314 key->u32[1] = UBIFS_INVALID_KEY; in invalid_key_init()
319 * @c: UBIFS file-system description object
322 static inline int key_type(const struct ubifs_info *c, in key_type() argument
325 return key->u32[1] >> UBIFS_S_KEY_BLOCK_BITS; in key_type()
330 * @c: UBIFS file-system description object
333 static inline int key_type_flash(const struct ubifs_info *c, const void *k) in key_type_flash() argument
337 return le32_to_cpu(key->j32[1]) >> UBIFS_S_KEY_BLOCK_BITS; in key_type_flash()
342 * @c: UBIFS file-system description object
345 static inline ino_t key_inum(const struct ubifs_info *c, const void *k) in key_inum() argument
354 * @c: UBIFS file-system description object
357 static inline ino_t key_inum_flash(const struct ubifs_info *c, const void *k) in key_inum_flash() argument
366 * @c: UBIFS file-system description object
369 static inline uint32_t key_hash(const struct ubifs_info *c, in key_hash() argument
372 return key->u32[1] & UBIFS_S_KEY_HASH_MASK; in key_hash()
377 * @c: UBIFS file-system description object
380 static inline uint32_t key_hash_flash(const struct ubifs_info *c, const void *k) in key_hash_flash() argument
384 return le32_to_cpu(key->j32[1]) & UBIFS_S_KEY_HASH_MASK; in key_hash_flash()
389 * @c: UBIFS file-system description object
392 static inline unsigned int key_block(const struct ubifs_info *c, in key_block() argument
395 return key->u32[1] & UBIFS_S_KEY_BLOCK_MASK; in key_block()
400 * @c: UBIFS file-system description object
403 static inline unsigned int key_block_flash(const struct ubifs_info *c, in key_block_flash() argument
408 return le32_to_cpu(key->j32[1]) & UBIFS_S_KEY_BLOCK_MASK; in key_block_flash()
413 * @c: UBIFS file-system description object
417 static inline void key_read(const struct ubifs_info *c, const void *from, in key_read() argument
423 to->u32[1] = le32_to_cpu(f->j32[1]); in key_read()
428 * @c: UBIFS file-system description object
432 static inline void key_write(const struct ubifs_info *c, in key_write() argument
438 t->j32[1] = cpu_to_le32(from->u32[1]); in key_write()
444 * @c: UBIFS file-system description object
448 static inline void key_write_idx(const struct ubifs_info *c, in key_write_idx() argument
454 t->j32[1] = cpu_to_le32(from->u32[1]); in key_write_idx()
459 * @c: UBIFS file-system description object
463 static inline void key_copy(const struct ubifs_info *c, in key_copy() argument
471 * @c: UBIFS file-system description object
475 * This function compares 2 keys and returns %-1 if @key1 is less than
476 * @key2, %0 if the keys are equivalent and %1 if @key1 is greater than @key2.
478 static inline int keys_cmp(const struct ubifs_info *c, in keys_cmp() argument
483 return -1; in keys_cmp()
485 return 1; in keys_cmp()
486 if (key1->u32[1] < key2->u32[1]) in keys_cmp()
487 return -1; in keys_cmp()
488 if (key1->u32[1] > key2->u32[1]) in keys_cmp()
489 return 1; in keys_cmp()
496 * @c: UBIFS file-system description object
500 * This function compares 2 keys and returns %1 if @key1 is equal to @key2 and
503 static inline int keys_eq(const struct ubifs_info *c, in keys_eq() argument
509 if (key1->u32[1] != key2->u32[1]) in keys_eq()
511 return 1; in keys_eq()
516 * @c: UBIFS file-system description object
519 * This function returns %1 if @key is a hashed key or %0 otherwise.
521 static inline int is_hash_key(const struct ubifs_info *c, in is_hash_key() argument
524 int type = key_type(c, key); in is_hash_key()
531 * @c: UBIFS file-system description object
533 static inline unsigned long long key_max_inode_size(const struct ubifs_info *c) in key_max_inode_size() argument
535 switch (c->key_fmt) { in key_max_inode_size()
537 return (1ULL << UBIFS_S_KEY_BLOCK_BITS) * UBIFS_BLOCK_SIZE; in key_max_inode_size()