Skip to content

Commit d8ca6db

Browse files
committed
Merge tag 'nfs-for-6.3-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
Pull NFS client updates from Anna Schumaker: "New Features: - Convert the read and write paths to use folios Bugfixes and Cleanups: - Fix tracepoint state manager flag printing - Fix disabling swap files - Fix NFSv4 client identifier sysfs path in the documentation - Don't clear NFS_CAP_COPY if server returns NFS4ERR_OFFLOAD_DENIED - Treat GETDEVICEINFO errors as a layout failure - Replace kmap_atomic() calls with kmap_local_page() - Constify sunrpc sysfs kobj_type structures" * tag 'nfs-for-6.3-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (25 commits) fs/nfs: Replace kmap_atomic() with kmap_local_page() in dir.c pNFS/filelayout: treat GETDEVICEINFO errors as layout failure Documentation: Fix sysfs path for the NFSv4 client identifier nfs42: do not fail with EIO if ssc returns NFS4ERR_OFFLOAD_DENIED NFS: fix disabling of swap SUNRPC: make kobj_type structures constant nfs4trace: fix state manager flag printing NFS: Remove unnecessary check in nfs_read_folio() NFS: Improve tracing of nfs_wb_folio() NFS: Enable tracing of nfs_invalidate_folio() and nfs_launder_folio() NFS: fix up nfs_release_folio() to try to release the page NFS: Clean up O_DIRECT request allocation NFS: Fix up nfs_vm_page_mkwrite() for folios NFS: Convert nfs_write_begin/end to use folios NFS: Remove unused function nfs_wb_page() NFS: Convert buffered writes to use folios NFS: Convert the function nfs_wb_page() to use folios NFS: Convert buffered reads to use folios NFS: Add a helper nfs_wb_folio() NFS: Convert the remaining pagelist helper functions to support folios ...
2 parents 9fc2f99 + 1683ed1 commit d8ca6db

File tree

20 files changed

+698
-434
lines changed

20 files changed

+698
-434
lines changed

Documentation/filesystems/nfs/client-identifier.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ string:
152152
via the kernel command line, or when the "nfs" module is
153153
loaded.
154154

155-
/sys/fs/nfs/client/net/identifier
155+
/sys/fs/nfs/net/nfs_client/identifier
156156
This virtual file, available since Linux 5.3, is local to the
157157
network namespace in which it is accessed and so can provide
158158
distinction between network namespaces (containers) when the
@@ -164,7 +164,7 @@ then that uniquifier can be used. For example, a uniquifier might
164164
be formed at boot using the container's internal identifier:
165165

166166
sha256sum /etc/machine-id | awk '{print $1}' \\
167-
> /sys/fs/nfs/client/net/identifier
167+
> /sys/fs/nfs/net/nfs_client/identifier
168168

169169
Security considerations
170170
-----------------------

