lkml.org 
[lkml]   [2018]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC][PATCH 04/42] make get_empty_filp() to call file_free_rcu() directly
Date
From: Al Viro <viro@zeniv.linux.org.uk>

no point in rcu-delays here

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/file_table.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/file_table.c b/fs/file_table.c
index 7ec0b3e5f05d..1f14b80a4e67 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -123,11 +123,10 @@ struct file *get_empty_filp(void)
if (unlikely(!f))
return ERR_PTR(-ENOMEM);

- percpu_counter_inc(&nr_files);
f->f_cred = get_cred(cred);
error = security_file_alloc(f);
if (unlikely(error)) {
- file_free(f);
+ file_free_rcu(&f->f_u.fu_rcuhead);
return ERR_PTR(error);
}

@@ -137,6 +136,7 @@ struct file *get_empty_filp(void)
mutex_init(&f->f_pos_lock);
eventpoll_init_file(f);
/* f->f_version: 0 */
+ percpu_counter_inc(&nr_files);
return f;

over:
--
2.11.0
\
 
 \ /
  Last update: 2018-07-11 04:27    [W:0.317 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site