1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * lustre/fid/lproc_fid.c
5 * Lustre Sequence Manager
7 * Copyright (c) 2006 Cluster File Systems, Inc.
8 * Author: Yury Umanets <umka@clusterfs.com>
10 * This file is part of the Lustre file system, http://www.lustre.org
11 * Lustre is a trademark of Cluster File Systems, Inc.
13 * You may have signed or agreed to another license before downloading
14 * this software. If so, you are bound by the terms and conditions
15 * of that agreement, and the following does not apply to you. See the
16 * LICENSE file included with this distribution for more information.
18 * If you did not agree to a different license, then this copy of Lustre
19 * is open source software; you can redistribute it and/or modify it
20 * under the terms of version 2 of the GNU General Public License as
21 * published by the Free Software Foundation.
23 * In either case, Lustre is distributed in the hope that it will be
24 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
25 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * license text for more details.
30 # define EXPORT_SYMTAB
32 #define DEBUG_SUBSYSTEM S_FID
35 # include <libcfs/libcfs.h>
36 # include <linux/module.h>
37 #else /* __KERNEL__ */
38 # include <liblustre.h>
42 #include <obd_class.h>
43 #include <dt_object.h>
44 #include <md_object.h>
45 #include <obd_support.h>
46 #include <lustre_req_layout.h>
47 #include <lustre_fid.h>
48 #include "fid_internal.h"
52 seq_proc_write_range(struct file *file, const char *buffer,
53 unsigned long count, void *data,
54 struct lu_range *range)
60 LASSERT(range != NULL);
62 rc = sscanf(buffer, "["LPU64"-"LPU64"]\n",
63 &tmp.lr_start, &tmp.lr_end);
70 seq_proc_read_range(char *page, char **start, off_t off,
71 int count, int *eof, void *data,
72 struct lu_range *range)
78 rc = snprintf(page, count, "["LPU64"-"LPU64"]\n",
79 range->lr_start, range->lr_end);
84 seq_proc_write_space(struct file *file, const char *buffer,
85 unsigned long count, void *data)
87 struct lu_server_seq *seq = (struct lu_server_seq *)data;
93 seq_proc_write_range(file, buffer, count,
94 data, &seq->seq_space);
96 CDEBUG(D_WARNING, "sequences space range is changed "
97 "to ["LPU64"-"LPU64"]\n", seq->seq_space.lr_start,
98 seq->seq_space.lr_end);
106 seq_proc_read_space(char *page, char **start, off_t off,
107 int count, int *eof, void *data)
109 struct lu_server_seq *seq = (struct lu_server_seq *)data;
113 LASSERT(seq != NULL);
116 rc = seq_proc_read_range(page, start, off, count, eof,
117 data, &seq->seq_space);
124 seq_proc_write_super(struct file *file, const char *buffer,
125 unsigned long count, void *data)
127 struct lu_server_seq *seq = (struct lu_server_seq *)data;
130 LASSERT(seq != NULL);
133 seq_proc_write_range(file, buffer, count,
134 data, &seq->seq_super);
136 CDEBUG(D_WARNING, "super-sequence range is changed to "
137 "["LPU64"-"LPU64"]\n", seq->seq_super.lr_start,
138 seq->seq_super.lr_end);
146 seq_proc_read_super(char *page, char **start, off_t off,
147 int count, int *eof, void *data)
149 struct lu_server_seq *seq = (struct lu_server_seq *)data;
153 LASSERT(seq != NULL);
156 rc = seq_proc_read_range(page, start, off, count, eof,
157 data, &seq->seq_super);
163 struct lprocfs_vars seq_proc_list[] = {
164 { "space", seq_proc_read_space, seq_proc_write_space, NULL },
165 { "super", seq_proc_read_super, seq_proc_write_super, NULL },