fs/nfs/dir.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,14 @@ static void nfs_readdir_page_init_array(struct page *page, u64 last_cookie,
203203
{
204204
struct nfs_cache_array *array;
205205

206-
array = kmap_atomic(page);
206+
array = kmap_local_page(page);
207207
array->change_attr = change_attr;
208208
array->last_cookie = last_cookie;
209209
array->size = 0;
210210
array->page_full = 0;
211211
array->page_is_eof = 0;
212212
array->cookies_are_ordered = 1;
213-
kunmap_atomic(array);
213+
kunmap_local(array);
214214
}
215215

216216
/*
@@ -221,11 +221,11 @@ static void nfs_readdir_clear_array(struct page *page)
221221
struct nfs_cache_array *array;
222222
unsigned int i;
223223

224-
array = kmap_atomic(page);
224+
array = kmap_local_page(page);
225225
for (i = 0; i < array->size; i++)
226226
kfree(array->array[i].name);
227227
array->size = 0;
228-
kunmap_atomic(array);
228+
kunmap_local(array);
229229
}
230230

231231
static void nfs_readdir_free_folio(struct folio *folio)
@@ -371,14 +371,14 @@ static pgoff_t nfs_readdir_page_cookie_hash(u64 cookie)
371371
static bool nfs_readdir_page_validate(struct page *page, u64 last_cookie,
372372
u64 change_attr)
373373
{
374-
struct nfs_cache_array *array = kmap_atomic(page);
374+
struct nfs_cache_array *array = kmap_local_page(page);
375375
int ret = true;
376376

377377
if (array->change_attr != change_attr)
378378
ret = false;
379379
if (nfs_readdir_array_index_cookie(array) != last_cookie)
380380
ret = false;
381-
kunmap_atomic(array);
381+
kunmap_local(array);
382382
return ret;
383383
}
384384

@@ -418,9 +418,9 @@ static u64 nfs_readdir_page_last_cookie(struct page *page)
418418
struct nfs_cache_array *array;
419419
u64 ret;
420420

421-
array = kmap_atomic(page);
421+
array = kmap_local_page(page);
422422
ret = array->last_cookie;
423-
kunmap_atomic(array);
423+
kunmap_local(array);
424424
return ret;
425425
}
426426

@@ -429,19 +429,19 @@ static bool nfs_readdir_page_needs_filling(struct page *page)
429429
struct nfs_cache_array *array;
430430
bool ret;
431431

432-
array = kmap_atomic(page);
432+
array = kmap_local_page(page);
433433
ret = !nfs_readdir_array_is_full(array);
434-
kunmap_atomic(array);
434+
kunmap_local(array);
435435
return ret;
436436
}
437437

438438
static void nfs_readdir_page_set_eof(struct page *page)
439439
{
440440
struct nfs_cache_array *array;
441441

442-
array = kmap_atomic(page);
442+
array = kmap_local_page(page);
443443
nfs_readdir_array_set_eof(array);
444-
kunmap_atomic(array);
444+
kunmap_local(array);
445445
}
446446

447447
static struct page *nfs_readdir_page_get_next(struct address_space *mapping,
@@ -568,14 +568,14 @@ static int nfs_readdir_search_array(struct nfs_readdir_descriptor *desc)
568568
struct nfs_cache_array *array;
569569
int status;
570570

571-
array = kmap_atomic(desc->page);
571+
array = kmap_local_page(desc->page);
572572

573573
if (desc->dir_cookie == 0)
574574
status = nfs_readdir_search_for_pos(array, desc);
575575
else
576576
status = nfs_readdir_search_for_cookie(array, desc);
577577

578-
kunmap_atomic(array);
578+
kunmap_local(array);
579579
return status;
580580
}
581581

fs/nfs/direct.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,12 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
343343
struct nfs_page *req;
344344
unsigned int req_len = min_t(size_t, bytes, PAGE_SIZE - pgbase);
345345
/* XXX do we need to do the eof zeroing found in async_filler? */
346-
req = nfs_create_request(dreq->ctx, pagevec[i],
347-
pgbase, req_len);
346+
req = nfs_page_create_from_page(dreq->ctx, pagevec[i],
347+
pgbase, pos, req_len);
348348
if (IS_ERR(req)) {
349349
result = PTR_ERR(req);
350350
break;
351351
}
352-
req->wb_index = pos >> PAGE_SHIFT;
353-
req->wb_offset = pos & ~PAGE_MASK;
354352
if (!nfs_pageio_add_request(&desc, req)) {
355353
result = desc.pg_error;
356354
nfs_release_request(req);
@@ -802,8 +800,8 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
802800
struct nfs_page *req;
803801
unsigned int req_len = min_t(size_t, bytes, PAGE_SIZE - pgbase);
804802

805-
req = nfs_create_request(dreq->ctx, pagevec[i],
806-
pgbase, req_len);
803+
req = nfs_page_create_from_page(dreq->ctx, pagevec[i],
804+
pgbase, pos, req_len);
807805
if (IS_ERR(req)) {
808806
result = PTR_ERR(req);
809807
break;
@@ -816,8 +814,6 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
816814
}
817815

818816
nfs_lock_request(req);
819-
req->wb_index = pos >> PAGE_SHIFT;
820-
req->wb_offset = pos & ~PAGE_MASK;
821817
if (!nfs_pageio_add_request(&desc, req)) {
822818
result = desc.pg_error;
823819
nfs_unlock_and_release_request(req);

0 commit comments

Comments
 (0)