]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/client/Client.h
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / client / Client.h
index 97c2ad733788dc3df1e31eb36c3d4bd142451a52..911a8b460dfa443de42b6b4ee03944fe183e9ac7 100644 (file)
@@ -362,6 +362,13 @@ public:
   int readdir_r(dir_result_t *dirp, struct dirent *de);
   int readdirplus_r(dir_result_t *dirp, struct dirent *de, struct ceph_statx *stx, unsigned want, unsigned flags, Inode **out);
 
+  /*
+   * Get the next snapshot delta entry.
+   *
+   */
+  int readdir_snapdiff(dir_result_t* dir1, snapid_t snap2,
+    struct dirent* out_de, snapid_t* out_snap);
+
   int getdir(const char *relpath, std::list<std::string>& names,
             const UserPerm& perms);  // get the whole dir at once.
 
@@ -791,7 +798,8 @@ public:
   void update_dir_dist(Inode *in, DirStat *st, mds_rank_t from);
 
   void clear_dir_complete_and_ordered(Inode *diri, bool complete);
-  void insert_readdir_results(MetaRequest *request, MetaSession *session, Inode *diri);
+  void insert_readdir_results(MetaRequest *request, MetaSession *session,
+                              Inode *diri, Inode *diri_other);
   Inode* insert_trace(MetaRequest *request, MetaSession *session);
   void update_inode_file_size(Inode *in, int issued, uint64_t size,
                              uint64_t truncate_seq, uint64_t truncate_size);
@@ -1271,6 +1279,8 @@ private:
     MAY_READ = 4,
   };
 
+  typedef std::function<void(dir_result_t*, MetaRequest*, InodeRef&, frag_t)> fill_readdir_args_cb_t;
+
   std::unique_ptr<CephContext, std::function<void(CephContext*)>> cct_deleter;
 
   /* Flags for VXattr */
@@ -1291,8 +1301,19 @@ private:
   bool _readdir_have_frag(dir_result_t *dirp);
   void _readdir_next_frag(dir_result_t *dirp);
   void _readdir_rechoose_frag(dir_result_t *dirp);
-  int _readdir_get_frag(dir_result_t *dirp);
+  int _readdir_get_frag(int op, dir_result_t *dirp,
+    fill_readdir_args_cb_t fill_req_cb);
   int _readdir_cache_cb(dir_result_t *dirp, add_dirent_cb_t cb, void *p, int caps, bool getref);
+  int _readdir_r_cb(int op,
+    dir_result_t* d,
+    add_dirent_cb_t cb,
+    fill_readdir_args_cb_t fill_cb,
+    void* p,
+    unsigned want,
+    unsigned flags,
+    bool getref,
+    bool bypass_cache);
+
   void _closedir(dir_result_t *dirp);
 
   // other helpers
@@ -1320,7 +1341,8 @@ private:
                 const UserPerm& perms);
 
   int _lookup(Inode *dir, const std::string& dname, int mask, InodeRef *target,
-             const UserPerm& perm, std::string* alternate_name=nullptr);
+             const UserPerm& perm, std::string* alternate_name=nullptr,
+              bool is_rename=false);
 
   int _link(Inode *in, Inode *dir, const char *name, const UserPerm& perm, std::string alternate_name,
            InodeRef *inp = 0);
@@ -1573,6 +1595,8 @@ private:
   std::map<std::pair<int64_t,std::string>, int> pool_perms;
   std::list<ceph::condition_variable*> waiting_for_pool_perm;
 
+  std::list<ceph::condition_variable*> waiting_for_rename;
+
   uint64_t retries_on_invalidate = 0;
 
   // state reclaim