Motr  M0
file_internal.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_M0T1FS_FILE_INTERNAL_H__
26 #define __MOTR_M0T1FS_FILE_INTERNAL_H__
27 
1042 /* import */
1043 struct m0_pdclust_tgt_addr;
1044 struct m0_pdclust_src_addr;
1045 
1046 /* export */
1047 struct io_request;
1048 struct nw_xfer_request;
1049 struct pargrp_iomap;
1050 struct target_ioreq;
1051 struct io_req_fop;
1052 
1053 struct io_request_ops;
1054 struct nw_xfer_ops;
1055 struct pargrp_iomap_ops;
1056 struct target_ioreq_ops;
1057 
1058 enum page_attr;
1059 enum copy_direction;
1060 enum nw_xfer_state;
1061 enum io_req_state;
1062 enum io_req_type;
1064 
1071  PA_NONE = 0,
1072 
1074  PA_READ = (1 << 0),
1075 
1083 
1092 
1094  PA_WRITE = (1 << 3),
1095 
1097  PA_DATA = (1 << 4),
1098 
1100  PA_PARITY = (1 << 5),
1101 
1113 
1115  PA_READ_FAILED = (1 << 7),
1116 
1118  PA_DGMODE_READ = (1 << 8),
1119 
1121  PA_DGMODE_WRITE = (1 << 9),
1122 
1123  PA_NR = 10,
1124 };
1125 
1131 };
1132 
1140 };
1141 
1143 struct nw_xfer_ops {
1151 
1160  void (*nxo_complete) (struct nw_xfer_request *xfer, bool rmw);
1161 
1170  int (*nxo_dispatch) (struct nw_xfer_request *xfer);
1171 
1182  const struct m0_pdclust_src_addr *src,
1183  struct m0_pdclust_tgt_addr *tgt,
1184  struct target_ioreq **tio);
1185 };
1186 
1196  uint64_t nxr_magic;
1197 
1199  int nxr_rc;
1200 
1202  uint64_t nxr_bytes;
1203 
1205 
1206  const struct nw_xfer_ops *nxr_ops;
1207 
1214 
1226 
1235 
1241 };
1242 
1259 };
1260 
1261 
1271 
1278 
1287  enum copy_direction dir,
1288  enum page_attr filter);
1289 
1299 
1309 
1316 
1326  int (*iro_dgmode_read) (struct io_request *req, bool rmw);
1327 
1336 
1347  int (*iro_dgmode_write) (struct io_request *req, bool rmw);
1348 
1354 
1358  void (*iro_file_unlock) (struct io_request *req);
1359 };
1360 
1368 struct io_request {
1370  uint64_t ir_magic;
1371 
1372  int ir_rc;
1373 
1376 
1381  struct file *ir_file;
1382 
1389 
1396 
1398  uint64_t ir_iomap_nr;
1399 
1405  const struct iovec *ir_iovec;
1406 
1408  struct m0_sm ir_sm;
1409 
1410  enum io_req_type ir_type;
1411 
1413 
1414  const struct io_request_ops *ir_ops;
1415 
1417 
1420 
1430 
1435  uint32_t ir_dgmap_nr;
1436 
1444 };
1445 
1450 struct data_buf {
1452  uint64_t db_magic;
1453 
1455  struct m0_buf db_buf;
1456 
1463 
1464  struct page *db_page;
1465 
1471 
1477 };
1478 
1488 };
1489 
1496 };
1497 
1508  uint64_t pi_magic;
1509 
1511  uint64_t pi_grpid;
1512 
1515 
1523 
1529 
1542 
1552 
1554  const struct pargrp_iomap_ops *pi_ops;
1555 
1558 };
1559 
1576  int (*pi_populate) (struct pargrp_iomap *iomap,
1577  struct m0_ivec_varr_cursor *cursor);
1578 
1588  bool (*pi_spans_seg) (struct pargrp_iomap *iomap,
1590  m0_bcount_t count);
1591 
1598  int (*pi_readrest) (struct pargrp_iomap *iomap);
1599 
1608  uint64_t (*pi_fullpages_find) (struct pargrp_iomap *map);
1609 
1622  uint64_t segid,
1623  bool rmw);
1624 
1632 
1638 
1646 
1654 
1665  struct target_ioreq *tio,
1666  m0_bindex_t *index,
1667  uint32_t count);
1668 
1674 
1682 };
1683 
1696  void (*tio_seg_add) (struct target_ioreq *ti,
1697  const struct m0_pdclust_src_addr *src,
1698  const struct m0_pdclust_tgt_addr *tgt,
1699  m0_bindex_t gob_offset,
1701  struct pargrp_iomap *map);
1702 
1711  enum page_attr filter);
1712 
1717 };
1718 
1729 
1735 
1738 
1741 };
1742 
1751 };
1752 
1759 struct cc_req_fop {
1760  struct m0_fop crf_fop;
1761 
1763 
1765 };
1766 
1775  uint64_t ti_magic;
1776 
1778  struct m0_fid ti_fid;
1779 
1781  uint64_t ti_obj;
1782 
1784  int ti_rc;
1785 
1787  uint64_t ti_parbytes;
1788 
1790  uint64_t ti_databytes;
1791 
1794 
1797 
1800 
1803 
1806 
1814 
1820 
1827 
1833 
1835  const struct target_ioreq_ops *ti_ops;
1836 
1839 
1842 
1845 };
1846 
1857 struct io_req_fop {
1859  uint64_t irf_magic;
1860 
1863 
1866 
1869 
1872 
1875 
1881 };
1882 
1883 M0_INTERNAL struct inode *m0t1fs_file_to_inode(const struct file *file);
1884 
1885 M0_INTERNAL struct m0t1fs_inode *
1886 m0t1fs_file_to_m0inode(const struct file *file);
1887 
1888 M0_INTERNAL struct m0t1fs_inode *
1889 m0t1fs_inode_to_m0inode(const struct inode *inode);
1890 
1891 M0_INTERNAL struct m0t1fs_sb *m0inode_to_sb(const struct m0t1fs_inode *m0inode);
1892 
1893 #endif /* __MOTR_M0T1FS_FILE_INTERNAL_H__ */
pargrp_iomap_state
uint64_t pi_magic
sns_repair_state
Definition: pool.h:568
bool(* pi_spans_seg)(struct pargrp_iomap *iomap, m0_bindex_t index, m0_bcount_t count)
enum sns_repair_state ir_sns_state
uint64_t ir_iomap_nr
struct m0_fop crf_fop
nw_xfer_state
map
Definition: processor.c:112
int(* iro_parity_recalc)(struct io_request *req)
int(* pi_paritybufs_alloc)(struct pargrp_iomap *map)
struct m0_atomic64 nxr_rdbulk_nr
struct m0_indexvec_varr pi_ivv
int(* pi_readrest)(struct pargrp_iomap *iomap)
int(* iro_dgmode_write)(struct io_request *req, bool rmw)
struct m0_buf db_auxbuf
static struct io_request req
Definition: file.c:100
uint32_t ir_dgmap_nr
struct m0_file file
Definition: di.c:36
struct data_buf *** pi_paritybufs
struct m0_sm_ast crf_ast
int(* nxo_tioreq_map)(struct nw_xfer_request *xfer, const struct m0_pdclust_src_addr *src, struct m0_pdclust_tgt_addr *tgt, struct target_ioreq **tio)
uint64_t ir_magic
void(* nxo_complete)(struct nw_xfer_request *xfer, bool rmw)
int(* pi_dgmode_recover)(struct pargrp_iomap *map)
enum target_ioreq_type ti_req_type
struct m0_indexvec_varr ti_bufvec
uint64_t m0_bindex_t
Definition: types.h:80
uint64_t ti_obj
struct m0_varr ti_pageattrs
int(* pi_dgmode_process)(struct pargrp_iomap *map, struct target_ioreq *tio, m0_bindex_t *index, uint32_t count)
uint64_t m0_bcount_t
Definition: types.h:77
Definition: sm.h:504
int(* iro_parity_verify)(struct io_request *req)
struct m0_sm_ast irf_ast
struct target_ioreq * irf_tioreq
static m0_bcount_t count
Definition: xcode.c:167
uint64_t ti_magic
struct inode * inode
Definition: dir.c:624
int(* pi_readold_auxbuf_alloc)(struct pargrp_iomap *map)
int(* pi_seg_process)(struct pargrp_iomap *map, uint64_t segid, bool rmw)
struct target_ioreq * dr_tioreq
enum m0_pool_nd_state ti_state
m0_bcount_t ir_copied_nr
Definition: buf.h:37
static struct m0t1fs_inode m0inode
Definition: fsync.c:87
uint64_t irf_magic
enum page_attr db_flags
int(* nxo_distribute)(struct nw_xfer_request *xfer)
uint64_t ti_parbytes
int(* pi_populate)(struct pargrp_iomap *iomap, struct m0_ivec_varr_cursor *cursor)
int(* tio_cc_fops_prepare)(struct target_ioreq *ti)
enum pargrp_iomap_state pi_state
void(* tio_seg_add)(struct target_ioreq *ti, const struct m0_pdclust_src_addr *src, const struct m0_pdclust_tgt_addr *tgt, m0_bindex_t gob_offset, m0_bcount_t count, struct pargrp_iomap *map)
struct m0_tlink irf_link
struct m0_buf db_buf
struct page * db_page
struct nw_xfer_request ir_nwxfer
m0_pool_nd_state
Definition: pool_machine.h:57
const struct nw_xfer_ops * nxr_ops
Definition: tlist.h:251
struct m0_sm ir_sm
struct m0_atomic64 nxr_ccfop_nr
struct m0_hlink ti_link
struct m0_varr dr_pageattrs
void(* iro_iomaps_destroy)(struct io_request *req)
uint64_t pi_grpid
enum pargrp_iomap_rmwtype pi_rtype
target_ioreq_type
int(* pi_dgmode_postprocess)(struct pargrp_iomap *map)
int(* pi_parity_verify)(struct pargrp_iomap *map)
struct m0_indexvec_varr dr_bufvec
struct m0_htable nxr_tioreqs_hash
struct m0_rpc_session * ti_session
struct m0_indexvec_varr ir_ivv
struct m0_tl ti_iofops
void(* iro_file_unlock)(struct io_request *req)
struct m0_indexvec_varr dr_ivec_varr
const struct target_ioreq_ops * ti_ops
int(* iro_dgmode_recover)(struct io_request *req)
pargrp_iomap_rmwtype
const struct iovec * ir_iovec
copy_direction
uint64_t ti_databytes
M0_INTERNAL struct m0t1fs_sb * m0inode_to_sb(const struct m0t1fs_inode *m0inode)
Definition: file.c:472
struct m0_pdclust_tgt_addr tgt
Definition: fd.c:110
Definition: fid.h:38
struct m0_fid ti_fid
struct cc_req_fop ti_cc_fop
int(* nxo_dispatch)(struct nw_xfer_request *xfer)
M0_INTERNAL struct m0t1fs_inode * m0t1fs_file_to_m0inode(const struct file *file)
Definition: file.c:444
int(* iro_dgmode_read)(struct io_request *req, bool rmw)
struct m0_mutex nxr_lock
uint64_t(* pi_fullpages_find)(struct pargrp_iomap *map)
enum nw_xfer_state nxr_state
struct m0_indexvec_varr ti_ivv
M0_INTERNAL struct inode * m0t1fs_file_to_inode(const struct file *file)
Definition: file.c:435
Definition: sm.h:301
page_attr
struct data_buf *** pi_databufs
const struct io_request_ops * ir_ops
struct m0_atomic64 nxr_iofop_nr
struct m0_io_fop irf_iofop
struct pargrp_iomap ** ir_iomaps
struct target_ioreq * crf_tioreq
M0_INTERNAL struct m0t1fs_inode * m0t1fs_inode_to_m0inode(const struct inode *inode)
Definition: file.c:462
int(* pi_parity_recalc)(struct pargrp_iomap *map)
int(* iro_iomaps_prepare)(struct io_request *req)
struct inode * dir
Definition: dir.c:1028
def filter(argv)
Definition: filter.py:27
struct nw_xfer_request * ti_nwxfer
struct m0_rm_incoming ir_in
io_req_state
struct target_ioreq * db_tioreq
int(* iro_iosm_handle)(struct io_request *req)
Definition: varr.h:121
struct io_request * pi_ioreq
Definition: mutex.h:47
uint64_t * ir_failed_session
int(* iro_user_data_copy)(struct io_request *req, enum copy_direction dir, enum page_attr filter)
struct m0_pdclust_src_addr src
Definition: fd.c:108
struct dgmode_rwvec * ti_dgvec
struct file * ir_file
const struct pargrp_iomap_ops * pi_ops
int(* tio_iofops_prepare)(struct target_ioreq *ti, enum page_attr filter)
Definition: fop.h:79
enum page_attr irf_pattr
enum io_req_type ir_type
uint64_t db_magic
int(* iro_file_lock)(struct io_request *req)