Motr  M0
inode.c File Reference
#include <linux/slab.h>
#include <linux/version.h>
#include <linux/cred.h>
#include "layout/pdclust.h"
#include "layout/linear_enum.h"
#include "lib/misc.h"
#include "lib/memory.h"
#include "m0t1fs/linux_kernel/m0t1fs.h"
#include "lib/trace.h"
#include "motr/magic.h"
#include "rm/rm_service.h"
#include "lib/tlist.h"
Include dependency graph for inode.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_M0T1FS
 

Functions

 M0_TL_DESCR_DEFINE (ispti, "m0_reqh_service_txid pending an inode",, struct m0_reqh_service_txid, stx_tlink, stx_link_magic, M0_T1FS_INODE_PTI_MAGIC1, M0_T1FS_INODE_PTI_MAGIC2)
 
 M0_TL_DEFINE (ispti,, struct m0_reqh_service_txid)
 
 M0_BOB_DEFINE (M0_INTERNAL, &m0t1fs_inode_bob, m0t1fs_inode)
 
M0_INTERNAL const struct m0_fidm0t1fs_inode_fid (const struct m0t1fs_inode *ci)
 
M0_INTERNAL bool m0t1fs_inode_is_root (const struct inode *inode)
 
M0_INTERNAL bool m0t1fs_inode_is_dot_motr (const struct inode *inode)
 
M0_INTERNAL bool m0t1fs_inode_is_dot_motr_fid (const struct inode *inode)
 
static void init_once (void *foo)
 
M0_INTERNAL int m0t1fs_inode_cache_init (void)
 
M0_INTERNAL void m0t1fs_inode_cache_fini (void)
 
M0_INTERNAL struct m0_rm_domainm0t1fs_rm_domain_get (struct m0t1fs_sb *sb)
 
M0_INTERNAL void m0t1fs_file_lock_init (struct m0t1fs_inode *ci, struct m0t1fs_sb *csb)
 
M0_INTERNAL void m0t1fs_file_lock_fini (struct m0t1fs_inode *ci)
 
static void m0t1fs_inode_init (struct m0t1fs_inode *ci)
 
static void m0t1fs_inode_ispti_fini (struct m0t1fs_inode *ci)
 
static void m0t1fs_inode_fini (struct m0t1fs_inode *ci)
 
M0_INTERNAL struct inodem0t1fs_alloc_inode (struct super_block *sb)
 
M0_INTERNAL void m0t1fs_destroy_inode (struct inode *inode)
 
M0_INTERNAL struct inodem0t1fs_root_iget (struct super_block *sb, const struct m0_fid *root_fid)
 
M0_INTERNAL int m0t1fs_inode_test (struct inode *inode, void *opaque)
 
static int m0t1fs_inode_set (struct inode *inode, void *opaque)
 
M0_INTERNAL void m0t1fs_inode_update_blksize (struct inode *inode, struct m0_layout *layout)
 
M0_INTERNAL void m0t1fs_inode_update (struct inode *inode, struct m0_fop_cob *body)
 
static int m0t1fs_inode_read (struct inode *inode, struct m0_fop_cob *body)
 
M0_INTERNAL struct inodem0t1fs_iget (struct super_block *sb, const struct m0_fid *fid, struct m0_fop_cob *body)
 
static int m0t1fs_build_layout_instance (struct m0t1fs_sb *csb, const uint64_t layout_id, const struct m0_fid *fid, struct m0_layout_instance **linst)
 
M0_INTERNAL int m0t1fs_inode_layout_init (struct m0t1fs_inode *ci)
 
M0_INTERNAL int m0t1fs_inode_layout_rebuild (struct m0t1fs_inode *ci, struct m0_fop_cob *body)
 

Variables

static struct kmem_cache * m0t1fs_inode_cachep = NULL
 
static const struct m0_bob_type m0t1fs_inode_bob
 
const struct m0_uint128 m0_rm_m0t1fs_group = M0_UINT128(0, 1)
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_M0T1FS

Definition at line 34 of file inode.c.

Function Documentation

◆ init_once()

static void init_once ( void *  foo)
static

Definition at line 90 of file inode.c.

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

◆ M0_BOB_DEFINE()

M0_BOB_DEFINE ( M0_INTERNAL  ,
m0t1fs_inode_bob,
m0t1fs_inode   
)

◆ M0_TL_DEFINE()

M0_TL_DEFINE ( ispti  ,
struct m0_reqh_service_txid   
)

◆ M0_TL_DESCR_DEFINE()

M0_TL_DESCR_DEFINE ( ispti  ,
"m0_reqh_service_txid pending an inode ,
struct m0_reqh_service_txid  ,
stx_tlink  ,
stx_link_magic  ,
M0_T1FS_INODE_PTI_MAGIC1  ,
M0_T1FS_INODE_PTI_MAGIC2   
)

◆ m0t1fs_alloc_inode()

M0_INTERNAL struct inode* m0t1fs_alloc_inode ( struct super_block sb)

Implementation of super_operations::alloc_inode() interface.

Definition at line 236 of file inode.c.

Here is the call graph for this function:

◆ m0t1fs_build_layout_instance()

static int m0t1fs_build_layout_instance ( struct m0t1fs_sb *  csb,
const uint64_t  layout_id,
const struct m0_fid fid,
struct m0_layout_instance **  linst 
)
static

Definition at line 539 of file inode.c.

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

◆ m0t1fs_destroy_inode()

M0_INTERNAL void m0t1fs_destroy_inode ( struct inode inode)

Implementation of super_operations::destroy_inode() interface.

The function is called by kernel, and thus can be called concurrently with rconfc refresh callbacks.

