]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/ubifs/key.h
UBIFS: add inode size debugging check
[net-next-2.6.git] / fs / ubifs / key.h
index 919af84b9e173aaee594271d6ba68ff0232f23ec..0f530c684f0ba13c99c1424c6614d54f0f3ae23b 100644 (file)
@@ -277,6 +277,18 @@ static inline void data_key_init(const struct ubifs_info *c,
        key->u32[1] = block | (UBIFS_DATA_KEY << UBIFS_S_KEY_BLOCK_BITS);
 }
 
+/**
+ * highest_data_key - get the highest possible data key for an inode.
+ * @c: UBIFS file-system description object
+ * @key: key to initialize
+ * @inum: inode number
+ */
+static inline void highest_data_key(const struct ubifs_info *c,
+                                  union ubifs_key *key, ino_t inum)
+{
+       data_key_init(c, key, inum, UBIFS_S_KEY_BLOCK_MASK);
+}
+
 /**
  * trun_key_init - initialize truncation node key.
  * @c: UBIFS file-system description object
@@ -518,4 +530,5 @@ static inline unsigned long long key_max_inode_size(const struct ubifs_info *c)
                return 0;
        }
 }
+
 #endif /* !__UBIFS_KEY_H__ */