Skip to content

Commit 9558f25

Browse files
author
Christoph Hellwig
committed
nfsd: add fh_fsid_match helper
Add a helper to check that the fsid parts of two file handles match. Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 4d94c2e commit 9558f25

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/nfsd/nfsfh.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ static inline bool fh_match(struct knfsd_fh *fh1, struct knfsd_fh *fh2)
196196
return true;
197197
}
198198

199+
static inline bool fh_fsid_match(struct knfsd_fh *fh1, struct knfsd_fh *fh2)
200+
{
201+
if (fh1->fh_fsid_type != fh2->fh_fsid_type)
202+
return false;
203+
if (memcmp(fh1->fh_fsid, fh2->fh_fsid, key_len(fh1->fh_fsid_type) != 0))
204+
return false;
205+
return true;
206+
}
207+
199208
#ifdef CONFIG_NFSD_V3
200209
/*
201210
* The wcc data stored in current_fh should be cleared

0 commit comments

Comments
 (0)