]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
exofs: symlink_inode and fast_symlink_inode operations
authorBoaz Harrosh <bharrosh@panasas.com>
Mon, 27 Oct 2008 17:04:34 +0000 (19:04 +0200)
committerBoaz Harrosh <bharrosh@panasas.com>
Tue, 31 Mar 2009 16:44:27 +0000 (19:44 +0300)
Generic implementation of symlink ops.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
fs/exofs/Kbuild
fs/exofs/exofs.h
fs/exofs/symlink.c [new file with mode: 0644]

index c9546edaddebfb410ea3d574d9ea0aec968e7f8d..7c361c92bbdf10a6b416744e438691135a00f31a 100644 (file)
@@ -12,5 +12,5 @@
 # Kbuild - Gets included from the Kernels Makefile and build system
 #
 
-exofs-y := osd.o inode.o file.o
+exofs-y := osd.o inode.o file.o symlink.o
 obj-$(CONFIG_EXOFS_FS) += exofs.o
index a735258c7364ad9d96a0a1e69a11244edb1027d1..825454d76f6cf41c176a38a13acb1c9a56a27c7c 100644 (file)
@@ -138,4 +138,8 @@ int exofs_setattr(struct dentry *, struct iattr *);
 extern const struct inode_operations exofs_file_inode_operations;
 extern const struct file_operations exofs_file_operations;
 
+/* symlink.c         */
+extern const struct inode_operations exofs_symlink_inode_operations;
+extern const struct inode_operations exofs_fast_symlink_inode_operations;
+
 #endif
diff --git a/fs/exofs/symlink.c b/fs/exofs/symlink.c
new file mode 100644 (file)
index 0000000..36e2d7b
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2005, 2006
+ * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com)
+ * Copyright (C) 2005, 2006
+ * International Business Machines
+ * Copyright (C) 2008, 2009
+ * Boaz Harrosh <bharrosh@panasas.com>
+ *
+ * Copyrights for code taken from ext2:
+ *     Copyright (C) 1992, 1993, 1994, 1995
+ *     Remy Card (card@masi.ibp.fr)
+ *     Laboratoire MASI - Institut Blaise Pascal
+ *     Universite Pierre et Marie Curie (Paris VI)
+ *     from
+ *     linux/fs/minix/inode.c
+ *     Copyright (C) 1991, 1992  Linus Torvalds
+ *
+ * This file is part of exofs.
+ *
+ * exofs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation.  Since it is based on ext2, and the only
+ * valid version of GPL for the Linux kernel is version 2, the only valid
+ * version of GPL for exofs is version 2.
+ *
+ * exofs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with exofs; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/namei.h>
+
+#include "exofs.h"
+
+static void *exofs_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+       struct exofs_i_info *oi = exofs_i(dentry->d_inode);
+
+       nd_set_link(nd, (char *)oi->i_data);
+       return NULL;
+}
+
+const struct inode_operations exofs_symlink_inode_operations = {
+       .readlink       = generic_readlink,
+       .follow_link    = page_follow_link_light,
+       .put_link       = page_put_link,
+};
+
+const struct inode_operations exofs_fast_symlink_inode_operations = {
+       .readlink       = generic_readlink,
+       .follow_link    = exofs_follow_link,
+};