From: Roland Dreier Date: Wed, 16 Dec 2009 20:48:44 +0000 (-0800) Subject: alloc_file(): simplify handling of mnt_clone_write() errors X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=385e3ed4f0b81dd0b0b214050a30d352a71b95f7;p=openwrt%2Fstaging%2Fblogic.git alloc_file(): simplify handling of mnt_clone_write() errors 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 Signed-off-by: Al Viro --- diff --git a/fs/file_table.c b/fs/file_table.c index 0afacf654398..69652c5bd5f0 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;