Clean up code related to fuse_kill_requests() that's no longer used. Related to #VSTOR-101450 Signed-off-by: Liu Kui <kui....@virtuozzo.com> --- fs/fuse/fuse_i.h | 3 - fs/fuse/inode.c | 92 ------------------------------ fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 16 ------ 3 files changed, 111 deletions(-)
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 6b3a66dbf4a2..104cf1596085 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -706,7 +706,6 @@ struct fuse_kio_ops { int (*file_open)(struct file *file, struct inode *inode); void (*file_close)(struct file *file, struct inode *inode); void (*inode_release)(struct fuse_inode *fi); - void (*kill_requests)(struct fuse_conn *fc, struct inode *inode); int (*ioctl)(struct file *file, struct inode *inode, unsigned int cmd, unsigned long arg, int len); int (*dev_ioctl)(struct fuse_conn *fc, unsigned int cmd, unsigned long arg, int len); }; @@ -1660,8 +1659,6 @@ int fuse_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, struct fuse_file *__fuse_write_file_get(struct fuse_inode *fi); struct fuse_file *fuse_file_get(struct fuse_file *ff); void fuse_release_ff(struct inode *inode, struct fuse_file *ff); -void fuse_kill_requests(struct fuse_conn *fc, struct inode *inode, - struct list_head *req_list); struct fuse_req *fuse_dev_find_request(unsigned int fd, u64 unique); void fuse_revoke_readpages(struct fuse_file *ff); diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index a25ad82331d9..f6150ea1286b 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -597,57 +597,6 @@ void fuse_unlock_inode(struct inode *inode, bool locked) mutex_unlock(&get_fuse_inode(inode)->mutex); } -void fuse_kill_requests(struct fuse_conn *fc, struct inode *inode, - struct list_head *req_list) -{ - struct fuse_req *req; - - list_for_each_entry(req, req_list, list) - if (req->args->io_inode == inode && req->args->page_cache && - !req->args->killed) { - struct fuse_io_args *ia = container_of(req->args, typeof(*ia), - ap.args); - int i; - - BUG_ON(req->in.h.opcode != FUSE_READ); - - /* skip the request that is under data write back IO */ - if (test_bit(FR_LOCKED, &req->flags) && req->out.h.unique) - continue; - - req->args->killed = 1; - - for (i = 0; i < ia->ap.num_pages; i++) - folio_end_read(page_folio(ia->ap.pages[i]), 0); - } -} -EXPORT_SYMBOL_GPL(fuse_kill_requests); - -static void fuse_kill_routing(struct fuse_rtable *rt, struct fuse_conn *fc, struct inode *inode) -{ - if (rt->type == FUSE_ROUTING_CPU) { - int cpu; - - for_each_online_cpu(cpu) { - struct fuse_iqueue *fiq = per_cpu_ptr(rt->iqs_cpu, cpu); - - spin_lock(&fiq->lock); - fuse_kill_requests(fc, inode, &fiq->pending); - spin_unlock(&fiq->lock); - } - } else if (rt->type == FUSE_ROUTING_SIZE || rt->type == FUSE_ROUTING_HASH) { - int i; - - for (i = 0; i < rt->rt_size; i++) { - struct fuse_iqueue *fiq = rt->iqs_table + i; - - spin_lock(&fiq->lock); - fuse_kill_requests(fc, inode, &fiq->pending); - spin_unlock(&fiq->lock); - } - } -} - int fuse_invalidate_files(struct fuse_conn *fc, u64 nodeid) { struct inode *inode; @@ -685,53 +634,12 @@ int fuse_invalidate_files(struct fuse_conn *fc, u64 nodeid) err = filemap_write_and_wait(inode->i_mapping); if (!err || err == -EIO) { /* AS_EIO might trigger -EIO */ -#if 0 - struct fuse_dev *fud; - spin_lock(&fc->lock); - - /* - * Clean bg_queue first to prevent requests being flushed - * to an input queue after it has been cleaned . - */ - spin_lock(&fc->bg_lock); - fuse_kill_requests(fc, inode, &fc->bg_queue); - spin_unlock(&fc->bg_lock); - - if (fc->kio.op && fc->kio.op->kill_requests) - fc->kio.op->kill_requests(fc, inode); - - spin_lock(&fc->main_iq.lock); - fuse_kill_requests(fc, inode, &fc->main_iq.pending); - spin_unlock(&fc->main_iq.lock); - - fuse_kill_routing(&fc->rrt, fc, inode); - fuse_kill_routing(&fc->wrt, fc, inode); - - list_for_each_entry(fud, &fc->devices, entry) { - struct fuse_pqueue *fpq = &fud->pq; - struct fuse_iqueue *fiq = fud->fiq; - int i; - - spin_lock(&fiq->lock); - fuse_kill_requests(fc, inode, &fiq->pending); - spin_unlock(&fiq->lock); - - spin_lock(&fpq->lock); - for (i = 0; i < FUSE_PQ_HASH_SIZE; i++) - fuse_kill_requests(fc, inode, &fpq->processing[i]); - fuse_kill_requests(fc, inode, &fpq->io); - spin_unlock(&fpq->lock); - } - - spin_unlock(&fc->lock); -#endif spin_lock(&fi->lock); list_for_each_entry(ff, &fi->rw_files, rw_entry) fuse_revoke_readpages(ff); spin_unlock(&fi->lock); wake_up(&fi->page_waitq); /* readpage[s] can wait on fuse wb */ - err = invalidate_inode_pages2(inode->i_mapping); } diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c index 3638fe558f55..a2af5f10ec45 100644 --- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c +++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c @@ -1797,21 +1797,6 @@ void pcs_kio_req_list(struct fuse_conn *fc, kio_req_itr kreq_cb, void *ctx) pcs_kio_file_list(fc, kpcs_req_list_itr, &kreq_ctx); } -static void kpcs_kill_lreq_itr(struct fuse_file *ff, struct pcs_dentry_info *di, - void *ctx) -{ - struct inode *inode = ctx; - - spin_lock(&di->kq_lock); - fuse_kill_requests(ff->fm->fc, inode, &di->kq); - spin_unlock(&di->kq_lock); -} - -static void kpcs_kill_requests(struct fuse_conn *fc, struct inode *inode) -{ - pcs_kio_file_list(fc, kpcs_kill_lreq_itr, inode); -} - static int pcs_process_dislog(struct pcs_cluster_core *cc, struct pcs_mds_cached_event *evt) { switch (evt->flags & PCS_MDS_EVT_F_OBJ_MASK) { @@ -2061,7 +2046,6 @@ static struct fuse_kio_ops kio_pcs_ops = { .file_open = kpcs_file_open, .file_close = kpcs_file_close, .inode_release = kpcs_inode_release, - .kill_requests = kpcs_kill_requests, .ioctl = kpcs_ioctl, .dev_ioctl = kpcs_dev_ioctl, }; -- 2.39.5 (Apple Git-154) _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel