From: Dan Smith <danms@us.ibm.com>
To: danms@us.ibm.com
Cc: linux-fsdevel@vger.kernel.org, Oren Laadan <orenl@cs.columbia.edu>
Subject: [PATCH 12/19] c/r: introduce vfs_fcntl()
Date: Tue, 14 Dec 2010 08:15:00 -0800 [thread overview]
Message-ID: <1292343307-7870-12-git-send-email-danms@us.ibm.com> (raw)
In-Reply-To: <1292343307-7870-1-git-send-email-danms@us.ibm.com>
From: Oren Laadan <orenl@cs.columbia.edu>
This patch introduces vfs_fcntl() so that it can be called from
restart (see patch adding restart of files).
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Oren Laadan <orenl@cs.columbia.edu>
Acked-by: Serge E. Hallyn <serue@us.ibm.com>
Tested-by: Serge E. Hallyn <serue@us.ibm.com>
---
fs/fcntl.c | 21 +++++++++++++--------
include/linux/fs.h | 2 ++
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/fs/fcntl.c b/fs/fcntl.c
index ecc8b39..8e797b7 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -426,6 +426,18 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
return err;
}
+int vfs_fcntl(int fd, unsigned int cmd, unsigned long arg, struct file *filp)
+{
+ int err;
+
+ err = security_file_fcntl(filp, cmd, arg);
+ if (err)
+ goto out;
+ err = do_fcntl(fd, cmd, arg, filp);
+ out:
+ return err;
+}
+
SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
{
struct file *filp;
@@ -435,14 +447,7 @@ SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
if (!filp)
goto out;
- err = security_file_fcntl(filp, cmd, arg);
- if (err) {
- fput(filp);
- return err;
- }
-
- err = do_fcntl(fd, cmd, arg, filp);
-
+ err = vfs_fcntl(fd, cmd, arg, filp);
fput(filp);
out:
return err;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 12cc2e6..b0f8706 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1111,6 +1111,8 @@ struct file_lock {
#include <linux/fcntl.h>
+extern int vfs_fcntl(int fd, unsigned cmd, unsigned long arg, struct file *fp);
+
extern void send_sigio(struct fown_struct *fown, int fd, int band);
#ifdef CONFIG_FILE_LOCKING
--
1.7.2.2
next prev parent reply other threads:[~2010-12-14 16:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1292343307-7870-1-git-send-email-danms@us.ibm.com>
2010-12-14 16:14 ` [PATCH 04/19] Make file_pos_read/write() public and export kernel_write() Dan Smith
2010-12-14 16:45 ` Dan Smith
[not found] ` <1292343307-7870-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-12-14 16:14 ` [PATCH 05/19] c/r: documentation Dan Smith
2010-12-14 16:14 ` [PATCH 07/19] c/r: basic infrastructure for checkpoint/restart Dan Smith
2010-12-14 16:15 ` Dan Smith [this message]
2010-12-14 16:15 ` [PATCH 13/19] c/r: introduce new 'file_operations': ->checkpoint, ->collect() Dan Smith
2010-12-14 16:15 ` [PATCH 14/19] c/r: checkpoint and restart open file descriptors Dan Smith
2010-12-14 16:15 ` [PATCH 15/19] c/r: introduce method '->checkpoint()' in struct vm_operations_struct Dan Smith
2010-12-14 16:15 ` [PATCH 17/19] c/r: dump memory address space (private memory) Dan Smith
2010-12-14 16:15 ` [PATCH 18/19] c/r: add generic '->checkpoint' f_op to ext fses Dan Smith
2010-12-14 16:15 ` [PATCH 19/19] c/r: add generic '->checkpoint()' f_op to simple devices Dan Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292343307-7870-12-git-send-email-danms@us.ibm.com \
--to=danms@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=orenl@cs.columbia.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).