struct page * lustre_get_page(struct inode *dir, unsigned long n);
int lustre_prepare_page(unsigned from, unsigned to, struct page *page);
int lustre_commit_page(struct page *page, unsigned from, unsigned to);
+void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new);
+void pop_ctxt(struct obd_run_ctxt *saved);
+int simple_mkdir(struct dentry *dir, char *name, int mode);
#endif
#include <linux/portals_lib.h>
modulefs_DATA = obdfilter.o
EXTRA_PROGRAMS = obdfilter
+LINX=simple.c
+simple.c:
+ ln -s ../lib/simple.c .
+
EXT2C = filter.c
-obdfilter_SOURCES = filter.c
+obdfilter_SOURCES = filter.c $(LINX)
+
+dist-hook:
+ list='$(LINX)'; for f in $$list; do rm -f $(distdir)/$$f; done
include $(top_srcdir)/Rules
-/*
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
* linux/fs/ext2_obd/ext2_obd.c
*
* Copyright (C) 2001 Cluster File Systems, Inc.
};
-
-/* push / pop to root of obd store */
-void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new)
-{
- save->fs = get_fs();
- save->pwd = dget(current->fs->pwd);
- save->pwdmnt = mntget(current->fs->pwdmnt);
-
- set_fs(new->fs);
- set_fs_pwd(current->fs, new->pwdmnt, new->pwd);
-}
-
-void pop_ctxt(struct obd_run_ctxt *saved)
-{
- set_fs(saved->fs);
- set_fs_pwd(current->fs, saved->pwdmnt, saved->pwd);
-
- dput(saved->pwd);
- mntput(saved->pwdmnt);
-}
-
-/* utility to make a directory */
-static int simple_mkdir(struct dentry *dir, char *name, int mode)
-{
- struct dentry *dchild;
- int err;
- ENTRY;
-
- dchild = lookup_one_len(name, dir, strlen(name));
- if (IS_ERR(dchild)) {
- EXIT;
- return PTR_ERR(dchild);
- }
-
- if (dchild->d_inode) {
- dput(dchild);
- EXIT;
- return -EEXIST;
- }
-
- err = vfs_mkdir(dir->d_inode, dchild, mode);
- dput(dchild);
-
- EXIT;
- return err;
-}
-
/* write the pathname into the string */
static void filter_id(char *buf, obd_id id, obd_mode mode)
{