提交 09db4841 编写于 作者: V Vivek Goyal 提交者: Caspar Zhang

fuse: Export fuse_dequeue_forget() function

task #28910367
commit 4388c5aac4bae5c83a2c66882043942002ba09a2 upstream

stacked file systems like virtio-fs do not have to play directly with
forget list data structures. There is a helper function use that instead.

Rename dequeue_forget() to fuse_dequeue_forget() and export it so that
stacked filesystems can use it.
Signed-off-by: NVivek Goyal <vgoyal@redhat.com>
Signed-off-by: NLiu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 f96b6dd6
......@@ -1138,7 +1138,7 @@ __releases(fiq->lock)
return err ? err : reqsize;
}
static struct fuse_forget_link *dequeue_forget(struct fuse_iqueue *fiq,
struct fuse_forget_link *fuse_dequeue_forget(struct fuse_iqueue *fiq,
unsigned max,
unsigned *countp)
{
......@@ -1159,6 +1159,7 @@ static struct fuse_forget_link *dequeue_forget(struct fuse_iqueue *fiq,
return head;
}
EXPORT_SYMBOL(fuse_dequeue_forget);
static int fuse_read_single_forget(struct fuse_iqueue *fiq,
struct fuse_copy_state *cs,
......@@ -1166,7 +1167,7 @@ static int fuse_read_single_forget(struct fuse_iqueue *fiq,
__releases(fiq->lock)
{
int err;
struct fuse_forget_link *forget = dequeue_forget(fiq, 1, NULL);
struct fuse_forget_link *forget = fuse_dequeue_forget(fiq, 1, NULL);
struct fuse_forget_in arg = {
.nlookup = forget->forget_one.nlookup,
};
......@@ -1214,7 +1215,7 @@ __releases(fiq->lock)
}
max_forgets = (nbytes - ih.len) / sizeof(struct fuse_forget_one);
head = dequeue_forget(fiq, max_forgets, &count);
head = fuse_dequeue_forget(fiq, max_forgets, &count);
spin_unlock(&fiq->lock);
arg.count = count;
......@@ -2182,7 +2183,7 @@ void fuse_abort_conn(struct fuse_conn *fc, bool is_abort)
clear_bit(FR_PENDING, &req->flags);
list_splice_tail_init(&fiq->pending, &to_end);
while (forget_pending(fiq))
kfree(dequeue_forget(fiq, 1, NULL));
kfree(fuse_dequeue_forget(fiq, 1, NULL));
wake_up_all(&fiq->waitq);
spin_unlock(&fiq->lock);
kill_fasync(&fiq->fasync, SIGIO, POLL_IN);
......
......@@ -784,6 +784,9 @@ void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget,
struct fuse_forget_link *fuse_alloc_forget(void);
struct fuse_forget_link *fuse_dequeue_forget(struct fuse_iqueue *fiq,
unsigned max, unsigned *countp);
/* Used by READDIRPLUS */
void fuse_force_forget(struct file *file, u64 nodeid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册