Motr  M0
fsync.h File Reference
#include <linux/version.h>
#include "mdservice/fsync_fops.h"
#include "fop/fop.h"
Include dependency graph for fsync.h:

Go to the source code of this file.

Data Structures

struct  m0t1fs_fsync_fop_wrapper
 
struct  m0t1fs_fsync_interactions
 

Macros

#define __MOTR_M0T1FS_FSYNC_H__
 

Functions

int m0t1fs_fsync (struct file *file, loff_t start, loff_t end, int datasync)
 
void m0t1fs_fsync_record_update (struct m0_reqh_service_ctx *service, struct m0t1fs_sb *csb, struct m0t1fs_inode *inode, struct m0_be_tx_remid *btr)
 
M0_INTERNAL int m0t1fs_fsync_request_create (struct m0_reqh_service_txid *stx, struct m0t1fs_fsync_fop_wrapper **ffw, enum m0_fsync_mode mode)
 
M0_INTERNAL int m0t1fs_fsync_reply_process (struct m0t1fs_sb *csb, struct m0t1fs_inode *inode, struct m0t1fs_fsync_fop_wrapper *ffw)
 
int m0t1fs_sync_fs (struct super_block *sb, int wait)
 
M0_INTERNAL int m0t1fs_fsync_core (struct m0t1fs_inode *inode, enum m0_fsync_mode mode)
 

Macro Definition Documentation

◆ __MOTR_M0T1FS_FSYNC_H__

#define __MOTR_M0T1FS_FSYNC_H__

Definition at line 32 of file fsync.h.

Function Documentation

◆ m0t1fs_fsync()

int m0t1fs_fsync ( struct file file,
loff_t  start,
loff_t  end,
int  datasync 
)

m0t1fs fsync entry point

Entry point for fsync, calls m0t1fs_fsync_core with mode=active

parameter dentry is unused as we don't need it - it is removed in later kernel versions

parameter datasync is unused, as we only ever sync data. To sync metadata would require a sync against the super-block, as all metadata currently lives in container-zero.

Failure

Todo:
: Generate some addb here.

Definition at line 354 of file fsync.c.

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

◆ m0t1fs_fsync_core()

M0_INTERNAL int m0t1fs_fsync_core ( struct m0t1fs_inode *  inode,
enum m0_fsync_mode  mode 
)

m0t1fs fsync core sends an fsync-fop to a list of services, then blocks, waiting for replies. This is implemented as two loops. The 'fop sending loop', generates and posts fops, adding them to a list of pending fops. This is all done while holding the m0t1fs_indode::ci_pending_txid_lock. The 'reply receiving loop' works over the list of pending fops, waiting for a reply for each one. It acquires the m0t1fs_indode::ci_pending_txid_lock only when necessary.

m0t1fs fsync core sends an fsync-fop to a list of services, then blocks, waiting for replies. This is implemented as two loops. The 'fop sending loop', generates and posts fops, adding them to a list of pending fops. This is all done while holding the m0t1fs_indode::ci_service_pending_txid_map_lock. The 'reply receiving loop' works over the list of pending fops, waiting for a reply for each one. It acquires the m0t1fs_indode::ci_service_pending_txid_map_lock only when necessary.

Definition at line 281 of file fsync.c.

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

◆ m0t1fs_fsync_record_update()

void m0t1fs_fsync_record_update ( struct m0_reqh_service_ctx service,
struct m0t1fs_sb *  csb,
struct m0t1fs_inode *  inode,
struct m0_be_tx_remid btr 
)

Updates fsync records in fop callbacks. Service must be specified, one or both of csb/inode should be specified. new_txid may be null.

Update a m0_reqh_service_txid with the specified be_tx_remid if the struct m0_be_tx_remid::tri_txid > the stored value inode may be NULL if the update has no associated inode. csb may be NULL, iff inode is specified.

Definition at line 397 of file fsync.c.

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

◆ m0t1fs_fsync_reply_process()

M0_INTERNAL int m0t1fs_fsync_reply_process ( struct m0t1fs_sb *  csb,
struct m0t1fs_inode *  inode,
struct m0t1fs_fsync_fop_wrapper ffw 
)

Wait for a reply to an fsync fop and process it. Cleans-up the fop allocated in m0t1fs_fsync_request_create.

inode may be NULL if the reply is only likely to touch the super block. csb may be NULL, iff inode is specified.

Waits for a reply to an fsync fop and process it. Cleans-up the fop allocated in m0t1fs_fsync_request_create.

inode may be NULL if the reply is only likely to touch the super block. csb may be NULL, iff inode is specified.

Definition at line 206 of file fsync.c.

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

◆ m0t1fs_fsync_request_create()

M0_INTERNAL int m0t1fs_fsync_request_create ( struct m0_reqh_service_txid stx,
struct m0t1fs_fsync_fop_wrapper **  ffw_out,
enum m0_fsync_mode  mode 
)

Create and send an fsync fop from the provided m0_reqh_service_txid.

Creates and sends an fsync fop from the provided m0_reqh_service_txid. Allocates and returns the fop wrapper at on success, which is freed on the last m0_fop_put().

Definition at line 105 of file fsync.c.

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

◆ m0t1fs_sync_fs()

int m0t1fs_sync_fs ( struct super_block sb,
int  wait 
)

m0t1fs sync_fs entry point

Entry point for sync_fs, sends fsync-fops for each pending transaction the super block is aware off. Unlike m0t1fs_fsync_core this function acquires the sc_max_pending_tx_lock for each service, as there is not a larger-granularity lock.

Definition at line 462 of file fsync.c.

Here is the call graph for this function: