* alloc_file(): simplify handling of mnt_clone_write() errors
@ 2009-12-16 20:48 Roland Dreier
0 siblings, 0 replies; only message in thread
From: Roland Dreier @ 2009-12-16 20:48 UTC (permalink / raw)
To: linux-kernel, Al Viro
When alloc_file() and init_file() were combined, the error handling of
mnt_clone_write() was taken into alloc_file() in a somewhat obfuscated
way. Since we don't use the error code for anything except warning,
we might as well warn directly without an extra variable.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
fs/file_table.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/fs/file_table.c b/fs/file_table.c
index 17a55b8..25fe294 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -186,10 +186,8 @@ struct file *alloc_file(struct path *path, fmode_t mode,
* that we can do debugging checks at __fput()
*/
if ((mode & FMODE_WRITE) && !special_file(path->dentry->d_inode->i_mode)) {
- int error = 0;
file_take_write(file);
- error = mnt_clone_write(path->mnt);
- WARN_ON(error);
+ WARN_ON(mnt_clone_write(path->mnt));
}
ima_counts_get(file);
return file;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-12-16 20:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-16 20:48 alloc_file(): simplify handling of mnt_clone_write() errors Roland Dreier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®