Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / os / fs / FS.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph - scalable distributed file system
5  *
6  * Copyright (C) 2014 Red Hat
7  *
8  * This is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License version 2.1, as published by the Free Software
11  * Foundation.  See file COPYING.
12  *
13  */
14
15 #ifndef CEPH_OS_FS_H
16 #define CEPH_OS_FS_H
17
18 #include <errno.h>
19 #include <time.h>
20
21 #include <string>
22
23 #include "include/types.h"
24 #include "common/Mutex.h"
25 #include "common/Cond.h"
26
27 class FS {
28 public:
29   virtual ~FS() { }
30
31   static FS *create(uint64_t f_type);
32   static FS *create_by_fd(int fd);
33
34   virtual const char *get_name() {
35     return "generic";
36   }
37
38   virtual int set_alloc_hint(int fd, uint64_t hint);
39
40   virtual int get_handle(int fd, std::string *h);
41   virtual int open_handle(int mount_fd, const std::string& h, int flags);
42
43   virtual int copy_file_range(int to_fd, uint64_t to_offset,
44                               int from_fd,
45                               uint64_t from_offset, uint64_t from_len);
46   virtual int zero(int fd, uint64_t offset, uint64_t length);
47
48   // -- aio --
49 };
50
51 #endif