See also
inodes_layout_ref_drop().

Definition at line 256 of file inode.c.

Here is the call graph for this function:

◆ m0t1fs_file_lock_fini()

M0_INTERNAL void m0t1fs_file_lock_fini ( struct m0t1fs_inode *  ci)

Definition at line 162 of file inode.c.

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

◆ m0t1fs_file_lock_init()

M0_INTERNAL void m0t1fs_file_lock_init ( struct m0t1fs_inode *  ci,
struct m0t1fs_sb *  csb 
)
Todo:
Get di type from configuration.

Definition at line 136 of file inode.c.

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

◆ m0t1fs_iget()

M0_INTERNAL struct inode* m0t1fs_iget ( struct super_block sb,
const struct m0_fid fid,
struct m0_fop_cob body 
)

Definition at line 489 of file inode.c.

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

◆ m0t1fs_inode_cache_fini()

M0_INTERNAL void m0t1fs_inode_cache_fini ( void  )

Definition at line 118 of file inode.c.

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

◆ m0t1fs_inode_cache_init()

M0_INTERNAL int m0t1fs_inode_cache_init ( void  )

Definition at line 101 of file inode.c.

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

◆ m0t1fs_inode_fid()

M0_INTERNAL const struct m0_fid* m0t1fs_inode_fid ( const struct m0t1fs_inode *  ci)

Definition at line 61 of file inode.c.

Here is the caller graph for this function:

◆ m0t1fs_inode_fini()

static void m0t1fs_inode_fini ( struct m0t1fs_inode *  ci)
static

Definition at line 211 of file inode.c.

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

◆ m0t1fs_inode_init()

static void m0t1fs_inode_init ( struct m0t1fs_inode *  ci)
static

Definition at line 178 of file inode.c.

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

◆ m0t1fs_inode_is_dot_motr()

M0_INTERNAL bool m0t1fs_inode_is_dot_motr ( const struct inode inode)

Definition at line 76 of file inode.c.

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

◆ m0t1fs_inode_is_dot_motr_fid()

M0_INTERNAL bool m0t1fs_inode_is_dot_motr_fid ( const struct inode inode)

Definition at line 83 of file inode.c.

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

◆ m0t1fs_inode_is_root()

M0_INTERNAL bool m0t1fs_inode_is_root ( const struct inode inode)

Definition at line 68 of file inode.c.

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

◆ m0t1fs_inode_ispti_fini()

static void m0t1fs_inode_ispti_fini ( struct m0t1fs_inode *  ci)
static

Definition at line 195 of file inode.c.

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

◆ m0t1fs_inode_layout_init()

M0_INTERNAL int m0t1fs_inode_layout_init ( struct m0t1fs_inode *  ci)

Definition at line 570 of file inode.c.

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

◆ m0t1fs_inode_layout_rebuild()

M0_INTERNAL int m0t1fs_inode_layout_rebuild ( struct m0t1fs_inode *  ci,
struct m0_fop_cob body 
)

Definition at line 600 of file inode.c.

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

◆ m0t1fs_inode_read()

static int m0t1fs_inode_read ( struct inode inode,
struct m0_fop_cob body 
)
static

Definition at line 428 of file inode.c.

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

◆ m0t1fs_inode_set()

static int m0t1fs_inode_set ( struct inode inode,
void *  opaque 
)
static

Definition at line 351 of file inode.c.

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

◆ m0t1fs_inode_test()

M0_INTERNAL int m0t1fs_inode_test ( struct inode inode,
void *  opaque 
)

In file-systems like m0t1fs or nfs, inode number is not enough to identify a file. For such file-systems structure and semantics of file identifier are file-system specific e.g. fid in case of m0t1fs, file handle for nfs.

m0t1fs_inode_test() and m0t1fs_inode_set() are the implementation of interfaces that are used by generic vfs code, to compare identities of inodes, in a generic manner.

Definition at line 332 of file inode.c.

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

◆ m0t1fs_inode_update()

M0_INTERNAL void m0t1fs_inode_update ( struct inode inode,
struct m0_fop_cob body 
)

Definition at line 389 of file inode.c.

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

◆ m0t1fs_inode_update_blksize()

M0_INTERNAL void m0t1fs_inode_update_blksize ( struct inode inode,
struct m0_layout layout 
)

Definition at line 371 of file inode.c.

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

◆ m0t1fs_rm_domain_get()

M0_INTERNAL struct m0_rm_domain* m0t1fs_rm_domain_get ( struct m0t1fs_sb *  sb)

Definition at line 130 of file inode.c.

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

◆ m0t1fs_root_iget()

M0_INTERNAL struct inode* m0t1fs_root_iget ( struct super_block sb,
const struct m0_fid root_fid 
)

Definition at line 280 of file inode.c.

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

Variable Documentation

◆ m0_rm_m0t1fs_group

const struct m0_uint128 m0_rm_m0t1fs_group = M0_UINT128(0, 1)

Definition at line 59 of file inode.c.

◆ m0t1fs_inode_bob

const struct m0_bob_type m0t1fs_inode_bob
static
Initial value:
= {
.bt_name = "m0t1fs_inode",
.bt_magix_offset = offsetof(struct m0t1fs_inode, ci_magic),
.bt_magix = M0_T1FS_INODE_MAGIC,
.bt_check = NULL
}
#define NULL
Definition: misc.h:38
#define offsetof(typ, memb)
Definition: misc.h:29

Definition at line 50 of file inode.c.

◆ m0t1fs_inode_cachep

struct kmem_cache* m0t1fs_inode_cachep = NULL
static

Definition at line 48 of file inode.c.