ReactOS  0.4.14-dev-77-gd9e7c48
fs.h File Reference
#include <linux/types.h>
#include <linux/atomic.h>
#include <linux/rbtree.h>
Include dependency graph for fs.h:

Go to the source code of this file.

Classes

struct  super_block
 
struct  inode
 
struct  dentry
 
struct  file
 

Macros

#define NODEV   0
 
#define MINORBITS   8
 
#define MINORMASK   ((1U << MINORBITS) - 1)
 
#define MAJOR(dev)   ((unsigned int)((int)(dev) >> MINORBITS))
 
#define MINOR(dev)   ((unsigned int)((int)(dev) & MINORMASK))
 
#define NODEV   0
 
#define MKDEV(ma, mi)   (((ma) << MINORBITS) | (mi))
 
#define I_DIRTY_SYNC   1 /* Not dirty enough for O_DATASYNC */
 
#define I_DIRTY_DATASYNC   2 /* Data-related inode changes pending */
 
#define I_DIRTY_PAGES   4 /* Data-related inode changes pending */
 
#define I_LOCK   8
 
#define I_FREEING   16
 
#define I_CLEAR   32
 
#define I_DIRTY   (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
 
#define DT_UNKNOWN   0
 
#define DT_FIFO   1
 
#define DT_CHR   2
 
#define DT_DIR   4
 
#define DT_BLK   6
 
#define DT_REG   8
 
#define DT_LNK   10
 
#define DT_SOCK   12
 
#define DT_WHT   14
 

Typedefs

typedef struct block_devicekdev_t
 

Functions

static unsigned int kdev_t_to_nr (kdev_t dev)
 
static kdev_t to_kdev_t (int dev)
 
void iget (struct inode *inode)
 
void iput (struct inode *inode)
 
ULONGLONG bmap (struct inode *i, ULONGLONG b)
 

Macro Definition Documentation

◆ DT_BLK

#define DT_BLK   6

Definition at line 150 of file fs.h.

◆ DT_CHR

#define DT_CHR   2

Definition at line 148 of file fs.h.

◆ DT_DIR

#define DT_DIR   4

Definition at line 149 of file fs.h.

◆ DT_FIFO

#define DT_FIFO   1

Definition at line 147 of file fs.h.

◆ DT_LNK

#define DT_LNK   10

Definition at line 152 of file fs.h.

◆ DT_REG

#define DT_REG   8

Definition at line 151 of file fs.h.

◆ DT_SOCK

#define DT_SOCK   12

Definition at line 153 of file fs.h.

◆ DT_UNKNOWN

#define DT_UNKNOWN   0

Definition at line 146 of file fs.h.

◆ DT_WHT

#define DT_WHT   14

Definition at line 154 of file fs.h.

◆ I_CLEAR

#define I_CLEAR   32

Definition at line 112 of file fs.h.

◆ I_DIRTY

Definition at line 114 of file fs.h.

◆ I_DIRTY_DATASYNC

#define I_DIRTY_DATASYNC   2 /* Data-related inode changes pending */

Definition at line 108 of file fs.h.

◆ I_DIRTY_PAGES

#define I_DIRTY_PAGES   4 /* Data-related inode changes pending */

Definition at line 109 of file fs.h.

◆ I_DIRTY_SYNC

#define I_DIRTY_SYNC   1 /* Not dirty enough for O_DATASYNC */

Definition at line 107 of file fs.h.

◆ I_FREEING

#define I_FREEING   16

Definition at line 111 of file fs.h.

◆ I_LOCK

#define I_LOCK   8

Definition at line 110 of file fs.h.

◆ MAJOR

#define MAJOR (   dev)    ((unsigned int)((int)(dev) >> MINORBITS))

Definition at line 19 of file fs.h.

◆ MINOR

#define MINOR (   dev)    ((unsigned int)((int)(dev) & MINORMASK))

Definition at line 20 of file fs.h.

◆ MINORBITS

#define MINORBITS   8

Definition at line 16 of file fs.h.

◆ MINORMASK

#define MINORMASK   ((1U << MINORBITS) - 1)

Definition at line 17 of file fs.h.

◆ MKDEV

#define MKDEV (   ma,
  mi 
)    (((ma) << MINORBITS) | (mi))

