Motr  M0
fsync.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2014-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 
24 #include <linux/version.h> /* LINUX_VERSION_CODE */
25 
26 #include "mdservice/fsync_fops.h" /* m0_fop_fsync_mds_fopt */
27 #include "fop/fop.h" /* m0_fop */
28 
29 #pragma once
30 
31 #ifndef __MOTR_M0T1FS_FSYNC_H__
32 #define __MOTR_M0T1FS_FSYNC_H__
33 
345 /* import */
346 struct m0t1fs_inode;
347 struct m0t1fs_sb;
348 struct m0_reqh_service_ctx;
349 
350 
358  struct m0_fop ffw_fop;
359 
367 
369  uint64_t ffw_tlink_magic;
370 };
371 
378 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
379  int (*kernel_fsync)(struct file *file, loff_t start, loff_t end,
380  int datasync);
381 #else
382  int (*kernel_fsync)(struct file *file, struct dentry *dentry,
383  int datasync);
384 #endif
387  void (*fop_fini)(struct m0_fop *fop);
388  void (*fop_put)(struct m0_fop *fop);
389 };
390 
394 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
395 int m0t1fs_fsync(struct file *file, loff_t start, loff_t end, int datasync);
396 #else
397 int m0t1fs_fsync(struct file *file, struct dentry *dentry, int datasync);
398 #endif
399 
400 
407  struct m0t1fs_sb *csb,
408  struct m0t1fs_inode *inode,
409  struct m0_be_tx_remid *btr);
410 
411 
415 M0_INTERNAL int
417  struct m0t1fs_fsync_fop_wrapper **ffw,
418  enum m0_fsync_mode mode);
419 
420 
429 M0_INTERNAL int
430 m0t1fs_fsync_reply_process(struct m0t1fs_sb *csb,
431  struct m0t1fs_inode *inode,
432  struct m0t1fs_fsync_fop_wrapper *ffw);
433 
434 
438 int m0t1fs_sync_fs(struct super_block *sb, int wait);
439 
450 M0_INTERNAL int m0t1fs_fsync_core(struct m0t1fs_inode *inode,
451  enum m0_fsync_mode mode);
452 
453 #endif /* __MOTR_M0T1FS_FSYNC_H__ */
454 
455 /*
456  * Local variables:
457  * c-indentation-style: "K&R"
458  * c-basic-offset: 8
459  * tab-width: 8
460  * fill-column: 80
461  * scroll-step: 1
462  * End:
463  */
static struct m0_reqh_service_txid stx[NUM_STRECORDS]
Definition: fsync.c:71
static struct m0_semaphore wait
Definition: item.c:151
void(* fop_put)(struct m0_fop *fop)
Definition: fsync.h:388
struct m0_file file
Definition: di.c:36
uint64_t m0_time_t
Definition: time.h:37
int(* post_rpc)(struct m0_rpc_item *item)
Definition: fsync.h:385
uint64_t ffw_tlink_magic
Definition: fsync.h:369
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)
Definition: fsync.c:397
struct m0t1fs_sb * csb
Definition: dir.c:330
static struct m0_rpc_item * item
Definition: item.c:56
struct inode * inode
Definition: dir.c:624
M0_INTERNAL int m0t1fs_fsync_request_create(struct m0_reqh_service_txid *stx, struct m0t1fs_fsync_fop_wrapper **ffw, enum m0_fsync_mode mode)
Definition: fsync.c:105
struct m0_tlink ffw_tlink
Definition: fsync.h:368
static int struct dentry * dentry
Definition: dir.c:589
M0_INTERNAL int m0t1fs_fsync_reply_process(struct m0t1fs_sb *csb, struct m0t1fs_inode *inode, struct m0t1fs_fsync_fop_wrapper *ffw)
Definition: fsync.c:206
static int struct dentry int mode
Definition: dir.c:589
static struct super_block super_block
Definition: fsync.c:84
static uint32_t timeout
Definition: console.c:52
M0_INTERNAL int m0t1fs_fsync_core(struct m0t1fs_inode *inode, enum m0_fsync_mode mode)
Definition: fsync.c:281
static struct super_block sb
Definition: file.c:85
void(* fop_fini)(struct m0_fop *fop)
Definition: fsync.h:387
int m0t1fs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
Definition: fsync.c:354
int(* kernel_fsync)(struct file *file, loff_t start, loff_t end, int datasync)
Definition: fsync.h:379
static int start(struct m0_fom *fom)
Definition: trigger_fom.c:321
static struct m0_fop * fop
Definition: item.c:57
int m0t1fs_sync_fs(struct super_block *sb, int wait)
Definition: fsync.c:462
m0_fsync_mode
Definition: fsync_fops.h:54
struct m0_reqh_service_txid * ffw_stx
Definition: fsync.h:366
struct m0_fop ffw_fop
Definition: fsync.h:358
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
Definition: long_lock_ut.c:46
Definition: fop.h:79
int(* wait_for_reply)(struct m0_rpc_item *item, m0_time_t timeout)
Definition: fsync.h:386