Blame view

include/linux/ext2_fs.h 967 Bytes
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  /* SPDX-License-Identifier: GPL-2.0 */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  /*
   *  linux/include/linux/ext2_fs.h
   *
   * Copyright (C) 1992, 1993, 1994, 1995
   * Remy Card (card@masi.ibp.fr)
   * Laboratoire MASI - Institut Blaise Pascal
   * Universite Pierre et Marie Curie (Paris VI)
   *
   *  from
   *
   *  linux/include/linux/minix_fs.h
   *
   *  Copyright (C) 1991, 1992  Linus Torvalds
   */
  
  #ifndef _LINUX_EXT2_FS_H
  #define _LINUX_EXT2_FS_H
  
  #include <linux/types.h>
e18fa700c   Jeff Garzik   Move several *_SU...
21
  #include <linux/magic.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22

f7699f2b0   Al Viro   migrate ext2_fs.h...
23
  #define EXT2_NAME_LEN 255
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
24
25
26
27
28
  
  /*
   * Maximal count of links to a file
   */
  #define EXT2_LINK_MAX		32000
39429c5e4   Al Viro   new helper: ext2_...
29
30
31
32
33
34
35
36
37
38
39
40
  #define EXT2_SB_MAGIC_OFFSET	0x38
  #define EXT2_SB_BLOCKS_OFFSET	0x04
  #define EXT2_SB_BSIZE_OFFSET	0x18
  
  static inline u64 ext2_image_size(void *ext2_sb)
  {
  	__u8 *p = ext2_sb;
  	if (*(__le16 *)(p + EXT2_SB_MAGIC_OFFSET) != cpu_to_le16(EXT2_SUPER_MAGIC))
  		return 0;
  	return (u64)le32_to_cpup((__le32 *)(p + EXT2_SB_BLOCKS_OFFSET)) <<
  		le32_to_cpup((__le32 *)(p + EXT2_SB_BSIZE_OFFSET));
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
41
  #endif	/* _LINUX_EXT2_FS_H */