From: Timothy Day Date: Tue, 20 May 2025 04:57:57 +0000 (-0400) Subject: LU-18813 osd-wbcfs: remove f_op llseek checks X-Git-Tag: 2.16.56~10 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=21789dab4f9bcce587acaa33214eb0844a57929e;p=fs%2Flustre-release.git LU-18813 osd-wbcfs: remove f_op llseek checks MemFS will always have llseek defined, so we can remove the checks in the OSD. Test-Parameters: trivial Test-Parameters: testlist=sanity fstype=wbcfs mdscount=4 mdtcount=1 osscount=4 ostcount=1 Test-Parameters: testlist=sanity fstype=wbcfs combinedmdsmgs=false standalonemgs=true mdscount=1 mdtcount=1 osscount=4 ostcount=1 Signed-off-by: Timothy Day Change-Id: I77f7abcef686c9c654b7bee04b3f88bb89a87756 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59305 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Qian Yingjin Reviewed-by: Lijing Chen Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-wbcfs/osd_dirent.c b/lustre/osd-wbcfs/osd_dirent.c index 2926494..4daf455 100644 --- a/lustre/osd-wbcfs/osd_dirent.c +++ b/lustre/osd-wbcfs/osd_dirent.c @@ -397,19 +397,15 @@ static int osd_dir_it_get(const struct lu_env *env, { struct osd_it *it = (struct osd_it *)di; struct file *file = &it->oit_file; + loff_t offset; ENTRY; LASSERT(((const char *)key)[0] == '\0'); - if (file->f_op->llseek) { - loff_t offset; - offset = file->f_op->llseek(file, 0, 0); - if (offset != 0) - CWARN("Failed to llseek(): offset %lld != 0\n", offset); - } else { - it->oit_file.f_pos = 0; - } + offset = file->f_op->llseek(file, 0, 0); + if (offset) + CWARN("Failed to llseek(): offset %lld != 0\n", offset); it->oit_rd_dirent = 0; it->oit_it_dirent = 0; @@ -782,14 +778,10 @@ static int osd_dir_it_load(const struct lu_env *env, ENTRY; - if (file->f_op->llseek) { - offset = file->f_op->llseek(file, hash, 0); - if (offset != hash) - CWARN("Failed to llseek(): offset %lld != hash %llu\n", - offset, hash); - } else { - it->oit_file.f_pos = hash; - } + offset = file->f_op->llseek(file, hash, 0); + if (offset != hash) + CWARN("Failed to llseek(): offset %lld != hash %llu\n", + offset, hash); rc = osd_memfs_it_fill(env, di); if (rc > 0)