1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2002 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <linux/spinlock.h>
29 #include <linux/lustre_handles.h>
31 #ifndef OBD_FILTER_DEVICENAME
32 #define OBD_FILTER_DEVICENAME "obdfilter"
35 #define FILTER_LR_SERVER_SIZE 512
37 #define FILTER_LR_CLIENT_START 8192
38 #define FILTER_LR_CLIENT_SIZE 128
40 #define FILTER_SUBDIR_COUNT 32 /* set to zero for no subdirs */
42 #define FILTER_MOUNT_RECOV 2
43 #define FILTER_RECOVERY_TIMEOUT (obd_timeout * 5 * HZ / 2) /* *waves hands* */
45 /* Data stored per server at the head of the last_rcvd file. In le32 order. */
46 struct filter_server_data {
47 __u8 fsd_uuid[37]; /* server UUID */
48 __u8 fsd_uuid_padding[3]; /* unused */
49 __u64 fsd_last_objid; /* last created object ID */
50 __u64 fsd_last_rcvd; /* last completed transaction ID */
51 __u64 fsd_mount_count; /* FILTER incarnation number */
52 __u32 fsd_feature_compat; /* compatible feature flags */
53 __u32 fsd_feature_rocompat;/* read-only compatible feature flags */
54 __u32 fsd_feature_incompat;/* incompatible feature flags */
55 __u32 fsd_server_size; /* size of server data area */
56 __u32 fsd_client_start; /* start of per-client data area */
57 __u16 fsd_client_size; /* size of per-client data area */
58 __u16 fsd_subdir_count; /* number of subdirectories for objects */
59 __u8 fsd_padding[FILTER_LR_SERVER_SIZE - 88];
62 /* Data stored per client in the last_rcvd file. In le32 order. */
63 struct filter_client_data {
64 __u8 fcd_uuid[37]; /* client UUID */
65 __u8 fcd_uuid_padding[3]; /* unused */
66 __u64 fcd_last_rcvd; /* last completed transaction ID */
67 __u64 fcd_mount_count; /* FILTER incarnation number */
68 __u64 fcd_last_xid; /* client RPC xid for the last transaction */
69 __u8 fcd_padding[FILTER_LR_CLIENT_SIZE - 64];
72 #ifndef OBD_FILTER_SAN_DEVICENAME
73 #define OBD_FILTER_SAN_DEVICENAME "sanobdfilter"
76 /* In-memory access to client data from OST struct */
77 struct filter_export_data {
78 struct list_head fed_open_head; /* files to close on disconnect */
79 spinlock_t fed_lock; /* protects fed_open_head */
80 struct filter_client_data *fed_fcd;
85 /* file data for open files on OST */
86 struct filter_file_data {
87 struct portals_handle ffd_handle;
88 atomic_t ffd_refcount;
89 struct list_head ffd_export_list; /* export open list - fed_lock */
90 struct file *ffd_file; /* file handle */
93 struct filter_dentry_data {
95 atomic_t fdd_open_count;
99 #define FILTER_FLAG_DESTROY 0x0001 /* destroy dentry on last file close */