Motr  M0
file_internal.h File Reference

Go to the source code of this file.

Data Structures

struct  nw_xfer_ops
 
struct  nw_xfer_request
 
struct  io_request_ops
 
struct  io_request
 
struct  data_buf
 
struct  pargrp_iomap
 
struct  pargrp_iomap_ops
 
struct  target_ioreq_ops
 
struct  dgmode_rwvec
 
struct  cc_req_fop
 
struct  target_ioreq
 
struct  io_req_fop
 

Macros

#define __MOTR_M0T1FS_FILE_INTERNAL_H__
 

Enumerations

enum  page_attr {
  PA_NONE = 0, PA_READ = (1 << 0), PA_FULLPAGE_MODIFY = (1 << 1), PA_PARTPAGE_MODIFY = (1 << 2),
  PA_WRITE = (1 << 3), PA_DATA = (1 << 4), PA_PARITY = (1 << 5), PA_COPY_FRMUSR_DONE = (1 << 6),
  PA_READ_FAILED = (1 << 7), PA_DGMODE_READ = (1 << 8), PA_DGMODE_WRITE = (1 << 9), PA_NR = 10,
  PA_NONE = 0, PA_READ = (1 << 0), PA_FULLPAGE_MODIFY = (1 << 1), PA_PARTPAGE_MODIFY = (1 << 2),
  PA_WRITE = (1 << 3), PA_DATA = (1 << 4), PA_PARITY = (1 << 5), PA_COPY_FRMUSR_DONE = (1 << 6),
  PA_READ_FAILED = (1 << 7), PA_DGMODE_READ = (1 << 8), PA_DGMODE_WRITE = (1 << 9), PA_APP_MEMORY = (1 << 10),
  PA_TRUNC = (1 << 11), PA_NR = 12
}
 
enum  copy_direction {
  CD_COPY_FROM_USER, CD_COPY_TO_USER, CD_NR, CD_COPY_FROM_APP,
  CD_COPY_TO_APP
}
 
enum  nw_xfer_state {
  NXS_UNINITIALIZED, NXS_INITIALIZED, NXS_INFLIGHT, NXS_COMPLETE,
  NXS_STATE_NR, NXS_UNINITIALIZED, NXS_INITIALIZED, NXS_INFLIGHT,
  NXS_COMPLETE, NXS_STATE_NR
}
 
enum  io_req_state {
  IRS_UNINITIALIZED, IRS_INITIALIZED, IRS_READING, IRS_WRITING,
  IRS_READ_COMPLETE, IRS_WRITE_COMPLETE, IRS_DEGRADED_READING, IRS_DEGRADED_WRITING,
  IRS_REQ_COMPLETE, IRS_FAILED
}
 
enum  pargrp_iomap_rmwtype {
  PIR_NONE, PIR_READOLD, PIR_READREST, PIR_NR,
  PIR_NONE, PIR_READOLD, PIR_READREST, PIR_NR
}
 
enum  pargrp_iomap_state {
  PI_NONE, PI_HEALTHY, PI_DEGRADED, PI_NR,
  PI_NONE, PI_HEALTHY, PI_DEGRADED, PI_NR
}
 
enum  target_ioreq_type {
  TI_NONE, TI_READ_WRITE, TI_COB_CREATE, TI_NONE,
  TI_READ_WRITE, TI_COB_CREATE, TI_COB_TRUNCATE
}
 

Functions

M0_INTERNAL struct inodem0t1fs_file_to_inode (const struct file *file)
 
M0_INTERNAL struct m0t1fs_inode * m0t1fs_file_to_m0inode (const struct file *file)
 
M0_INTERNAL struct m0t1fs_inode * m0t1fs_inode_to_m0inode (const struct inode *inode)
 
M0_INTERNAL struct m0t1fs_sb * m0inode_to_sb (const struct m0t1fs_inode *m0inode)
 

Macro Definition Documentation

◆ __MOTR_M0T1FS_FILE_INTERNAL_H__

#define __MOTR_M0T1FS_FILE_INTERNAL_H__

Definition at line 26 of file file_internal.h.

Enumeration Type Documentation

◆ copy_direction

Enum representing direction of data copy in IO.

Enumerator
CD_COPY_FROM_USER 
CD_COPY_TO_USER 
CD_NR 
CD_COPY_FROM_APP 
CD_COPY_TO_APP 

Definition at line 1127 of file file_internal.h.

◆ io_req_state

Represents state of IO request call. m0_sm_state_descr structure will be defined for description of all states mentioned below.

Enumerator
IRS_UNINITIALIZED 
IRS_INITIALIZED 
IRS_READING 
IRS_WRITING 
IRS_READ_COMPLETE 
IRS_WRITE_COMPLETE 
IRS_DEGRADED_READING 
IRS_DEGRADED_WRITING 
IRS_REQ_COMPLETE 
IRS_FAILED 

Definition at line 1248 of file file_internal.h.

◆ nw_xfer_state

State of struct nw_xfer_request.

Enumerator
NXS_UNINITIALIZED 
NXS_INITIALIZED 
NXS_INFLIGHT 
NXS_COMPLETE 
NXS_STATE_NR 
NXS_UNINITIALIZED 
NXS_INITIALIZED 
NXS_INFLIGHT 
NXS_COMPLETE 
NXS_STATE_NR 

