From: Xiubo Li Date: Tue, 9 Feb 2021 03:07:44 +0000 (+0800) Subject: client: minor cleanup to Fh related code X-Git-Tag: v17.1.0~628^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5ce296c23a6ef2225345c9114cac3976f2898949;p=ceph.git client: minor cleanup to Fh related code To make the code more readable and there is no need to care about the members order when initlizeing them. Signed-off-by: Xiubo Li --- diff --git a/src/client/Fh.cc b/src/client/Fh.cc index 62bd261404e..e72390df714 100644 --- a/src/client/Fh.cc +++ b/src/client/Fh.cc @@ -19,8 +19,8 @@ #include "Fh.h" Fh::Fh(InodeRef in, int flags, int cmode, uint64_t _gen, const UserPerm &perms) : - inode(in), _ref(1), pos(0), mds(0), mode(cmode), gen(_gen), flags(flags), - pos_locked(false), actor_perms(perms), readahead() + inode(in), mode(cmode), gen(_gen), flags(flags), actor_perms(perms), + readahead() { inode->add_fh(this); } diff --git a/src/client/Fh.h b/src/client/Fh.h index c3355ba6c52..3448f5b6ac8 100644 --- a/src/client/Fh.h +++ b/src/client/Fh.h @@ -13,14 +13,14 @@ class Inode; struct Fh { InodeRef inode; - int _ref; - loff_t pos; - int mds; // have to talk to mds we opened with (for now) + int _ref = 1; + loff_t pos = 0; + int mds = 0; // have to talk to mds we opened with (for now) int mode; // the mode i opened the file with uint64_t gen; int flags; - bool pos_locked; // pos is currently in use + bool pos_locked = false; // pos is currently in use std::list pos_waiters; // waiters for pos UserPerm actor_perms; // perms I opened the file with