summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2003-08-23 01:38:39 +1000
committerAnton Blanchard <anton@samba.org>2003-08-23 01:38:39 +1000
commitca1ba07185020a32f9839ab7dfc68dbe3426b1e2 (patch)
tree4293ca23ade117fb5f43e8ce4d2adcc20adc7cca /include/linux
parentbe76fe349c9c5b09dafb363d13d95163d5278c41 (diff)
parentbf4a3963a5a87aa42cdc9dd99e1c73bc80390d3a (diff)
Merge samba.org:/scratch/anton/linux-2.5
into samba.org:/scratch/anton/tmp3
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci.h37
-rw-r--r--include/linux/sched.h4
2 files changed, 39 insertions, 2 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a4c7a4c7965e..3c4fc6c62773 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -420,7 +420,9 @@ struct pci_dev {
unsigned int transparent:1; /* Transparent PCI bridge */
unsigned int multifunction:1;/* Part of multi-function device */
#ifdef CONFIG_PCI_NAMES
- char pretty_name[DEVICE_NAME_SIZE]; /* pretty name for users to see */
+#define PCI_NAME_SIZE 50
+#define PCI_NAME_HALF __stringify(20) /* less than half to handle slop */
+ char pretty_name[PCI_NAME_SIZE]; /* pretty name for users to see */
#endif
};
@@ -524,6 +526,32 @@ struct pci_driver {
#define to_pci_driver(drv) container_of(drv,struct pci_driver, driver)
+/**
+ * PCI_DEVICE - macro used to describe a specific pci device
+ * @vend: the 16 bit PCI Vendor ID
+ * @dev: the 16 bit PCI Device ID
+ *
+ * This macro is used to create a struct pci_device_id that matches a
+ * specific device. The subvendor and subdevice fields will be set to
+ * PCI_ANY_ID.
+ */
+#define PCI_DEVICE(vend,dev) \
+ .vendor = (vend), .device = (dev), \
+ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
+
+/**
+ * PCI_DEVICE_CLASS - macro used to describe a specific pci device class
+ * @dev_class: the class, subclass, prog-if triple for this device
+ * @dev_class_mask: the class mask for this device
+ *
+ * This macro is used to create a struct pci_device_id that matches a
+ * specific PCI class. The vendor, device, subvendor, and subdevice
+ * fields will be set to PCI_ANY_ID.
+ */
+#define PCI_DEVICE_CLASS(dev_class,dev_class_mask) \
+ .class = (dev_class), .class_mask = (dev_class_mask), \
+ .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
+ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
/* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI
@@ -814,6 +842,13 @@ static inline char *pci_name(struct pci_dev *pdev)
return pdev->dev.bus_id;
}
+/* Some archs want to see the pretty pci name, so use this macro */
+#ifdef CONFIG_PCI_NAMES
+#define pci_pretty_name(dev) ((dev)->pretty_name)
+#else
+#define pci_pretty_name(dev) ""
+#endif
+
/*
* The world is not perfect and supplies us with broken PCI devices.
* For at least a part of these bugs we need a work-around, so both
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 61ec12b5b77a..054168543a45 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -638,6 +638,8 @@ static inline void mmdrop(struct mm_struct * mm)
/* mmput gets rid of the mappings and all user-space */
extern void mmput(struct mm_struct *);
+/* Grab a reference to the mm if its not already going away */
+extern struct mm_struct *mmgrab(struct mm_struct *);
/* Remove the current tasks stale references to the old mm_struct */
extern void mm_release(struct task_struct *, struct mm_struct *);
@@ -745,7 +747,7 @@ static inline struct mm_struct * get_task_mm(struct task_struct * task)
task_lock(task);
mm = task->mm;
if (mm)
- atomic_inc(&mm->mm_users);
+ mm = mmgrab(mm);
task_unlock(task);
return mm;