Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72c26c9a authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'linus' into tracing/blktrace



Conflicts:
	block/blktrace.c

Semantic merge:
	kernel/trace/blktrace.c

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parents 37bd824a ba95fd47
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2166,7 +2166,6 @@ D: Initial implementation of VC's, pty's and select()

N: Pavel Machek
E: pavel@ucw.cz
E: pavel@suse.cz
D: Softcursor for vga, hypertech cdrom support, vcsa bugfix, nbd
D: sun4/330 port, capabilities for elf, speedup for rm on ext2, USB,
D: work on suspend-to-ram/disk, killing duplicates from ioctl32
+1 −1
Original line number Diff line number Diff line
What:		/sys/firmware/memmap/
Date:		June 2008
Contact:	Bernhard Walle <bwalle@suse.de>
Contact:	Bernhard Walle <bernhard.walle@gmx.de>
Description:
		On all platforms, the firmware provides a memory map which the
		kernel reads. The resources from that memory map are registered
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ the PCI Express Port Bus driver from loading a service driver.

int pcie_port_service_register(struct pcie_port_service_driver *new)

This API replaces the Linux Driver Model's pci_module_init API. A
This API replaces the Linux Driver Model's pci_register_driver API. A
service driver should always calls pcie_port_service_register at
module init. Note that after service driver being loaded, calls
such as pci_enable_device(dev) and pci_set_master(dev) are no longer
+2 −4
Original line number Diff line number Diff line
@@ -252,10 +252,8 @@ cgroup file system directories.
When a task is moved from one cgroup to another, it gets a new
css_set pointer - if there's an already existing css_set with the
desired collection of cgroups then that group is reused, else a new
css_set is allocated. Note that the current implementation uses a
linear search to locate an appropriate existing css_set, so isn't
very efficient. A future version will use a hash table for better
performance.
css_set is allocated. The appropriate existing css_set is located by
looking into a hash table.

To allow access from a cgroup to the css_sets (and hence tasks)
that comprise it, a set of cg_cgroup_link objects form a lattice;
+101 −0
Original line number Diff line number Diff line
/* Disk protection for HP machines.
 *
 * Copyright 2008 Eric Piel
 * Copyright 2009 Pavel Machek <pavel@suse.cz>
 *
 * GPLv2.
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <signal.h>

void write_int(char *path, int i)
{
	char buf[1024];
	int fd = open(path, O_RDWR);
	if (fd < 0) {
		perror("open");
		exit(1);
	}
	sprintf(buf, "%d", i);
	if (write(fd, buf, strlen(buf)) != strlen(buf)) {
		perror("write");
		exit(1);
	}
	close(fd);
}

void set_led(int on)
{
	write_int("/sys/class/leds/hp::hddprotect/brightness", on);
}

void protect(int seconds)
{
	write_int("/sys/block/sda/device/unload_heads", seconds*1000);
}

int on_ac(void)
{
//	/sys/class/power_supply/AC0/online
}

int lid_open(void)
{
//	/proc/acpi/button/lid/LID/state
}

void ignore_me(void)
{
	protect(0);
	set_led(0);

}

int main(int argc, char* argv[])
{
       int fd, ret;

       fd = open("/dev/freefall", O_RDONLY);
       if (fd < 0) {
               perror("open");
               return EXIT_FAILURE;
       }

	signal(SIGALRM, ignore_me);

       for (;;) {
	       unsigned char count;

               ret = read(fd, &count, sizeof(count));
	       alarm(0);
	       if ((ret == -1) && (errno == EINTR)) {
		       /* Alarm expired, time to unpark the heads */
		       continue;
	       }

               if (ret != sizeof(count)) {
                       perror("read");
                       break;
               }

	       protect(21);
	       set_led(1);
	       if (1 || on_ac() || lid_open()) {
		       alarm(2);
	       } else {
		       alarm(20);
	       }
       }

       close(fd);
       return EXIT_SUCCESS;
}
Loading