Definition at line 1134 of file file_internal.h.

◆ page_attr

enum page_attr

Page attributes for all pages spanned by pargrp_iomap::pi_ivec. This enum is also used by data_buf::db_flags.

Enumerator
PA_NONE 

Page not spanned by io vector.

PA_READ 

Page needs to be read.

PA_FULLPAGE_MODIFY 

Page is completely spanned by incoming io vector, which is why file data can be modified while read IO is going on. Such pages need not be read from server. Mutually exclusive with PA_READ and PA_PARTPAGE_MODIFY.

PA_PARTPAGE_MODIFY 

Page is partially spanned by incoming io vector, which is why it has to wait till the whole page (superset) is read first and then it can be modified as per user request. Used only in case of read-modify-write. Mutually exclusive with PA_FULLPAGE_MODIFY.

PA_WRITE 

Page needs to be written.

PA_DATA 

Page contains file data.

PA_PARITY 

Page contains parity.

PA_COPY_FRMUSR_DONE 

Data has been copied from user-space into page. Flag used only when copy_direction == CD_COPY_FROM_USER. This flag is needed since in case of read-old approach, even if page/s are fully modified, they have to be read in order to generate correct parity. Hence for read-modify-write requests, fully modified pages from parity groups which have adopted read-old approach can not be copied before read state finishes.

PA_READ_FAILED 

Read IO failed for given page.

PA_DGMODE_READ 

Page needs to be read in degraded mode read IO state.

PA_DGMODE_WRITE 

Page needs to be written in degraded mode write IO state.

PA_NR 
PA_NONE 

Page not spanned by io vector.

PA_READ 

Page needs to be read.

PA_FULLPAGE_MODIFY 

Page is completely spanned by incoming io vector, which is why file data can be modified while read IO is going on. Such pages need not be read from server. Mutually exclusive with PA_READ and PA_PARTPAGE_MODIFY.

PA_PARTPAGE_MODIFY 

Page is partially spanned by incoming io vector, which is why it has to wait till the whole page (superset) is read first and then it can be modified as per user request. Used only in case of read-modify-write. Mutually exclusive with PA_FULLPAGE_MODIFY.

PA_WRITE 

Page needs to be written.

PA_DATA 

Page contains file data.

PA_PARITY 

Page contains parity.

PA_COPY_FRMUSR_DONE 

Data has been copied from user-space into page. Flag used only when copy_direction == CD_COPY_FROM_USER. This flag is needed since in case of read-old approach, even if page/s are fully modified, they have to be read in order to generate correct parity. Hence for read-modify-write requests, fully modified pages from parity groups which have adopted read-old approach can not be copied before read state finishes.

PA_READ_FAILED 

Read IO failed for given page.

PA_DGMODE_READ 

Page needs to be read in degraded mode read IO state.

PA_DGMODE_WRITE 

Page needs to be written in degraded mode write IO state.

PA_APP_MEMORY 

The application provided this memory, don't try to free it

PA_TRUNC 

This page will be truncated, so don't do RW operation.

PA_NR 

Definition at line 1069 of file file_internal.h.

◆ pargrp_iomap_rmwtype

Type of read approach used by pargrp_iomap structure in case of rmw IO.

Enumerator
PIR_NONE 
PIR_READOLD 
PIR_READREST 
PIR_NR 
PIR_NONE 
PIR_READOLD 
PIR_READREST 
PIR_NR 

Definition at line 1483 of file file_internal.h.

◆ pargrp_iomap_state

State of parity group during IO life-cycle.

Enumerator
PI_NONE 
PI_HEALTHY 
PI_DEGRADED 
PI_NR 
PI_NONE 
PI_HEALTHY 
PI_DEGRADED 
PI_NR 

Definition at line 1491 of file file_internal.h.

◆ target_ioreq_type

A request for a target can be of two types, either for read/write IO or for cob creation for the target on remote ioservice.

Enumerator
TI_NONE 
TI_READ_WRITE 
TI_COB_CREATE 
TI_NONE 
TI_READ_WRITE 
TI_COB_CREATE 
TI_COB_TRUNCATE 

Definition at line 1747 of file file_internal.h.

Function Documentation

◆ m0inode_to_sb()

M0_INTERNAL struct m0t1fs_sb* m0inode_to_sb ( const struct m0t1fs_inode *  m0inode)

Definition at line 472 of file file.c.

Here is the caller graph for this function:

◆ m0t1fs_file_to_inode()

M0_INTERNAL struct inode* m0t1fs_file_to_inode ( const struct file file)

Definition at line 435 of file file.c.

Here is the caller graph for this function:

◆ m0t1fs_file_to_m0inode()

M0_INTERNAL struct m0t1fs_inode* m0t1fs_file_to_m0inode ( const struct file file)

Definition at line 444 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0t1fs_inode_to_m0inode()

M0_INTERNAL struct m0t1fs_inode* m0t1fs_inode_to_m0inode ( const struct inode inode)

Definition at line 462 of file file.c.

Here is the caller graph for this function: