aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/obdclass/local_storage.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 11:40:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 11:40:23 -0700
commitce49b6289fa3878b190f15192e54bb23dca552b6 (patch)
tree666f246067e02968d9526fb3e1a5f6ba70c7a4ca /drivers/staging/lustre/lustre/obdclass/local_storage.h
parentMerge tag 'tty-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty (diff)
parentRevert "Revert "Revert "staging/lustre: drop CONFIG_BROKEN dependency""" (diff)
downloadlinux-dev-ce49b6289fa3878b190f15192e54bb23dca552b6.tar.xz
linux-dev-ce49b6289fa3878b190f15192e54bb23dca552b6.zip
Merge tag 'staging-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging tree update from Greg KH: "Here's the large staging tree merge for 3.11-rc1 Huge thing here is the Lustre client code. Unfortunatly, due to it not building properly on a wide variety of different architectures (this was production code???), it is currently disabled from the build so as to not annoy people. Other than Lustre, there are loads of comedi patches, working to clean up that subsystem, iio updates and new drivers, and a load of cleanups from the OPW applicants in their quest to get a summer internship. All of these have been in the linux-next releases for a while (hence the Lustre code being disabled)" Fixed up trivial conflict in drivers/staging/serqt_usb2/serqt_usb2.c due to independent renamings in the staging driver cleanup and the USB tree.. * tag 'staging-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (868 commits) Revert "Revert "Revert "staging/lustre: drop CONFIG_BROKEN dependency""" staging: rtl8192u: fix line length in r819xU_phy.h staging: rtl8192u: rename variables in r819xU_phy.h staging: rtl8192u: fix comments in r819xU_phy.h staging: rtl8192u: fix whitespace in r819xU_phy.h staging: rtl8192u: fix newlines in r819xU_phy.c staging: comedi: unioxx5: use comedi_alloc_spriv() staging: comedi: unioxx5: fix unioxx5_detach() silicom: checkpatch: errors caused by macros Staging: silicom: remove the board_t typedef in bpctl_mod.c Staging: silicom: capitalize labels in the bp_media_type enum Staging: silicom: remove bp_media_type enum typedef staging: rtl8192u: replace msleep(1) with usleep_range() in r819xU_phy.c staging: rtl8192u: rename dwRegRead and rtStatus in r819xU_phy.c staging: rtl8192u: replace __FUNCTION__ in r819xU_phy.c staging: rtl8192u: limit line size in r819xU_phy.c zram: allow request end to coincide with disksize staging: drm/imx: use generic irq chip unused field to block out invalid irqs staging: drm/imx: use generic irqchip staging: drm/imx: ipu-dmfc: use defines for ipu channel numbers ...
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass/local_storage.h')
-rw-r--r--drivers/staging/lustre/lustre/obdclass/local_storage.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/local_storage.h b/drivers/staging/lustre/lustre/obdclass/local_storage.h
new file mode 100644
index 000000000000..d553c3752703
--- /dev/null
+++ b/drivers/staging/lustre/lustre/obdclass/local_storage.h
@@ -0,0 +1,88 @@
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+
+ * This program 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 version 2 for more details. A copy is
+ * included in the COPYING file that accompanied this code.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2012, Intel Corporation.
+ */
+/*
+ * lustre/obdclass/local_storage.c
+ *
+ * Local storage for file/objects with fid generation. Works on top of OSD.
+ *
+ * Author: Mikhail Pershin <mike.pershin@intel.com>
+ */
+
+#include <dt_object.h>
+#include <obd.h>
+#include <lustre_fid.h>
+#include <lustre_disk.h>
+
+struct ls_device {
+ struct dt_device ls_top_dev;
+ /* all initialized ls_devices on this node linked by this */
+ struct list_head ls_linkage;
+ /* how many handle's reference this local storage */
+ atomic_t ls_refcount;
+ /* underlaying OSD device */
+ struct dt_device *ls_osd;
+ /* list of all local OID storages */
+ struct list_head ls_los_list;
+ struct mutex ls_los_mutex;
+};
+
+static inline struct ls_device *dt2ls_dev(struct dt_device *d)
+{
+ return container_of0(d, struct ls_device, ls_top_dev);
+}
+
+struct ls_object {
+ struct lu_object_header ls_header;
+ struct dt_object ls_obj;
+};
+
+static inline struct ls_object *lu2ls_obj(struct lu_object *o)
+{
+ return container_of0(o, struct ls_object, ls_obj.do_lu);
+}
+
+static inline struct dt_object *ls_locate(const struct lu_env *env,
+ struct ls_device *ls,
+ const struct lu_fid *fid)
+{
+ return dt_locate_at(env, ls->ls_osd, fid, &ls->ls_top_dev.dd_lu_dev);
+}
+
+struct ls_device *ls_device_get(struct dt_device *dev);
+void ls_device_put(const struct lu_env *env, struct ls_device *ls);
+struct local_oid_storage *dt_los_find(struct ls_device *ls, __u64 seq);
+void dt_los_put(struct local_oid_storage *los);
+
+/* Lustre 2.3 on-disk structure describing local object OIDs storage
+ * the structure to be used with any sequence managed by
+ * local object library.
+ * Obsoleted since 2.4 but is kept for compatibility reasons,
+ * see lastid_compat_check() in obdclass/local_storage.c */
+struct los_ondisk {
+ __u32 lso_magic;
+ __u32 lso_next_oid;
+};
+
+#define LOS_MAGIC 0xdecafbee