Definition at line 28 of file fs.h.

◆ NODEV [1/2]

#define NODEV   0

Definition at line 27 of file fs.h.

◆ NODEV [2/2]

#define NODEV   0

Definition at line 27 of file fs.h.

Typedef Documentation

◆ kdev_t

Definition at line 14 of file fs.h.

Function Documentation

◆ bmap()

ULONGLONG bmap ( struct inode i,
ULONGLONG  b 
)

Definition at line 934 of file linux.c.

935 {
936  ULONGLONG lcn = 0;
937  struct super_block *s = i->i_sb;
938 
939  PEXT2_MCB Mcb = (PEXT2_MCB)i->i_priv;
940  PEXT2_VCB Vcb = (PEXT2_VCB)s->s_priv;
944 
945  if (!Mcb || !Vcb) {
946  goto errorout;
947  }
948 
949  offset <<= BLOCK_BITS;
951  NULL,
952  Vcb,
953  Mcb,
954  offset,
955  BLOCK_SIZE,
956  FALSE,
957  &extent
958  );
959 
960  if (!NT_SUCCESS(status)) {
961  goto errorout;
962  }
963 
964  if (extent == NULL) {
965  goto errorout;
966  }
967 
968  lcn = (unsigned long)(extent->Lba >> BLOCK_BITS);
969 
970 errorout:
971 
972  if (extent) {
974  }
975 
976  return lcn;
977 }
Definition: fs.h:64
LONG NTSTATUS
Definition: precomp.h:26
GLintptr offset
Definition: glext.h:5920
NTSTATUS Ext2BuildExtents(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_MCB Mcb, IN ULONGLONG Offset, IN ULONG Size, IN BOOLEAN bAlloc, OUT PEXT2_EXTENT *Chain)
Definition: memory.c:1207
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define BLOCK_BITS
Definition: stream.h:22
smooth NULL
Definition: ftsmooth.c:416
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define BLOCK_SIZE
Definition: dlist.c:220
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
uint64_t ULONGLONG
Definition: typedefs.h:65
#define Vcb
Definition: cdprocs.h:1425
VOID Ext2FreeExtent(IN PEXT2_EXTENT Extent)
Definition: memory.c:505
GLdouble s
Definition: gl.h:2039
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:334
#define long
Definition: qsort.c:33
struct _EXT2_MCB * PEXT2_MCB
Definition: ext2fs.h:479
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by ext2_allocate_group_table(), and journal_bmap().

◆ iget()

void iget ( struct inode inode)

Definition at line 979 of file linux.c.

980 {
982 }
atomic_t i_count
Definition: fs.h:90
Definition: fs.h:78
static void atomic_inc(atomic_t volatile *v)
Definition: atomic.h:95

◆ iput()

void iput ( struct inode inode)

Definition at line 984 of file linux.c.

985 {
987  kfree(inode);
988  }
989 }
atomic_t i_count
Definition: fs.h:90
Definition: fs.h:78
static int atomic_dec_and_test(atomic_t volatile *v)
Definition: atomic.h:121
void kfree(const void *)

Referenced by Ext2RecoverJournal(), and journal_destroy().

◆ kdev_t_to_nr()

static unsigned int kdev_t_to_nr ( kdev_t  dev)
inlinestatic

Definition at line 22 of file fs.h.

22  {
23  /*return (unsigned int)(MAJOR(dev)<<8) | MINOR(dev);*/
24  return 0;
25 }

◆ to_kdev_t()

static kdev_t to_kdev_t ( int  dev)
inlinestatic

Definition at line 30 of file fs.h.

31 {
32 #if 0
33  int major, minor;
34 #if 0
35  major = (dev >> 16);
36  if (!major) {
37  major = (dev >> 8);
38  minor = (dev & 0xff);
39  } else
40  minor = (dev & 0xffff);
41 #else
42  major = (dev >> 8);
43  minor = (dev & 0xff);
44 #endif
45  return (kdev_t) MKDEV(major, minor);
46 #endif
47  return 0;
48 }
#define MKDEV(ma, mi)
Definition: fs.h:28
#define major(rdev)
Definition: propsheet.cpp:879
#define minor(rdev)
Definition: propsheet.cpp:880