From: Cyrill Gorcunov <gorcunov@openvz.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Pavel Emelyanov <xemul@parallels.com>,
James Bottomley <jbottomley@parallels.com>,
ebiederm@xmission.com, tj@kernel.org, skinsbursky@openvz.org,
Cyrill Gorcunov <gorcunov@openvz.org>
Subject: [rfc v2 6/7] fs, exportfs: Add export_encode_inode_fh helper
Date: Wed, 23 May 2012 14:25:47 +0400 [thread overview]
Message-ID: <20120523104031.152885239@openvz.org> (raw)
In-Reply-To: 20120523102541.382837149@openvz.org
[-- Attachment #1: seq-fs-exportfs-ino-2 --]
[-- Type: text/plain, Size: 1936 bytes --]
To provide fsnotify object inodes being watched without
binding to alphabetical path we need to encode them with
exportfs help. This patch adds a helper which operates
with plain inodes directly.
This feature is CONFIG_CHECKPOINT_RESTORE only.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Pavel Emelyanov <xemul@parallels.com>
CC: James Bottomley <jbottomley@parallels.com>
---
fs/exportfs/expfs.c | 21 +++++++++++++++++++++
include/linux/exportfs.h | 4 ++++
2 files changed, 25 insertions(+)
Index: linux-2.6.git/fs/exportfs/expfs.c
===================================================================
--- linux-2.6.git.orig/fs/exportfs/expfs.c
+++ linux-2.6.git/fs/exportfs/expfs.c
@@ -302,6 +302,27 @@ out:
return error;
}
+#ifdef CONFIG_CHECKPOINT_RESTORE
+int export_encode_inode_fh(struct inode *inode, struct fid *fid, int *max_len)
+{
+ int len = *max_len;
+ int type = FILEID_INO32_GEN;
+
+ if (len < 2) {
+ *max_len = 2;
+ return 255;
+ }
+
+ len = 2;
+ fid->i32.ino = inode->i_ino;
+ fid->i32.gen = inode->i_generation;
+ *max_len = len;
+
+ return type;
+}
+EXPORT_SYMBOL_GPL(export_encode_inode_fh);
+#endif
+
/**
* export_encode_fh - default export_operations->encode_fh function
* @dentry: the dentry to encode
Index: linux-2.6.git/include/linux/exportfs.h
===================================================================
--- linux-2.6.git.orig/include/linux/exportfs.h
+++ linux-2.6.git/include/linux/exportfs.h
@@ -177,6 +177,10 @@ struct export_operations {
int (*commit_metadata)(struct inode *inode);
};
+#ifdef CONFIG_CHECKPOINT_RESTORE
+extern int export_encode_inode_fh(struct inode *inode, struct fid *fid, int *max_len);
+#endif
+
extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid,
int *max_len, int connectable);
extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
next prev parent reply other threads:[~2012-05-23 10:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 10:25 [rfc v2 0/7] procfs fdinfo extension v2 Cyrill Gorcunov
2012-05-23 10:25 ` [rfc v2 1/7] procfs: Move /proc/pid/fd[info] handling code to fd.[ch] Cyrill Gorcunov
2012-05-23 10:25 ` [rfc v2 2/7] procfs: Convert /proc/pid/fdinfo/ handling routines to seq-file Cyrill Gorcunov
2012-05-23 10:25 ` [rfc v2 3/7] procfs: Add ability to plugin auxiliary fdinfo providers Cyrill Gorcunov
2012-05-23 10:25 ` [rfc v2 4/7] fs, eventfd: Add procfs fdinfo helper Cyrill Gorcunov
2012-05-23 10:25 ` [rfc v2 5/7] fs, epoll: " Cyrill Gorcunov
2012-05-23 10:25 ` Cyrill Gorcunov [this message]
2012-05-23 10:25 ` [rfc v2 7/7] fs, notify: " Cyrill Gorcunov
2012-05-24 18:01 ` [rfc v2 0/7] procfs fdinfo extension v2 Matt Helsley
2012-05-24 18:23 ` Cyrill Gorcunov
2012-05-24 18:41 ` Cyrill Gorcunov
2012-05-24 19:48 ` Pavel Emelyanov
2012-05-24 20:27 ` Cyrill Gorcunov
2012-05-24 20:32 ` Matt Helsley
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=20120523104031.152885239@openvz.org \
--to=gorcunov@openvz.org \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=jbottomley@parallels.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=skinsbursky@openvz.org \
--cc=tj@kernel.org \
--cc=xemul@parallels.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.