Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223178
b: refs/heads/master
c: 85cb7f1
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Dec 15, 2010
1 parent 73a38b7 commit 152d184
Show file tree
Hide file tree
Showing 100 changed files with 1,100 additions and 660 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c03b87048f2467087ae7e51392e5fb57ea8f58b
refs/heads/master: 85cb7f1264c4d9e60ccdce52740238222e77ccd0
7 changes: 6 additions & 1 deletion trunk/Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ prototypes:
sector_t (*bmap)(struct address_space *, sector_t);
int (*invalidatepage) (struct page *, unsigned long);
int (*releasepage) (struct page *, int);
void (*freepage)(struct page *);
int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
loff_t offset, unsigned long nr_segs);
int (*launder_page) (struct page *);

locking rules:
All except set_page_dirty may block
All except set_page_dirty and freepage may block

BKL PageLocked(page) i_mutex
writepage: no yes, unlocks (see below)
Expand All @@ -193,6 +194,7 @@ perform_write: no n/a yes
bmap: no
invalidatepage: no yes
releasepage: no yes
freepage: no yes
direct_IO: no
launder_page: no yes

Expand Down Expand Up @@ -288,6 +290,9 @@ buffers from the page in preparation for freeing it. It returns zero to
indicate that the buffers are (or may be) freeable. If ->releasepage is zero,
the kernel assumes that the fs has no private interest in the buffers.

->freepage() is called when the kernel is done dropping the page
from the page cache.

->launder_page() may be called prior to releasing a page if
it is still found to be dirty. It returns zero if the page was successfully
cleaned, or an error value if not. Note that in order to prevent the page
Expand Down
7 changes: 7 additions & 0 deletions trunk/Documentation/filesystems/vfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ struct address_space_operations {
sector_t (*bmap)(struct address_space *, sector_t);
int (*invalidatepage) (struct page *, unsigned long);
int (*releasepage) (struct page *, int);
void (*freepage)(struct page *);
ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
loff_t offset, unsigned long nr_segs);
struct page* (*get_xip_page)(struct address_space *, sector_t,
Expand Down Expand Up @@ -678,6 +679,12 @@ struct address_space_operations {
need to ensure this. Possibly it can clear the PageUptodate
bit if it cannot free private data yet.

freepage: freepage is called once the page is no longer visible in
the page cache in order to allow the cleanup of any private
data. Since it may be called by the memory reclaimer, it
should not assume that the original address_space mapping still
exists, and it should not block.

direct_IO: called by the generic read/write routines to perform
direct_IO - that is IO requests which bypass the page cache
and transfer data directly between the storage and the
Expand Down
46 changes: 29 additions & 17 deletions trunk/drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,7 @@ static const struct file_operations acpi_ac_fops = {
.release = single_release,
};
#endif
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct acpi_ac *ac = to_acpi_ac(psy);
switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
val->intval = ac->state;
break;
default:
return -EINVAL;
}
return 0;
}

static enum power_supply_property ac_props[] = {
POWER_SUPPLY_PROP_ONLINE,
};
/* --------------------------------------------------------------------------
AC Adapter Management
-------------------------------------------------------------------------- */
Expand All @@ -140,6 +123,35 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
return 0;
}

/* --------------------------------------------------------------------------
sysfs I/F
-------------------------------------------------------------------------- */
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct acpi_ac *ac = to_acpi_ac(psy);

if (!ac)
return -ENODEV;

if (acpi_ac_get_state(ac))
return -ENODEV;

switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
val->intval = ac->state;
break;
default:
return -EINVAL;
}
return 0;
}

static enum power_supply_property ac_props[] = {
POWER_SUPPLY_PROP_ONLINE,
};

#ifdef CONFIG_ACPI_PROCFS_POWER
/* --------------------------------------------------------------------------
FS Interface (/proc)
Expand Down
34 changes: 17 additions & 17 deletions trunk/drivers/acpi/apei/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static struct erst_erange {
* It is used to provide exclusive accessing for ERST Error Log
* Address Range too.
*/
static DEFINE_SPINLOCK(erst_lock);
static DEFINE_RAW_SPINLOCK(erst_lock);

static inline int erst_errno(int command_status)
{
Expand Down Expand Up @@ -421,9 +421,9 @@ ssize_t erst_get_record_count(void)
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
count = __erst_get_record_count();
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return count;
}
Expand Down Expand Up @@ -456,9 +456,9 @@ int erst_get_next_record_id(u64 *record_id)
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
rc = __erst_get_next_record_id(record_id);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return rc;
}
Expand Down Expand Up @@ -624,25 +624,25 @@ int erst_write(const struct cper_record_header *record)
return -EINVAL;

if (erst_erange.attr & ERST_RANGE_NVRAM) {
if (!spin_trylock_irqsave(&erst_lock, flags))
if (!raw_spin_trylock_irqsave(&erst_lock, flags))
return -EBUSY;
rc = __erst_write_to_nvram(record);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}

if (record->record_length > erst_erange.size)
return -EINVAL;

if (!spin_trylock_irqsave(&erst_lock, flags))
if (!raw_spin_trylock_irqsave(&erst_lock, flags))
return -EBUSY;
memcpy(erst_erange.vaddr, record, record->record_length);
rcd_erange = erst_erange.vaddr;
/* signature for serialization system */
memcpy(&rcd_erange->persistence_information, "ER", 2);

rc = __erst_write_to_storage(0);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return rc;
}
Expand Down Expand Up @@ -696,9 +696,9 @@ ssize_t erst_read(u64 record_id, struct cper_record_header *record,
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
len = __erst_read(record_id, record, buflen);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);
return len;
}
EXPORT_SYMBOL_GPL(erst_read);
Expand All @@ -719,20 +719,20 @@ ssize_t erst_read_next(struct cper_record_header *record, size_t buflen)
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
rc = __erst_get_next_record_id(&record_id);
if (rc) {
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}
/* no more record */
if (record_id == APEI_ERST_INVALID_RECORD_ID) {
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);
return 0;
}

len = __erst_read(record_id, record, buflen);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return len;
}
Expand All @@ -746,12 +746,12 @@ int erst_clear(u64 record_id)
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
if (erst_erange.attr & ERST_RANGE_NVRAM)
rc = __erst_clear_from_nvram(record_id);
else
rc = __erst_clear_from_storage(record_id);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return rc;
}
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/acpi/apei/hest.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ EXPORT_SYMBOL_GPL(hest_disable);

/* HEST table parsing */

static struct acpi_table_hest *hest_tab;
static struct acpi_table_hest *__read_mostly hest_tab;

static int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
[ACPI_HEST_TYPE_IA32_CHECK] = -1, /* need further calculation */
[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
Expand Down Expand Up @@ -126,7 +126,7 @@ struct ghes_arr {
unsigned int count;
};

static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
static int __init hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
{
int *count = data;

Expand All @@ -135,7 +135,7 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
return 0;
}

static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
{
struct platform_device *ghes_dev;
struct ghes_arr *ghes_arr = data;
Expand Down Expand Up @@ -165,7 +165,7 @@ static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
return rc;
}

static int hest_ghes_dev_register(unsigned int ghes_count)
static int __init hest_ghes_dev_register(unsigned int ghes_count)
{
int rc, i;
struct ghes_arr ghes_arr;
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ struct acpi_battery {
unsigned long flags;
};

static int acpi_battery_update(struct acpi_battery *battery);

#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);

inline int acpi_battery_present(struct acpi_battery *battery)
Expand Down Expand Up @@ -184,6 +186,9 @@ static int acpi_battery_get_property(struct power_supply *psy,
int ret = 0;
struct acpi_battery *battery = to_acpi_battery(psy);

if (acpi_battery_update(battery))
return -ENODEV;

if (acpi_battery_present(battery)) {
/* run battery update only if it is present */
acpi_battery_get_state(battery);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
ec_flag_msi, "MSI hardware", {
DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL},
{
ec_flag_msi, "MSI hardware", {
DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL},
{
ec_validate_ecdt, "ASUS hardware", {
DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
{},
Expand Down
Loading

0 comments on commit 152d184

Please sign in to comment.