Whamcloud - gitweb
LU-18813 osd-wbcfs: remove f_op llseek checks 05/59305/2
authorTimothy Day <timday@amazon.com>
Tue, 20 May 2025 04:57:57 +0000 (00:57 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Jun 2025 23:04:11 +0000 (23:04 +0000)
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 <timday@amazon.com>
Change-Id: I77f7abcef686c9c654b7bee04b3f88bb89a87756
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59305
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Lijing Chen <lijinc@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-wbcfs/osd_dirent.c

index 2926494..4daf455 100644 (file)
@@ -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)