1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
37 #ifndef __LVFS_LINUX_H__
38 #define __LVFS_LINUX_H__
40 #include <linux/kernel.h>
41 #include <linux/module.h>
43 #include <linux/namei.h>
44 #include <linux/sched.h>
49 #define l_dentry dentry
52 #define l_filp_open filp_open
55 struct l_file *l_dentry_open(struct lvfs_run_ctxt *, struct l_dentry *,
58 struct l_linux_dirent {
59 struct list_head lld_list;
61 unsigned long lld_off;
62 char lld_name[LL_FID_NAMELEN];
64 struct l_readdir_callback {
65 struct l_linux_dirent *lrc_dirent;
66 struct list_head *lrc_list;
69 #define LVFS_DENTRY_PARAM_MAGIC 20070216UL
70 struct lvfs_dentry_params
72 unsigned long ldp_inum;
76 #define LVFS_DENTRY_PARAMS_INIT { .ldp_magic = LVFS_DENTRY_PARAM_MAGIC }
77 /* Only use the least 3 bits of ldp_flags for goal policy */
80 DP_LASTGROUP_REVERSE = 1,
83 #define lvfs_sbdev(SB) ((SB)->s_bdev)
84 #define lvfs_sbdev_type struct block_device *
85 int fsync_bdev(struct block_device *);
86 #define lvfs_sbdev_sync fsync_bdev
88 /* Instead of calling within lvfs (a layering violation) */
89 #define lvfs_set_rdonly(obd, sb) \
90 __lvfs_set_rdonly(lvfs_sbdev(sb), fsfilt_journal_sbdev(obd, sb))
92 void __lvfs_set_rdonly(lvfs_sbdev_type dev, lvfs_sbdev_type jdev);
93 int lvfs_check_rdonly(lvfs_sbdev_type dev);
95 #endif /* __LVFS_LINUX_H__ */