[3/4] autofs: Use files.c version of find_used_fd

Submitted by Pavel Emelianov on Feb. 10, 2017, 12:05 p.m.

Details

Message ID 589DAC9A.2010306@virtuozzo.com
State New
Series "sanitize rsti fds and used lists"
Headers show

Commit Message

Pavel Emelianov Feb. 10, 2017, 12:05 p.m.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>

---
 criu/autofs.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/autofs.c b/criu/autofs.c
index 0ba99fc..5dfe0c6 100644
--- a/criu/autofs.c
+++ b/criu/autofs.c
@@ -828,17 +828,6 @@  static autofs_info_t *autofs_create_info(const struct mount_info *mi,
 	return i;
 }
 
-static struct fdinfo_list_entry *find_fle_by_fd(struct list_head *head, int fd)
-{
-	struct fdinfo_list_entry *fle;
-
-	list_for_each_entry(fle, head, used_list) {
-		if (fle->fe->fd == fd)
-			return fle;
-	}
-	return NULL;
-}
-
 static struct fdinfo_list_entry *autofs_pipe_le(struct pstree_item *master,
 						AutofsEntry *entry)
 {
@@ -848,7 +837,7 @@  static struct fdinfo_list_entry *autofs_pipe_le(struct pstree_item *master,
 	if (entry->has_read_fd)
 		pipe_fd = entry->read_fd;
 
-	ple = find_fle_by_fd(&rsti(master)->used, pipe_fd);
+	ple = find_used_fd(master, pipe_fd);
 	if (!ple) {
 		pr_err("Failed to find pipe fd %d in process %d\n",
 				pipe_fd, master->pid->ns[0].virt);