Skip to content

Commit 9ab1209

Browse files
committed
client: move mref_reader check in statfs out of helper
Signed-off-by: Christopher Hoffman <[email protected]>
1 parent 61c13a9 commit 9ab1209

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/client/Client.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12529,10 +12529,6 @@ int Client::getcwd(string& dir, const UserPerm& perms)
1252912529
int Client::_statfs(Inode *in, struct statvfs *stbuf,
1253012530
const UserPerm& perms)
1253112531
{
12532-
RWRef_t mref_reader(mount_state, CLIENT_MOUNTING);
12533-
if (!mref_reader.is_state_satisfied())
12534-
return -ENOTCONN;
12535-
1253612532
ldout(cct, 10) << __func__ << dendl;
1253712533
tout(cct) << __func__ << std::endl;
1253812534
unsigned long int total_files_on_fs;
@@ -12970,6 +12966,10 @@ int Client::get_snap_info(const char *path, const UserPerm &perms, SnapInfo *sna
1297012966

1297112967
int Client::ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms)
1297212968
{
12969+
RWRef_t mref_reader(mount_state, CLIENT_MOUNTING);
12970+
if (!mref_reader.is_state_satisfied())
12971+
return -ENOTCONN;
12972+
1297312973
/* Since the only thing this does is wrap a call to statfs, and
1297412974
statfs takes a lock, it doesn't seem we have a need to split it
1297512975
out. */
@@ -12978,6 +12978,10 @@ int Client::ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms)
1297812978

1297912979
int Client::statfs(const char *path, struct statvfs *stbuf, const UserPerm& perms)
1298012980
{
12981+
RWRef_t mref_reader(mount_state, CLIENT_MOUNTING);
12982+
if (!mref_reader.is_state_satisfied())
12983+
return -ENOTCONN;
12984+
1298112985
walk_dentry_result wdr;
1298212986
{
1298312987
std::scoped_lock l(client_lock);

0 commit comments

Comments
 (0)