diff options
-rw-r--r-- | Documentation/filesystems/inotify.txt | 77 | ||||
-rw-r--r-- | MAINTAINERS | 6 | ||||
-rw-r--r-- | arch/i386/mach-visws/reboot.c | 1 | ||||
-rw-r--r-- | arch/ia64/kernel/topology.c | 2 | ||||
-rw-r--r-- | drivers/char/rocket.c | 3 | ||||
-rw-r--r-- | drivers/char/vt.c | 2 | ||||
-rw-r--r-- | drivers/md/bitmap.c | 9 | ||||
-rw-r--r-- | drivers/md/raid0.c | 8 | ||||
-rw-r--r-- | drivers/md/raid1.c | 37 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 8 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 7 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 6 | ||||
-rw-r--r-- | drivers/media/video/tea5767.c | 34 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 33 | ||||
-rw-r--r-- | fs/ext2/xip.c | 81 | ||||
-rw-r--r-- | include/linux/raid/bitmap.h | 2 | ||||
-rw-r--r-- | mm/filemap_xip.c | 23 |
18 files changed, 196 insertions, 147 deletions
diff --git a/Documentation/filesystems/inotify.txt b/Documentation/filesystems/inotify.txt index 2c716041f5..6d501903f6 100644 --- a/Documentation/filesystems/inotify.txt +++ b/Documentation/filesystems/inotify.txt | |||
@@ -1,18 +1,22 @@ | |||
1 | inotify | 1 | inotify |
2 | a powerful yet simple file change notification system | 2 | a powerful yet simple file change notification system |
3 | 3 | ||
4 | 4 | ||
5 | 5 | ||
6 | Document started 15 Mar 2005 by Robert Love <rml@novell.com> | 6 | Document started 15 Mar 2005 by Robert Love <rml@novell.com> |
7 | 7 | ||
8 | |||
8 | (i) User Interface | 9 | (i) User Interface |
9 | 10 | ||
10 | Inotify is controlled by a set of three sys calls | 11 | Inotify is controlled by a set of three system calls and normal file I/O on a |
12 | returned file descriptor. | ||
11 | 13 | ||
12 | First step in using inotify is to initialise an inotify instance | 14 | First step in using inotify is to initialise an inotify instance: |
13 | 15 | ||
14 | int fd = inotify_init (); | 16 | int fd = inotify_init (); |
15 | 17 | ||
18 | Each instance is associated with a unique, ordered queue. | ||
19 | |||
16 | Change events are managed by "watches". A watch is an (object,mask) pair where | 20 | Change events are managed by "watches". A watch is an (object,mask) pair where |
17 | the object is a file or directory and the mask is a bit mask of one or more | 21 | the object is a file or directory and the mask is a bit mask of one or more |
18 | inotify events that the application wishes to receive. See <linux/inotify.h> | 22 | inotify events that the application wishes to receive. See <linux/inotify.h> |
@@ -22,43 +26,52 @@ Watches are added via a path to the file. | |||
22 | 26 | ||
23 | Watches on a directory will return events on any files inside of the directory. | 27 | Watches on a directory will return events on any files inside of the directory. |
24 | 28 | ||
25 | Adding a watch is simple, | 29 | Adding a watch is simple: |
26 | 30 | ||
27 | int wd = inotify_add_watch (fd, path, mask); | 31 | int wd = inotify_add_watch (fd, path, mask); |
28 | 32 | ||
29 | You can add a large number of files via something like | 33 | Where "fd" is the return value from inotify_init(), path is the path to the |
30 | 34 | object to watch, and mask is the watch mask (see <linux/inotify.h>). | |
31 | for each file to watch { | ||
32 | int wd = inotify_add_watch (fd, file, mask); | ||
33 | } | ||
34 | 35 | ||
35 | You can update an existing watch in the same manner, by passing in a new mask. | 36 | You can update an existing watch in the same manner, by passing in a new mask. |
36 | 37 | ||
37 | An existing watch is removed via the INOTIFY_IGNORE ioctl, for example | 38 | An existing watch is removed via |
38 | 39 | ||
39 | inotify_rm_watch (fd, wd); | 40 | int ret = inotify_rm_watch (fd, wd); |
40 | 41 | ||
41 | Events are provided in the form of an inotify_event structure that is read(2) | 42 | Events are provided in the form of an inotify_event structure that is read(2) |
42 | from a inotify instance fd. The filename is of dynamic length and follows the | 43 | from a given inotify instance. The filename is of dynamic length and follows |
43 | struct. It is of size len. The filename is padded with null bytes to ensure | 44 | the struct. It is of size len. The filename is padded with null bytes to |
44 | proper alignment. This padding is reflected in len. | 45 | ensure proper alignment. This padding is reflected in len. |
45 | 46 | ||
46 | You can slurp multiple events by passing a large buffer, for example | 47 | You can slurp multiple events by passing a large buffer, for example |
47 | 48 | ||
48 | size_t len = read (fd, buf, BUF_LEN); | 49 | size_t len = read (fd, buf, BUF_LEN); |
49 | 50 | ||
50 | Will return as many events as are available and fit in BUF_LEN. | 51 | Where "buf" is a pointer to an array of "inotify_event" structures at least |
52 | BUF_LEN bytes in size. The above example will return as many events as are | ||
53 | available and fit in BUF_LEN. | ||
51 | 54 | ||
52 | each inotify instance fd is also select()- and poll()-able. | 55 | Each inotify instance fd is also select()- and poll()-able. |
53 | 56 | ||
54 | You can find the size of the current event queue via the FIONREAD ioctl. | 57 | You can find the size of the current event queue via the standard FIONREAD |
58 | ioctl on the fd returned by inotify_init(). | ||
55 | 59 | ||
56 | All watches are destroyed and cleaned up on close. | 60 | All watches are destroyed and cleaned up on close. |
57 | 61 | ||
58 | 62 | ||
59 | (ii) Internal Kernel Implementation | 63 | (ii) |
64 | |||
65 | Prototypes: | ||
66 | |||
67 | int inotify_init (void); | ||
68 | int inotify_add_watch (int fd, const char *path, __u32 mask); | ||
69 | int inotify_rm_watch (int fd, __u32 mask); | ||
70 | |||
60 | 71 | ||
61 | Each open inotify instance is associated with an inotify_device structure. | 72 | (iii) Internal Kernel Implementation |
73 | |||
74 | Each inotify instance is associated with an inotify_device structure. | ||
62 | 75 | ||
63 | Each watch is associated with an inotify_watch structure. Watches are chained | 76 | Each watch is associated with an inotify_watch structure. Watches are chained |
64 | off of each associated device and each associated inode. | 77 | off of each associated device and each associated inode. |
@@ -66,7 +79,7 @@ off of each associated device and each associated inode. | |||
66 | See fs/inotify.c for the locking and lifetime rules. | 79 | See fs/inotify.c for the locking and lifetime rules. |
67 | 80 | ||
68 | 81 | ||
69 | (iii) Rationale | 82 | (iv) Rationale |
70 | 83 | ||
71 | Q: What is the design decision behind not tying the watch to the open fd of | 84 | Q: What is the design decision behind not tying the watch to the open fd of |
72 | the watched object? | 85 | the watched object? |
@@ -75,9 +88,9 @@ A: Watches are associated with an open inotify device, not an open file. | |||
75 | This solves the primary problem with dnotify: keeping the file open pins | 88 | This solves the primary problem with dnotify: keeping the file open pins |
76 | the file and thus, worse, pins the mount. Dnotify is therefore infeasible | 89 | the file and thus, worse, pins the mount. Dnotify is therefore infeasible |
77 | for use on a desktop system with removable media as the media cannot be | 90 | for use on a desktop system with removable media as the media cannot be |
78 | unmounted. | 91 | unmounted. Watching a file should not require that it be open. |
79 | 92 | ||
80 | Q: What is the design decision behind using an-fd-per-device as opposed to | 93 | Q: What is the design decision behind using an-fd-per-instance as opposed to |
81 | an fd-per-watch? | 94 | an fd-per-watch? |
82 | 95 | ||
83 | A: An fd-per-watch quickly consumes more file descriptors than are allowed, | 96 | A: An fd-per-watch quickly consumes more file descriptors than are allowed, |
@@ -86,8 +99,8 @@ A: An fd-per-watch quickly consumes more file descriptors than are allowed, | |||
86 | can use epoll, but requiring both is a silly and extraneous requirement. | 99 | can use epoll, but requiring both is a silly and extraneous requirement. |
87 | A watch consumes less memory than an open file, separating the number | 100 | A watch consumes less memory than an open file, separating the number |
88 | spaces is thus sensible. The current design is what user-space developers | 101 | spaces is thus sensible. The current design is what user-space developers |
89 | want: Users initialize inotify, once, and add n watches, requiring but one fd | 102 | want: Users initialize inotify, once, and add n watches, requiring but one |
90 | and no twiddling with fd limits. Initializing an inotify instance two | 103 | fd and no twiddling with fd limits. Initializing an inotify instance two |
91 | thousand times is silly. If we can implement user-space's preferences | 104 | thousand times is silly. If we can implement user-space's preferences |
92 | cleanly--and we can, the idr layer makes stuff like this trivial--then we | 105 | cleanly--and we can, the idr layer makes stuff like this trivial--then we |
93 | should. | 106 | should. |
@@ -111,9 +124,6 @@ A: An fd-per-watch quickly consumes more file descriptors than are allowed, | |||
111 | example, love it. Trust me, I asked. It is not a surprise: Who'd want | 124 | example, love it. Trust me, I asked. It is not a surprise: Who'd want |
112 | to manage and block on 1000 fd's via select? | 125 | to manage and block on 1000 fd's via select? |
113 | 126 | ||
114 | - You'd have to manage the fd's, as an example: Call close() when you | ||
115 | received a delete event. | ||
116 | |||
117 | - No way to get out of band data. | 127 | - No way to get out of band data. |
118 | 128 | ||
119 | - 1024 is still too low. ;-) | 129 | - 1024 is still too low. ;-) |
@@ -122,6 +132,11 @@ A: An fd-per-watch quickly consumes more file descriptors than are allowed, | |||
122 | scales to 1000s of directories, juggling 1000s of fd's just does not seem | 132 | scales to 1000s of directories, juggling 1000s of fd's just does not seem |
123 | the right interface. It is too heavy. | 133 | the right interface. It is too heavy. |
124 | 134 | ||
135 | Additionally, it _is_ possible to more than one instance and | ||
136 | juggle more than one queue and thus more than one associated fd. There | ||
137 | need not be a one-fd-per-process mapping; it is one-fd-per-queue and a | ||
138 | process can easily want more than one queue. | ||
139 | |||
125 | Q: Why the system call approach? | 140 | Q: Why the system call approach? |
126 | 141 | ||
127 | A: The poor user-space interface is the second biggest problem with dnotify. | 142 | A: The poor user-space interface is the second biggest problem with dnotify. |
@@ -131,8 +146,6 @@ A: The poor user-space interface is the second biggest problem with dnotify. | |||
131 | Obtaining the fd and managing the watches could have been done either via a | 146 | Obtaining the fd and managing the watches could have been done either via a |
132 | device file or a family of new system calls. We decided to implement a | 147 | device file or a family of new system calls. We decided to implement a |
133 | family of system calls because that is the preffered approach for new kernel | 148 | family of system calls because that is the preffered approach for new kernel |
134 | features and it means our user interface requirements. | 149 | interfaces. The only real difference was whether we wanted to use open(2) |
135 | 150 | and ioctl(2) or a couple of new system calls. System calls beat ioctls. | |
136 | Additionally, it _is_ possible to more than one instance and | ||
137 | juggle more than one queue and thus more than one associated fd. | ||
138 | 151 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index f73381af4d..48aa6d3d3c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1169,6 +1169,12 @@ L: linux-input@atrey.karlin.mff.cuni.cz | |||
1169 | L: linux-joystick@atrey.karlin.mff.cuni.cz | 1169 | L: linux-joystick@atrey.karlin.mff.cuni.cz |
1170 | S: Maintained | 1170 | S: Maintained |
1171 | 1171 | ||
1172 | INOTIFY | ||
1173 | P: John McCutchan and Robert Love | ||
1174 | M: ttb@tentacle.dhs.org and rml@novell.com | ||
1175 | L: linux-kernel@vger.kernel.org | ||
1176 | S: Maintained | ||
1177 | |||
1172 | INTEL 810/815 FRAMEBUFFER DRIVER | 1178 | INTEL 810/815 FRAMEBUFFER DRIVER |
1173 | P: Antonino Daplas | 1179 | P: Antonino Daplas |
1174 | M: adaplas@pol.net | 1180 | M: adaplas@pol.net |
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c index 3a81e904a7..95e4676594 100644 --- a/arch/i386/mach-visws/reboot.c +++ b/arch/i386/mach-visws/reboot.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include "piix4.h" | 7 | #include "piix4.h" |
8 | 8 | ||
9 | void (*pm_power_off)(void); | 9 | void (*pm_power_off)(void); |
10 | EXPORT_SYMBOL(pm_power_off); | ||
10 | 11 | ||
11 | void machine_restart(char * __unused) | 12 | void machine_restart(char * __unused) |
12 | { | 13 | { |
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index d8030f3bd8..92ff46ad21 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c | |||
@@ -36,12 +36,14 @@ int arch_register_cpu(int num) | |||
36 | parent = &sysfs_nodes[cpu_to_node(num)]; | 36 | parent = &sysfs_nodes[cpu_to_node(num)]; |
37 | #endif /* CONFIG_NUMA */ | 37 | #endif /* CONFIG_NUMA */ |
38 | 38 | ||
39 | #ifdef CONFIG_ACPI_BOOT | ||
39 | /* | 40 | /* |
40 | * If CPEI cannot be re-targetted, and this is | 41 | * If CPEI cannot be re-targetted, and this is |
41 | * CPEI target, then dont create the control file | 42 | * CPEI target, then dont create the control file |
42 | */ | 43 | */ |
43 | if (!can_cpei_retarget() && is_cpu_cpei_target(num)) | 44 | if (!can_cpei_retarget() && is_cpu_cpei_target(num)) |
44 | sysfs_cpus[num].cpu.no_control = 1; | 45 | sysfs_cpus[num].cpu.no_control = 1; |
46 | #endif | ||
45 | 47 | ||
46 | return register_cpu(&sysfs_cpus[num].cpu, num, parent); | 48 | return register_cpu(&sysfs_cpus[num].cpu, num, parent); |
47 | } | 49 | } |
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index f463d6baa6..5b1d3680c8 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -355,7 +355,7 @@ static void rp_do_receive(struct r_port *info, | |||
355 | ToRecv = space; | 355 | ToRecv = space; |
356 | 356 | ||
357 | if (ToRecv <= 0) | 357 | if (ToRecv <= 0) |
358 | return; | 358 | goto done; |
359 | 359 | ||
360 | /* | 360 | /* |
361 | * if status indicates there are errored characters in the | 361 | * if status indicates there are errored characters in the |
@@ -437,6 +437,7 @@ static void rp_do_receive(struct r_port *info, | |||
437 | } | 437 | } |
438 | /* Push the data up to the tty layer */ | 438 | /* Push the data up to the tty layer */ |
439 | ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); | 439 | ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); |
440 | done: | ||
440 | tty_ldisc_deref(ld); | 441 | tty_ldisc_deref(ld); |
441 | } | 442 | } |
442 | 443 | ||
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index d7aa7a29f6..30d96739fb 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2796,7 +2796,7 @@ void do_blank_screen(int entering_gfx) | |||
2796 | return; | 2796 | return; |
2797 | 2797 | ||
2798 | if (vesa_off_interval) { | 2798 | if (vesa_off_interval) { |
2799 | blank_state = blank_vesa_wait, | 2799 | blank_state = blank_vesa_wait; |
2800 | mod_timer(&console_timer, jiffies + vesa_off_interval); | 2800 | mod_timer(&console_timer, jiffies + vesa_off_interval); |
2801 | } | 2801 | } |
2802 | 2802 | ||
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 95980ad6b2..0c2ed99a38 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1345,7 +1345,8 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto | |||
1345 | } | 1345 | } |
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks) | 1348 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, |
1349 | int degraded) | ||
1349 | { | 1350 | { |
1350 | bitmap_counter_t *bmc; | 1351 | bitmap_counter_t *bmc; |
1351 | int rv; | 1352 | int rv; |
@@ -1362,8 +1363,10 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks) | |||
1362 | rv = 1; | 1363 | rv = 1; |
1363 | else if (NEEDED(*bmc)) { | 1364 | else if (NEEDED(*bmc)) { |
1364 | rv = 1; | 1365 | rv = 1; |
1365 | *bmc |= RESYNC_MASK; | 1366 | if (!degraded) { /* don't set/clear bits if degraded */ |
1366 | *bmc &= ~NEEDED_MASK; | 1367 | *bmc |= RESYNC_MASK; |
1368 | *bmc &= ~NEEDED_MASK; | ||
1369 | } | ||
1367 | } | 1370 | } |
1368 | } | 1371 | } |
1369 | spin_unlock_irq(&bitmap->lock); | 1372 | spin_unlock_irq(&bitmap->lock); |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index e11dd14d0b..2120710172 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -314,16 +314,16 @@ static int raid0_run (mddev_t *mddev) | |||
314 | sector_t space = conf->hash_spacing; | 314 | sector_t space = conf->hash_spacing; |
315 | int round; | 315 | int round; |
316 | conf->preshift = 0; | 316 | conf->preshift = 0; |
317 | if (sizeof(sector_t) > sizeof(unsigned long)) { | 317 | if (sizeof(sector_t) > sizeof(u32)) { |
318 | /*shift down space and s so that sector_div will work */ | 318 | /*shift down space and s so that sector_div will work */ |
319 | while (space > (sector_t) (~(unsigned long)0)) { | 319 | while (space > (sector_t) (~(u32)0)) { |
320 | s >>= 1; | 320 | s >>= 1; |
321 | space >>= 1; | 321 | space >>= 1; |
322 | s += 1; /* force round-up */ | 322 | s += 1; /* force round-up */ |
323 | conf->preshift++; | 323 | conf->preshift++; |
324 | } | 324 | } |
325 | } | 325 | } |
326 | round = sector_div(s, (unsigned long)space) ? 1 : 0; | 326 | round = sector_div(s, (u32)space) ? 1 : 0; |
327 | nb_zone = s + round; | 327 | nb_zone = s + round; |
328 | } | 328 | } |
329 | printk("raid0 : nb_zone is %d.\n", nb_zone); | 329 | printk("raid0 : nb_zone is %d.\n", nb_zone); |
@@ -443,7 +443,7 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio) | |||
443 | volatile | 443 | volatile |
444 | #endif | 444 | #endif |
445 | sector_t x = block >> conf->preshift; | 445 | sector_t x = block >> conf->preshift; |
446 | sector_div(x, (unsigned long)conf->hash_spacing); | 446 | sector_div(x, (u32)conf->hash_spacing); |
447 | zone = conf->hash_table[x]; | 447 | zone = conf->hash_table[x]; |
448 | } | 448 | } |
449 | 449 | ||
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ff1dbec864..5f253ee536 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1126,21 +1126,19 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1126 | * only be one in raid1 resync. | 1126 | * only be one in raid1 resync. |
1127 | * We can find the current addess in mddev->curr_resync | 1127 | * We can find the current addess in mddev->curr_resync |
1128 | */ | 1128 | */ |
1129 | if (!conf->fullsync) { | 1129 | if (mddev->curr_resync < max_sector) /* aborted */ |
1130 | if (mddev->curr_resync < max_sector) | 1130 | bitmap_end_sync(mddev->bitmap, mddev->curr_resync, |
1131 | bitmap_end_sync(mddev->bitmap, | ||
1132 | mddev->curr_resync, | ||
1133 | &sync_blocks, 1); | 1131 | &sync_blocks, 1); |
1134 | bitmap_close_sync(mddev->bitmap); | 1132 | else /* completed sync */ |
1135 | } | ||
1136 | if (mddev->curr_resync >= max_sector) | ||
1137 | conf->fullsync = 0; | 1133 | conf->fullsync = 0; |
1134 | |||
1135 | bitmap_close_sync(mddev->bitmap); | ||
1138 | close_sync(conf); | 1136 | close_sync(conf); |
1139 | return 0; | 1137 | return 0; |
1140 | } | 1138 | } |
1141 | 1139 | ||
1142 | if (!conf->fullsync && | 1140 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, mddev->degraded) && |
1143 | !bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks)) { | 1141 | !conf->fullsync) { |
1144 | /* We can skip this block, and probably several more */ | 1142 | /* We can skip this block, and probably several more */ |
1145 | *skipped = 1; | 1143 | *skipped = 1; |
1146 | return sync_blocks; | 1144 | return sync_blocks; |
@@ -1243,15 +1241,15 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1243 | len = (max_sector - sector_nr) << 9; | 1241 | len = (max_sector - sector_nr) << 9; |
1244 | if (len == 0) | 1242 | if (len == 0) |
1245 | break; | 1243 | break; |
1246 | if (!conf->fullsync) { | 1244 | if (sync_blocks == 0) { |
1247 | if (sync_blocks == 0) { | 1245 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, |
1248 | if (!bitmap_start_sync(mddev->bitmap, | 1246 | &sync_blocks, mddev->degraded) && |
1249 | sector_nr, &sync_blocks)) | 1247 | !conf->fullsync) |
1250 | break; | 1248 | break; |
1251 | if (sync_blocks < (PAGE_SIZE>>9)) | 1249 | if (sync_blocks < (PAGE_SIZE>>9)) |
1252 | BUG(); | 1250 | BUG(); |
1253 | if (len > (sync_blocks<<9)) len = sync_blocks<<9; | 1251 | if (len > (sync_blocks<<9)) |
1254 | } | 1252 | len = sync_blocks<<9; |
1255 | } | 1253 | } |
1256 | 1254 | ||
1257 | for (i=0 ; i < conf->raid_disks; i++) { | 1255 | for (i=0 ; i < conf->raid_disks; i++) { |
@@ -1264,7 +1262,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1264 | while (i > 0) { | 1262 | while (i > 0) { |
1265 | i--; | 1263 | i--; |
1266 | bio = r1_bio->bios[i]; | 1264 | bio = r1_bio->bios[i]; |
1267 | if (bio->bi_end_io==NULL) continue; | 1265 | if (bio->bi_end_io==NULL) |
1266 | continue; | ||
1268 | /* remove last page from this bio */ | 1267 | /* remove last page from this bio */ |
1269 | bio->bi_vcnt--; | 1268 | bio->bi_vcnt--; |
1270 | bio->bi_size -= len; | 1269 | bio->bi_size -= len; |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index b0b47c3cde..3d0c784b37 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-cards.c,v 1.85 2005/07/04 19:35:05 mkrufky Exp $ | 2 | * $Id: cx88-cards.c,v 1.86 2005/07/14 03:06:43 mchehab Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * card-specific stuff. | 5 | * card-specific stuff. |
@@ -682,9 +682,9 @@ struct cx88_board cx88_boards[] = { | |||
682 | .name = "PixelView PlayTV Ultra Pro (Stereo)", | 682 | .name = "PixelView PlayTV Ultra Pro (Stereo)", |
683 | /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */ | 683 | /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */ |
684 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, | 684 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, |
685 | .radio_type = TUNER_TEA5767, | 685 | .radio_type = UNSET, |
686 | .tuner_addr = 0xc2>>1, | 686 | .tuner_addr = ADDR_UNSET, |
687 | .radio_addr = 0xc0>>1, | 687 | .radio_addr = ADDR_UNSET, |
688 | .input = {{ | 688 | .input = {{ |
689 | .type = CX88_VMUX_TELEVISION, | 689 | .type = CX88_VMUX_TELEVISION, |
690 | .vmux = 0, | 690 | .vmux = 0, |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 8db68f2d13..6ad1458ab6 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-dvb.c,v 1.41 2005/07/04 19:35:05 mkrufky Exp $ | 2 | * $Id: cx88-dvb.c,v 1.42 2005/07/12 15:44:55 mkrufky Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * MPEG Transport Stream (DVB) routines | 5 | * MPEG Transport Stream (DVB) routines |
@@ -180,12 +180,14 @@ static struct mt352_config dntv_live_dvbt_config = { | |||
180 | #if CONFIG_DVB_CX22702 | 180 | #if CONFIG_DVB_CX22702 |
181 | static struct cx22702_config connexant_refboard_config = { | 181 | static struct cx22702_config connexant_refboard_config = { |
182 | .demod_address = 0x43, | 182 | .demod_address = 0x43, |
183 | .output_mode = CX22702_SERIAL_OUTPUT, | ||
183 | .pll_address = 0x60, | 184 | .pll_address = 0x60, |
184 | .pll_desc = &dvb_pll_thomson_dtt7579, | 185 | .pll_desc = &dvb_pll_thomson_dtt7579, |
185 | }; | 186 | }; |
186 | 187 | ||
187 | static struct cx22702_config hauppauge_novat_config = { | 188 | static struct cx22702_config hauppauge_novat_config = { |
188 | .demod_address = 0x43, | 189 | .demod_address = 0x43, |
190 | .output_mode = CX22702_SERIAL_OUTPUT, | ||
189 | .pll_address = 0x61, | 191 | .pll_address = 0x61, |
190 | .pll_desc = &dvb_pll_thomson_dtt759x, | 192 | .pll_desc = &dvb_pll_thomson_dtt759x, |
191 | }; | 193 | }; |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index c44a079d08..5588a3aeec 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-video.c,v 1.79 2005/07/07 14:17:47 mchehab Exp $ | 2 | * $Id: cx88-video.c,v 1.80 2005/07/13 08:49:08 mchehab Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * video4linux video interface | 5 | * video4linux video interface |
@@ -1346,6 +1346,11 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1346 | dev->freq = f->frequency; | 1346 | dev->freq = f->frequency; |
1347 | cx88_newstation(core); | 1347 | cx88_newstation(core); |
1348 | cx88_call_i2c_clients(dev->core,VIDIOC_S_FREQUENCY,f); | 1348 | cx88_call_i2c_clients(dev->core,VIDIOC_S_FREQUENCY,f); |
1349 | |||
1350 | /* When changing channels it is required to reset TVAUDIO */ | ||
1351 | msleep (10); | ||
1352 | cx88_set_tvaudio(core); | ||
1353 | |||
1349 | up(&dev->lock); | 1354 | up(&dev->lock); |
1350 | return 0; | 1355 | return 0; |
1351 | } | 1356 | } |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 307beae04f..b008f7db6d 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88.h,v 1.68 2005/07/07 14:17:47 mchehab Exp $ | 2 | * $Id: cx88.h,v 1.69 2005/07/13 17:25:25 mchehab Exp $ |
3 | * | 3 | * |
4 | * v4l2 device driver for cx2388x based TV cards | 4 | * v4l2 device driver for cx2388x based TV cards |
5 | * | 5 | * |
@@ -35,8 +35,8 @@ | |||
35 | #include "btcx-risc.h" | 35 | #include "btcx-risc.h" |
36 | #include "cx88-reg.h" | 36 | #include "cx88-reg.h" |
37 | 37 | ||
38 | #include <linux/version.h> | 38 | #include <linux/utsname.h> |
39 | #define CX88_VERSION_CODE KERNEL_VERSION(0,0,4) | 39 | #define CX88_VERSION_CODE KERNEL_VERSION(0,0,5) |
40 | 40 | ||
41 | #ifndef TRUE | 41 | #ifndef TRUE |
42 | # define TRUE (1==1) | 42 | # define TRUE (1==1) |
diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index b53c748caf..4d27ac1b7f 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview | 2 | * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview |
3 | * I2C address is allways 0xC0. | 3 | * I2C address is allways 0xC0. |
4 | * | 4 | * |
5 | * $Id: tea5767.c,v 1.18 2005/07/07 03:02:55 mchehab Exp $ | 5 | * $Id: tea5767.c,v 1.21 2005/07/14 03:06:43 mchehab Exp $ |
6 | * | 6 | * |
7 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) | 7 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) |
8 | * This code is placed under the terms of the GNU General Public License | 8 | * This code is placed under the terms of the GNU General Public License |
@@ -153,17 +153,17 @@ static void tea5767_status_dump(unsigned char *buffer) | |||
153 | 153 | ||
154 | switch (TEA5767_HIGH_LO_32768) { | 154 | switch (TEA5767_HIGH_LO_32768) { |
155 | case TEA5767_HIGH_LO_13MHz: | 155 | case TEA5767_HIGH_LO_13MHz: |
156 | frq = 1000 * (div * 50 - 700 - 225) / 4; /* Freq in KHz */ | 156 | frq = (div * 50000 - 700000 - 225000) / 4; /* Freq in KHz */ |
157 | break; | 157 | break; |
158 | case TEA5767_LOW_LO_13MHz: | 158 | case TEA5767_LOW_LO_13MHz: |
159 | frq = 1000 * (div * 50 + 700 + 225) / 4; /* Freq in KHz */ | 159 | frq = (div * 50000 + 700000 + 225000) / 4; /* Freq in KHz */ |
160 | break; | 160 | break; |
161 | case TEA5767_LOW_LO_32768: | 161 | case TEA5767_LOW_LO_32768: |
162 | frq = 1000 * (div * 32768 / 1000 + 700 + 225) / 4; /* Freq in KHz */ | 162 | frq = (div * 32768 + 700000 + 225000) / 4; /* Freq in KHz */ |
163 | break; | 163 | break; |
164 | case TEA5767_HIGH_LO_32768: | 164 | case TEA5767_HIGH_LO_32768: |
165 | default: | 165 | default: |
166 | frq = 1000 * (div * 32768 / 1000 - 700 - 225) / 4; /* Freq in KHz */ | 166 | frq = (div * 32768 - 700000 - 225000) / 4; /* Freq in KHz */ |
167 | break; | 167 | break; |
168 | } | 168 | } |
169 | buffer[0] = (div >> 8) & 0x3f; | 169 | buffer[0] = (div >> 8) & 0x3f; |
@@ -196,7 +196,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) | |||
196 | unsigned div; | 196 | unsigned div; |
197 | int rc; | 197 | int rc; |
198 | 198 | ||
199 | tuner_dbg (PREFIX "radio freq counter %d\n", frq); | 199 | tuner_dbg (PREFIX "radio freq = %d.%03d MHz\n", frq/16000,(frq/16)%1000); |
200 | 200 | ||
201 | /* Rounds freq to next decimal value - for 62.5 KHz step */ | 201 | /* Rounds freq to next decimal value - for 62.5 KHz step */ |
202 | /* frq = 20*(frq/16)+radio_frq[frq%16]; */ | 202 | /* frq = 20*(frq/16)+radio_frq[frq%16]; */ |
@@ -224,19 +224,19 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) | |||
224 | tuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n"); | 224 | tuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n"); |
225 | buffer[2] |= TEA5767_HIGH_LO_INJECT; | 225 | buffer[2] |= TEA5767_HIGH_LO_INJECT; |
226 | buffer[4] |= TEA5767_PLLREF_ENABLE; | 226 | buffer[4] |= TEA5767_PLLREF_ENABLE; |
227 | div = (frq * 4 / 16 + 700 + 225 + 25) / 50; | 227 | div = (frq * 4000 / 16 + 700000 + 225000 + 25000) / 50000; |
228 | break; | 228 | break; |
229 | case TEA5767_LOW_LO_13MHz: | 229 | case TEA5767_LOW_LO_13MHz: |
230 | tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n"); | 230 | tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n"); |
231 | 231 | ||
232 | buffer[4] |= TEA5767_PLLREF_ENABLE; | 232 | buffer[4] |= TEA5767_PLLREF_ENABLE; |
233 | div = (frq * 4 / 16 - 700 - 225 + 25) / 50; | 233 | div = (frq * 4000 / 16 - 700000 - 225000 + 25000) / 50000; |
234 | break; | 234 | break; |
235 | case TEA5767_LOW_LO_32768: | 235 | case TEA5767_LOW_LO_32768: |
236 | tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n"); | 236 | tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n"); |
237 | buffer[3] |= TEA5767_XTAL_32768; | 237 | buffer[3] |= TEA5767_XTAL_32768; |
238 | /* const 700=4000*175 Khz - to adjust freq to right value */ | 238 | /* const 700=4000*175 Khz - to adjust freq to right value */ |
239 | div = (1000 * (frq * 4 / 16 - 700 - 225) + 16384) >> 15; | 239 | div = ((frq * 4000 / 16 - 700000 - 225000) + 16384) >> 15; |
240 | break; | 240 | break; |
241 | case TEA5767_HIGH_LO_32768: | 241 | case TEA5767_HIGH_LO_32768: |
242 | default: | 242 | default: |
@@ -244,17 +244,21 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq) | |||
244 | 244 | ||
245 | buffer[2] |= TEA5767_HIGH_LO_INJECT; | 245 | buffer[2] |= TEA5767_HIGH_LO_INJECT; |
246 | buffer[3] |= TEA5767_XTAL_32768; | 246 | buffer[3] |= TEA5767_XTAL_32768; |
247 | div = (1000 * (frq * 4 / 16 + 700 + 225) + 16384) >> 15; | 247 | div = ((frq * (4000 / 16) + 700000 + 225000) + 16384) >> 15; |
248 | break; | 248 | break; |
249 | } | 249 | } |
250 | buffer[0] = (div >> 8) & 0x3f; | 250 | buffer[0] = (div >> 8) & 0x3f; |
251 | buffer[1] = div & 0xff; | 251 | buffer[1] = div & 0xff; |
252 | 252 | ||
253 | if (tuner_debug) | ||
254 | tea5767_status_dump(buffer); | ||
255 | |||
256 | if (5 != (rc = i2c_master_send(c, buffer, 5))) | 253 | if (5 != (rc = i2c_master_send(c, buffer, 5))) |
257 | tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); | 254 | tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); |
255 | |||
256 | if (tuner_debug) { | ||
257 | if (5 != (rc = i2c_master_recv(c, buffer, 5))) | ||
258 | tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); | ||
259 | else | ||
260 | tea5767_status_dump(buffer); | ||
261 | } | ||
258 | } | 262 | } |
259 | 263 | ||
260 | static int tea5767_signal(struct i2c_client *c) | 264 | static int tea5767_signal(struct i2c_client *c) |
@@ -294,7 +298,7 @@ int tea5767_autodetection(struct i2c_client *c) | |||
294 | struct tuner *t = i2c_get_clientdata(c); | 298 | struct tuner *t = i2c_get_clientdata(c); |
295 | 299 | ||
296 | if (5 != (rc = i2c_master_recv(c, buffer, 5))) { | 300 | if (5 != (rc = i2c_master_recv(c, buffer, 5))) { |
297 | tuner_warn("it is not a TEA5767. Received %i chars.\n", rc); | 301 | tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); |
298 | return EINVAL; | 302 | return EINVAL; |
299 | } | 303 | } |
300 | 304 | ||
@@ -310,11 +314,11 @@ int tea5767_autodetection(struct i2c_client *c) | |||
310 | * bit 0 : internally set to 0 | 314 | * bit 0 : internally set to 0 |
311 | * Byte 5: bit 7:0 : == 0 | 315 | * Byte 5: bit 7:0 : == 0 |
312 | */ | 316 | */ |
313 | |||
314 | if (!((buffer[3] & 0x0f) == 0x00) && (buffer[4] == 0x00)) { | 317 | if (!((buffer[3] & 0x0f) == 0x00) && (buffer[4] == 0x00)) { |
315 | tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); | 318 | tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); |
316 | return EINVAL; | 319 | return EINVAL; |
317 | } | 320 | } |
321 | |||
318 | tuner_warn("TEA5767 detected.\n"); | 322 | tuner_warn("TEA5767 detected.\n"); |
319 | return 0; | 323 | return 0; |
320 | } | 324 | } |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index de190630ba..b25a9c08ac 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: tuner-core.c,v 1.55 2005/07/08 13:20:33 mchehab Exp $ | 2 | * $Id: tuner-core.c,v 1.58 2005/07/14 03:06:43 mchehab Exp $ |
3 | * | 3 | * |
4 | * i2c tv tuner chip device driver | 4 | * i2c tv tuner chip device driver |
5 | * core core, i.e. kernel interfaces, registering and so on | 5 | * core core, i.e. kernel interfaces, registering and so on |
@@ -39,6 +39,9 @@ I2C_CLIENT_INSMOD; | |||
39 | static unsigned int addr = 0; | 39 | static unsigned int addr = 0; |
40 | module_param(addr, int, 0444); | 40 | module_param(addr, int, 0444); |
41 | 41 | ||
42 | static unsigned int no_autodetect = 0; | ||
43 | module_param(no_autodetect, int, 0444); | ||
44 | |||
42 | /* insmod options used at runtime => read/write */ | 45 | /* insmod options used at runtime => read/write */ |
43 | unsigned int tuner_debug = 0; | 46 | unsigned int tuner_debug = 0; |
44 | module_param(tuner_debug, int, 0644); | 47 | module_param(tuner_debug, int, 0644); |
@@ -318,17 +321,19 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) | |||
318 | tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); | 321 | tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); |
319 | 322 | ||
320 | /* TEA5767 autodetection code - only for addr = 0xc0 */ | 323 | /* TEA5767 autodetection code - only for addr = 0xc0 */ |
321 | if (addr == 0x60) { | 324 | if (!no_autodetect) { |
322 | if (tea5767_autodetection(&t->i2c) != EINVAL) { | 325 | if (addr == 0x60) { |
323 | t->type = TUNER_TEA5767; | 326 | if (tea5767_autodetection(&t->i2c) != EINVAL) { |
324 | t->mode_mask = T_RADIO; | 327 | t->type = TUNER_TEA5767; |
325 | t->mode = T_STANDBY; | 328 | t->mode_mask = T_RADIO; |
326 | t->freq = 87.5 * 16; /* Sets freq to FM range */ | 329 | t->mode = T_STANDBY; |
327 | default_mode_mask &= ~T_RADIO; | 330 | t->freq = 87.5 * 16; /* Sets freq to FM range */ |
328 | 331 | default_mode_mask &= ~T_RADIO; | |
329 | i2c_attach_client (&t->i2c); | 332 | |
330 | set_type(&t->i2c,t->type, t->mode_mask); | 333 | i2c_attach_client (&t->i2c); |
331 | return 0; | 334 | set_type(&t->i2c,t->type, t->mode_mask); |
335 | return 0; | ||
336 | } | ||
332 | } | 337 | } |
333 | } | 338 | } |
334 | 339 | ||
@@ -631,7 +636,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
631 | break; | 636 | break; |
632 | } | 637 | } |
633 | default: | 638 | default: |
634 | tuner_dbg("Unimplemented IOCTL 0x%08x called to tuner.\n", cmd); | 639 | tuner_dbg("Unimplemented IOCTL 0x%08x(dir=%d,tp=0x%02x,nr=%d,sz=%d)\n", |
640 | cmd, _IOC_DIR(cmd), _IOC_TYPE(cmd), | ||
641 | _IOC_NR(cmd), _IOC_SIZE(cmd)); | ||
635 | break; | 642 | break; |
636 | } | 643 | } |
637 | 644 | ||
diff --git a/fs/ext2/xip.c b/fs/ext2/xip.c index d44431d1a3..0aa5ac159c 100644 --- a/fs/ext2/xip.c +++ b/fs/ext2/xip.c | |||
@@ -15,66 +15,79 @@ | |||
15 | #include "xip.h" | 15 | #include "xip.h" |
16 | 16 | ||
17 | static inline int | 17 | static inline int |
18 | __inode_direct_access(struct inode *inode, sector_t sector, unsigned long *data) { | 18 | __inode_direct_access(struct inode *inode, sector_t sector, |
19 | unsigned long *data) | ||
20 | { | ||
19 | BUG_ON(!inode->i_sb->s_bdev->bd_disk->fops->direct_access); | 21 | BUG_ON(!inode->i_sb->s_bdev->bd_disk->fops->direct_access); |
20 | return inode->i_sb->s_bdev->bd_disk->fops | 22 | return inode->i_sb->s_bdev->bd_disk->fops |
21 | ->direct_access(inode->i_sb->s_bdev,sector,data); | 23 | ->direct_access(inode->i_sb->s_bdev,sector,data); |
22 | } | 24 | } |
23 | 25 | ||
26 | static inline int | ||
27 | __ext2_get_sector(struct inode *inode, sector_t offset, int create, | ||
28 | sector_t *result) | ||
29 | { | ||
30 | struct buffer_head tmp; | ||
31 | int rc; | ||
32 | |||
33 | memset(&tmp, 0, sizeof(struct buffer_head)); | ||
34 | rc = ext2_get_block(inode, offset/ (PAGE_SIZE/512), &tmp, | ||
35 | create); | ||
36 | *result = tmp.b_blocknr; | ||
37 | |||
38 | /* did we get a sparse block (hole in the file)? */ | ||
39 | if (!(*result)) { | ||
40 | BUG_ON(create); | ||
41 | rc = -ENODATA; | ||
42 | } | ||
43 | |||
44 | return rc; | ||
45 | } | ||
46 | |||
24 | int | 47 | int |
25 | ext2_clear_xip_target(struct inode *inode, int block) { | 48 | ext2_clear_xip_target(struct inode *inode, int block) |
26 | sector_t sector = block*(PAGE_SIZE/512); | 49 | { |
50 | sector_t sector = block * (PAGE_SIZE/512); | ||
27 | unsigned long data; | 51 | unsigned long data; |
28 | int rc; | 52 | int rc; |
29 | 53 | ||
30 | rc = __inode_direct_access(inode, sector, &data); | 54 | rc = __inode_direct_access(inode, sector, &data); |
31 | if (rc) | 55 | if (!rc) |
32 | return rc; | 56 | clear_page((void*)data); |
33 | clear_page((void*)data); | 57 | return rc; |
34 | return 0; | ||
35 | } | 58 | } |
36 | 59 | ||
37 | void ext2_xip_verify_sb(struct super_block *sb) | 60 | void ext2_xip_verify_sb(struct super_block *sb) |
38 | { | 61 | { |
39 | struct ext2_sb_info *sbi = EXT2_SB(sb); | 62 | struct ext2_sb_info *sbi = EXT2_SB(sb); |
40 | 63 | ||
41 | if ((sbi->s_mount_opt & EXT2_MOUNT_XIP)) { | 64 | if ((sbi->s_mount_opt & EXT2_MOUNT_XIP) && |
42 | if ((sb->s_bdev == NULL) || | 65 | !sb->s_bdev->bd_disk->fops->direct_access) { |
43 | sb->s_bdev->bd_disk == NULL || | 66 | sbi->s_mount_opt &= (~EXT2_MOUNT_XIP); |
44 | sb->s_bdev->bd_disk->fops == NULL || | 67 | ext2_warning(sb, __FUNCTION__, |
45 | sb->s_bdev->bd_disk->fops->direct_access == NULL) { | 68 | "ignoring xip option - not supported by bdev"); |
46 | sbi->s_mount_opt &= (~EXT2_MOUNT_XIP); | ||
47 | ext2_warning(sb, __FUNCTION__, | ||
48 | "ignoring xip option - not supported by bdev"); | ||
49 | } | ||
50 | } | 69 | } |
51 | } | 70 | } |
52 | 71 | ||
53 | struct page* | 72 | struct page * |
54 | ext2_get_xip_page(struct address_space *mapping, sector_t blockno, | 73 | ext2_get_xip_page(struct address_space *mapping, sector_t offset, |
55 | int create) | 74 | int create) |
56 | { | 75 | { |
57 | int rc; | 76 | int rc; |
58 | unsigned long data; | 77 | unsigned long data; |
59 | struct buffer_head tmp; | 78 | sector_t sector; |
60 | 79 | ||
61 | tmp.b_state = 0; | 80 | /* first, retrieve the sector number */ |
62 | tmp.b_blocknr = 0; | 81 | rc = __ext2_get_sector(mapping->host, offset, create, §or); |
63 | rc = ext2_get_block(mapping->host, blockno/(PAGE_SIZE/512) , &tmp, | ||
64 | create); | ||
65 | if (rc) | 82 | if (rc) |
66 | return ERR_PTR(rc); | 83 | goto error; |
67 | if (tmp.b_blocknr == 0) { | ||
68 | /* SPARSE block */ | ||
69 | BUG_ON(create); | ||
70 | return ERR_PTR(-ENODATA); | ||
71 | } | ||
72 | 84 | ||
85 | /* retrieve address of the target data */ | ||
73 | rc = __inode_direct_access | 86 | rc = __inode_direct_access |
74 | (mapping->host,tmp.b_blocknr*(PAGE_SIZE/512) ,&data); | 87 | (mapping->host, sector * (PAGE_SIZE/512), &data); |
75 | if (rc) | 88 | if (!rc) |
76 | return ERR_PTR(rc); | 89 | return virt_to_page(data); |
77 | 90 | ||
78 | SetPageUptodate(virt_to_page(data)); | 91 | error: |
79 | return virt_to_page(data); | 92 | return ERR_PTR(rc); |
80 | } | 93 | } |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index e24b74b111..6213e976ea 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -262,7 +262,7 @@ void bitmap_write_all(struct bitmap *bitmap); | |||
262 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); | 262 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); |
263 | void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, | 263 | void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, |
264 | int success); | 264 | int success); |
265 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks); | 265 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); |
266 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); | 266 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); |
267 | void bitmap_close_sync(struct bitmap *bitmap); | 267 | void bitmap_close_sync(struct bitmap *bitmap); |
268 | 268 | ||
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c index 4553b2c5aa..8c199f5377 100644 --- a/mm/filemap_xip.c +++ b/mm/filemap_xip.c | |||
@@ -68,13 +68,12 @@ do_xip_mapping_read(struct address_space *mapping, | |||
68 | if (unlikely(IS_ERR(page))) { | 68 | if (unlikely(IS_ERR(page))) { |
69 | if (PTR_ERR(page) == -ENODATA) { | 69 | if (PTR_ERR(page) == -ENODATA) { |
70 | /* sparse */ | 70 | /* sparse */ |
71 | page = virt_to_page(empty_zero_page); | 71 | page = ZERO_PAGE(0); |
72 | } else { | 72 | } else { |
73 | desc->error = PTR_ERR(page); | 73 | desc->error = PTR_ERR(page); |
74 | goto out; | 74 | goto out; |
75 | } | 75 | } |
76 | } else | 76 | } |
77 | BUG_ON(!PageUptodate(page)); | ||
78 | 77 | ||
79 | /* If users can be writing to this page using arbitrary | 78 | /* If users can be writing to this page using arbitrary |
80 | * virtual addresses, take care about potential aliasing | 79 | * virtual addresses, take care about potential aliasing |
@@ -84,8 +83,7 @@ do_xip_mapping_read(struct address_space *mapping, | |||
84 | flush_dcache_page(page); | 83 | flush_dcache_page(page); |
85 | 84 | ||
86 | /* | 85 | /* |
87 | * Ok, we have the page, and it's up-to-date, so | 86 | * Ok, we have the page, so now we can copy it to user space... |
88 | * now we can copy it to user space... | ||
89 | * | 87 | * |
90 | * The actor routine returns how many bytes were actually used.. | 88 | * The actor routine returns how many bytes were actually used.. |
91 | * NOTE! This may not be the same as how much of a user buffer | 89 | * NOTE! This may not be the same as how much of a user buffer |
@@ -164,7 +162,7 @@ EXPORT_SYMBOL_GPL(xip_file_sendfile); | |||
164 | * xip_write | 162 | * xip_write |
165 | * | 163 | * |
166 | * This function walks all vmas of the address_space and unmaps the | 164 | * This function walks all vmas of the address_space and unmaps the |
167 | * empty_zero_page when found at pgoff. Should it go in rmap.c? | 165 | * ZERO_PAGE when found at pgoff. Should it go in rmap.c? |
168 | */ | 166 | */ |
169 | static void | 167 | static void |
170 | __xip_unmap (struct address_space * mapping, | 168 | __xip_unmap (struct address_space * mapping, |
@@ -187,7 +185,7 @@ __xip_unmap (struct address_space * mapping, | |||
187 | * We need the page_table_lock to protect us from page faults, | 185 | * We need the page_table_lock to protect us from page faults, |
188 | * munmap, fork, etc... | 186 | * munmap, fork, etc... |
189 | */ | 187 | */ |
190 | pte = page_check_address(virt_to_page(empty_zero_page), mm, | 188 | pte = page_check_address(ZERO_PAGE(address), mm, |
191 | address); | 189 | address); |
192 | if (!IS_ERR(pte)) { | 190 | if (!IS_ERR(pte)) { |
193 | /* Nuke the page table entry. */ | 191 | /* Nuke the page table entry. */ |
@@ -230,7 +228,6 @@ xip_file_nopage(struct vm_area_struct * area, | |||
230 | 228 | ||
231 | page = mapping->a_ops->get_xip_page(mapping, pgoff*(PAGE_SIZE/512), 0); | 229 | page = mapping->a_ops->get_xip_page(mapping, pgoff*(PAGE_SIZE/512), 0); |
232 | if (!IS_ERR(page)) { | 230 | if (!IS_ERR(page)) { |
233 | BUG_ON(!PageUptodate(page)); | ||
234 | return page; | 231 | return page; |
235 | } | 232 | } |
236 | if (PTR_ERR(page) != -ENODATA) | 233 | if (PTR_ERR(page) != -ENODATA) |
@@ -245,12 +242,11 @@ xip_file_nopage(struct vm_area_struct * area, | |||
245 | pgoff*(PAGE_SIZE/512), 1); | 242 | pgoff*(PAGE_SIZE/512), 1); |
246 | if (IS_ERR(page)) | 243 | if (IS_ERR(page)) |
247 | return NULL; | 244 | return NULL; |
248 | BUG_ON(!PageUptodate(page)); | ||
249 | /* unmap page at pgoff from all other vmas */ | 245 | /* unmap page at pgoff from all other vmas */ |
250 | __xip_unmap(mapping, pgoff); | 246 | __xip_unmap(mapping, pgoff); |
251 | } else { | 247 | } else { |
252 | /* not shared and writable, use empty_zero_page */ | 248 | /* not shared and writable, use ZERO_PAGE() */ |
253 | page = virt_to_page(empty_zero_page); | 249 | page = ZERO_PAGE(address); |
254 | } | 250 | } |
255 | 251 | ||
256 | return page; | 252 | return page; |
@@ -319,8 +315,6 @@ __xip_file_write(struct file *filp, const char __user *buf, | |||
319 | break; | 315 | break; |
320 | } | 316 | } |
321 | 317 | ||
322 | BUG_ON(!PageUptodate(page)); | ||
323 | |||
324 | copied = filemap_copy_from_user(page, offset, buf, bytes); | 318 | copied = filemap_copy_from_user(page, offset, buf, bytes); |
325 | flush_dcache_page(page); | 319 | flush_dcache_page(page); |
326 | if (likely(copied > 0)) { | 320 | if (likely(copied > 0)) { |
@@ -435,8 +429,7 @@ xip_truncate_page(struct address_space *mapping, loff_t from) | |||
435 | return 0; | 429 | return 0; |
436 | else | 430 | else |
437 | return PTR_ERR(page); | 431 | return PTR_ERR(page); |
438 | } else | 432 | } |
439 | BUG_ON(!PageUptodate(page)); | ||
440 | kaddr = kmap_atomic(page, KM_USER0); | 433 | kaddr = kmap_atomic(page, KM_USER0); |
441 | memset(kaddr + offset, 0, length); | 434 | memset(kaddr + offset, 0, length); |
442 | kunmap_atomic(kaddr, KM_USER0); | 435 | kunmap_atomic(kaddr, KM_USER0); |