mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 05:11:48 +00:00
afs next
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEqG5UsNXhtOCrfGQP+7dXa6fLC2sFAmOkQmcACgkQ+7dXa6fL C2vjNg/8CWHpUQj32SSASt5uQvndqBe3xyr+NPYRdNddcu/gS82UoMSuOdMh+afb OhZ/yrkWzkraJVMgEc2mbe0xfGEN9TRQnld+/oy5Co2dxlLAtA/Iw3xZKKG5V5J1 CVE8V2SUtPC0ycJ4XLNuwfmaTEGxZjKju832V4qWvT8oz299Xl4MTsu3zN+Rqpih TAAfokfMVTN57x6PTd+KCl8dmExRyRIq70Iu9OwHPF9lFFDVqGlzGPYJ+gPqSKxV B0F/sW6y1djuyL8wFuZn+W1ECf3DnA9Ol2cSP6qEsWrymQkjY/9tntN52Hu22y9x xP6MHXKQXF+gjmX7aokivTTcOSw6/ript1ykcaNlz7ZX31mxKQIsb++jHSWshs6f 7Ncbjffqg+L8CmgVvaQ63dNVBvHa+Y+9Os8H0t8DZ0DoY6Crv+W8ssQkjW3Lqdoq DIlOFRKEbeXO0+hTM00te3NhP8sYKGtjup8Xuv8TMqye2hE8DvBu80qdvISBmglP P8odB7Rlwxp9n7jkBUFdc86IrQOHchao1Q7xNY4RDe/CZc6smNBgwf7aK5TONZkk qQGmVk2Ca/rFNQxXAV/iHRFCPJtTcdOk7b6kYWHFVj0E+r0iYNeMD4+hKfQK6W4X u4MzrmX9qm8+zN4e+FSpMU7OEDw2Yi87KmGrz4nbvK6wNW7o6Go= =B9ez -----END PGP SIGNATURE----- Merge tag 'afs-next-20221222' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull afs update from David Howells: "A fix for a couple of missing resource counter decrements, two small cleanups of now-unused bits of code and a patch to remove writepage support from afs" * tag 'afs-next-20221222' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Stop implementing ->writepage() afs: remove afs_cache_netfs and afs_zap_permits() declarations afs: remove variable nr_servers afs: Fix lost servers_outstanding count
This commit is contained in:
commit
ff75ec43a2
@ -77,6 +77,7 @@ const struct address_space_operations afs_dir_aops = {
|
||||
.dirty_folio = afs_dir_dirty_folio,
|
||||
.release_folio = afs_dir_release_folio,
|
||||
.invalidate_folio = afs_dir_invalidate_folio,
|
||||
.migrate_folio = filemap_migrate_folio,
|
||||
};
|
||||
|
||||
const struct dentry_operations afs_fs_dentry_operations = {
|
||||
|
@ -58,14 +58,15 @@ const struct address_space_operations afs_file_aops = {
|
||||
.invalidate_folio = afs_invalidate_folio,
|
||||
.write_begin = afs_write_begin,
|
||||
.write_end = afs_write_end,
|
||||
.writepage = afs_writepage,
|
||||
.writepages = afs_writepages,
|
||||
.migrate_folio = filemap_migrate_folio,
|
||||
};
|
||||
|
||||
const struct address_space_operations afs_symlink_aops = {
|
||||
.read_folio = afs_symlink_read_folio,
|
||||
.release_folio = afs_release_folio,
|
||||
.invalidate_folio = afs_invalidate_folio,
|
||||
.migrate_folio = filemap_migrate_folio,
|
||||
};
|
||||
|
||||
static const struct vm_operations_struct afs_vm_ops = {
|
||||
|
@ -366,12 +366,15 @@ void afs_fs_probe_dispatcher(struct work_struct *work)
|
||||
unsigned long nowj, timer_at, poll_at;
|
||||
bool first_pass = true, set_timer = false;
|
||||
|
||||
if (!net->live)
|
||||
if (!net->live) {
|
||||
afs_dec_servers_outstanding(net);
|
||||
return;
|
||||
}
|
||||
|
||||
_enter("");
|
||||
|
||||
if (list_empty(&net->fs_probe_fast) && list_empty(&net->fs_probe_slow)) {
|
||||
afs_dec_servers_outstanding(net);
|
||||
_leave(" [none]");
|
||||
return;
|
||||
}
|
||||
|
@ -971,13 +971,6 @@ extern int afs_end_cursor(struct afs_addr_cursor *);
|
||||
extern void afs_merge_fs_addr4(struct afs_addr_list *, __be32, u16);
|
||||
extern void afs_merge_fs_addr6(struct afs_addr_list *, __be32 *, u16);
|
||||
|
||||
/*
|
||||
* cache.c
|
||||
*/
|
||||
#ifdef CONFIG_AFS_FSCACHE
|
||||
extern struct fscache_netfs afs_cache_netfs;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* callback.c
|
||||
*/
|
||||
@ -1391,7 +1384,6 @@ extern void afs_put_permits(struct afs_permits *);
|
||||
extern void afs_clear_permits(struct afs_vnode *);
|
||||
extern void afs_cache_permit(struct afs_vnode *, struct key *, unsigned int,
|
||||
struct afs_status_cb *);
|
||||
extern void afs_zap_permits(struct rcu_head *);
|
||||
extern struct key *afs_request_key(struct afs_cell *);
|
||||
extern struct key *afs_request_key_rcu(struct afs_cell *);
|
||||
extern int afs_check_permit(struct afs_vnode *, struct key *, afs_access_t *);
|
||||
|
@ -70,11 +70,7 @@ static struct afs_volume *afs_alloc_volume(struct afs_fs_context *params,
|
||||
{
|
||||
struct afs_server_list *slist;
|
||||
struct afs_volume *volume;
|
||||
int ret = -ENOMEM, nr_servers = 0, i;
|
||||
|
||||
for (i = 0; i < vldb->nr_servers; i++)
|
||||
if (vldb->fs_mask[i] & type_mask)
|
||||
nr_servers++;
|
||||
int ret = -ENOMEM;
|
||||
|
||||
volume = kzalloc(sizeof(struct afs_volume), GFP_KERNEL);
|
||||
if (!volume)
|
||||
|
@ -14,6 +14,11 @@
|
||||
#include <linux/netfs.h>
|
||||
#include "internal.h"
|
||||
|
||||
static int afs_writepages_region(struct address_space *mapping,
|
||||
struct writeback_control *wbc,
|
||||
loff_t start, loff_t end, loff_t *_next,
|
||||
bool max_one_loop);
|
||||
|
||||
static void afs_write_to_cache(struct afs_vnode *vnode, loff_t start, size_t len,
|
||||
loff_t i_size, bool caching);
|
||||
|
||||
@ -38,6 +43,25 @@ static void afs_folio_start_fscache(bool caching, struct folio *folio)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Flush out a conflicting write. This may extend the write to the surrounding
|
||||
* pages if also dirty and contiguous to the conflicting region..
|
||||
*/
|
||||
static int afs_flush_conflicting_write(struct address_space *mapping,
|
||||
struct folio *folio)
|
||||
{
|
||||
struct writeback_control wbc = {
|
||||
.sync_mode = WB_SYNC_ALL,
|
||||
.nr_to_write = LONG_MAX,
|
||||
.range_start = folio_pos(folio),
|
||||
.range_end = LLONG_MAX,
|
||||
};
|
||||
loff_t next;
|
||||
|
||||
return afs_writepages_region(mapping, &wbc, folio_pos(folio), LLONG_MAX,
|
||||
&next, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* prepare to perform part of a write to a page
|
||||
*/
|
||||
@ -80,7 +104,8 @@ try_again:
|
||||
|
||||
if (folio_test_writeback(folio)) {
|
||||
trace_afs_folio_dirty(vnode, tracepoint_string("alrdy"), folio);
|
||||
goto flush_conflicting_write;
|
||||
folio_unlock(folio);
|
||||
goto wait_for_writeback;
|
||||
}
|
||||
/* If the file is being filled locally, allow inter-write
|
||||
* spaces to be merged into writes. If it's not, only write
|
||||
@ -99,8 +124,15 @@ try_again:
|
||||
* flush the page out.
|
||||
*/
|
||||
flush_conflicting_write:
|
||||
_debug("flush conflict");
|
||||
ret = folio_write_one(folio);
|
||||
trace_afs_folio_dirty(vnode, tracepoint_string("confl"), folio);
|
||||
folio_unlock(folio);
|
||||
|
||||
ret = afs_flush_conflicting_write(mapping, folio);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
wait_for_writeback:
|
||||
ret = folio_wait_writeback_killable(folio);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
@ -663,40 +695,13 @@ static ssize_t afs_write_back_from_locked_folio(struct address_space *mapping,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* write a page back to the server
|
||||
* - the caller locked the page for us
|
||||
*/
|
||||
int afs_writepage(struct page *subpage, struct writeback_control *wbc)
|
||||
{
|
||||
struct folio *folio = page_folio(subpage);
|
||||
ssize_t ret;
|
||||
loff_t start;
|
||||
|
||||
_enter("{%lx},", folio_index(folio));
|
||||
|
||||
#ifdef CONFIG_AFS_FSCACHE
|
||||
folio_wait_fscache(folio);
|
||||
#endif
|
||||
|
||||
start = folio_index(folio) * PAGE_SIZE;
|
||||
ret = afs_write_back_from_locked_folio(folio_mapping(folio), wbc,
|
||||
folio, start, LLONG_MAX - start);
|
||||
if (ret < 0) {
|
||||
_leave(" = %zd", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
_leave(" = 0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* write a region of pages back to the server
|
||||
*/
|
||||
static int afs_writepages_region(struct address_space *mapping,
|
||||
struct writeback_control *wbc,
|
||||
loff_t start, loff_t end, loff_t *_next)
|
||||
loff_t start, loff_t end, loff_t *_next,
|
||||
bool max_one_loop)
|
||||
{
|
||||
struct folio *folio;
|
||||
struct page *head_page;
|
||||
@ -775,6 +780,9 @@ static int afs_writepages_region(struct address_space *mapping,
|
||||
|
||||
start += ret;
|
||||
|
||||
if (max_one_loop)
|
||||
break;
|
||||
|
||||
cond_resched();
|
||||
} while (wbc->nr_to_write > 0);
|
||||
|
||||
@ -806,24 +814,27 @@ int afs_writepages(struct address_space *mapping,
|
||||
|
||||
if (wbc->range_cyclic) {
|
||||
start = mapping->writeback_index * PAGE_SIZE;
|
||||
ret = afs_writepages_region(mapping, wbc, start, LLONG_MAX, &next);
|
||||
ret = afs_writepages_region(mapping, wbc, start, LLONG_MAX,
|
||||
&next, false);
|
||||
if (ret == 0) {
|
||||
mapping->writeback_index = next / PAGE_SIZE;
|
||||
if (start > 0 && wbc->nr_to_write > 0) {
|
||||
ret = afs_writepages_region(mapping, wbc, 0,
|
||||
start, &next);
|
||||
start, &next, false);
|
||||
if (ret == 0)
|
||||
mapping->writeback_index =
|
||||
next / PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
} else if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) {
|
||||
ret = afs_writepages_region(mapping, wbc, 0, LLONG_MAX, &next);
|
||||
ret = afs_writepages_region(mapping, wbc, 0, LLONG_MAX,
|
||||
&next, false);
|
||||
if (wbc->nr_to_write > 0 && ret == 0)
|
||||
mapping->writeback_index = next / PAGE_SIZE;
|
||||
} else {
|
||||
ret = afs_writepages_region(mapping, wbc,
|
||||
wbc->range_start, wbc->range_end, &next);
|
||||
wbc->range_start, wbc->range_end,
|
||||
&next, false);
|
||||
}
|
||||
|
||||
up_read(&vnode->validate_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user