|
Motr
M0
|
#include <linux/version.h>#include <linux/fs.h>#include <linux/mount.h>#include "lib/trace.h"#include "mdservice/fsync_fops.h"#include "fop/fom_generic.h"#include "lib/memory.h"#include "lib/tlist.h"#include "lib/hash.h"#include "file/file.h"#include "motr/magic.h"#include "m0t1fs/linux_kernel/m0t1fs.h"#include "layout/pdclust.h"#include "m0t1fs/linux_kernel/file_internal.h"#include "m0t1fs/linux_kernel/fsync.h"
Go to the source code of this file.
Macros | |
| #define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_M0T1FS |
Variables | |
| struct m0t1fs_fsync_interactions | fi |
|
static |
| M0_TL_DEFINE | ( | fpf | , |
| static | , | ||
| struct m0t1fs_fsync_fop_wrapper | |||
| ) |
| M0_TL_DESCR_DEFINE | ( | fpf | , |
| "m0t1fs_fsync_fop_wrappers pending fsync-fops" | , | ||
| static | , | ||
| struct m0t1fs_fsync_fop_wrapper | , | ||
| ffw_tlink | , | ||
| ffw_tlink_magic | , | ||
| M0_T1FS_FFW_TLIST_MAGIC1 | , | ||
| M0_T1FS_FFW_TLIST_MAGIC2 | |||
| ) |
| int m0t1fs_fsync | ( | struct file * | file, |
| loff_t | start, | ||
| loff_t | end, | ||
| int | datasync | ||
| ) |
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
Definition at line 354 of file fsync.c.


| 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_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.


|
static |
| 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 | ||
| ) |
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.


| int m0t1fs_fsync_reply_process | ( | struct m0t1fs_sb * | csb, |
| struct m0t1fs_inode * | inode, | ||
| struct m0t1fs_fsync_fop_wrapper * | ffw | ||
| ) |
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.


| int m0t1fs_fsync_request_create | ( | struct m0_reqh_service_txid * | stx, |
| struct m0t1fs_fsync_fop_wrapper ** | ffw_out, | ||
| enum m0_fsync_mode | mode | ||
| ) |
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.


| int m0t1fs_sync_fs | ( | struct super_block * | sb, |
| int | wait | ||
| ) |
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.

| struct m0t1fs_fsync_interactions fi |
Ugly abstraction of m0t1fs_fsync interactions with wider motr code