--- patch-2.6.28.10	2009-05-02 21:39:49.000000000 +0200
+++ n900-2.6.28.10-20094803.patch	2010-03-06 14:29:49.000000000 +0100
@@ -5216,18 +5216,6 @@
  		spin_unlock(&rbu_data.lock);
  	}
  	return size;
-diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index 82020ab..a4424c8 100644
---- a/drivers/gpio/gpiolib.c
-+++ b/drivers/gpio/gpiolib.c
-@@ -789,6 +789,7 @@ int gpio_request(unsigned gpio, const char *label)
- 	} else {
- 		status = -EBUSY;
- 		module_put(chip->owner);
-+		goto done;
- 	}
- 
- 	if (chip->request) {
 diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
 index 3d33b82..1479659 100644
 --- a/drivers/gpu/drm/drm_agpsupport.c
@@ -7123,19 +7111,6 @@
  
  MODULE_AUTHOR("Borislav Deianov, Henrique de Moraes Holschuh");
  MODULE_DESCRIPTION(TPACPI_DESC);
-diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
-index 3d067c3..db7e4c4 100644
---- a/drivers/mmc/card/block.c
-+++ b/drivers/mmc/card/block.c
-@@ -514,7 +514,7 @@ static int mmc_blk_probe(struct mmc_card *card)
- 	if (err)
- 		goto out;
- 
--	string_get_size(get_capacity(md->disk) << 9, STRING_UNITS_2,
-+	string_get_size((u64)get_capacity(md->disk) << 9, STRING_UNITS_2,
- 			cap_str, sizeof(cap_str));
- 	printk(KERN_INFO "%s: %s %s %s %s\n",
- 		md->disk->disk_name, mmc_card_id(card), mmc_card_name(card),
 diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
 index b92b172..b9f1e84 100644
 --- a/drivers/mmc/card/mmc_test.c
@@ -14124,49 +14099,6 @@
 index 96355d5..011b9b8 100644
 --- a/fs/eventpoll.c
 +++ b/fs/eventpoll.c
-@@ -234,8 +234,6 @@ struct ep_pqueue {
- /*
-  * Configuration options available inside /proc/sys/fs/epoll/
-  */
--/* Maximum number of epoll devices, per user */
--static int max_user_instances __read_mostly;
- /* Maximum number of epoll watched descriptors, per user */
- static int max_user_watches __read_mostly;
- 
-@@ -261,14 +259,6 @@ static int zero;
- 
- ctl_table epoll_table[] = {
- 	{
--		.procname	= "max_user_instances",
--		.data		= &max_user_instances,
--		.maxlen		= sizeof(int),
--		.mode		= 0644,
--		.proc_handler	= &proc_dointvec_minmax,
--		.extra1		= &zero,
--	},
--	{
- 		.procname	= "max_user_watches",
- 		.data		= &max_user_watches,
- 		.maxlen		= sizeof(int),
-@@ -491,7 +481,6 @@ static void ep_free(struct eventpoll *ep)
- 
- 	mutex_unlock(&epmutex);
- 	mutex_destroy(&ep->mtx);
--	atomic_dec(&ep->user->epoll_devs);
- 	free_uid(ep->user);
- 	kfree(ep);
- }
-@@ -581,10 +570,6 @@ static int ep_alloc(struct eventpoll **pep)
- 	struct eventpoll *ep;
- 
- 	user = get_current_user();
--	error = -EMFILE;
--	if (unlikely(atomic_read(&user->epoll_devs) >=
--			max_user_instances))
--		goto free_uid;
- 	error = -ENOMEM;
- 	ep = kzalloc(sizeof(*ep), GFP_KERNEL);
- 	if (unlikely(!ep))
 @@ -1110,7 +1095,7 @@ retry:
  /*
   * Open an eventpoll file descriptor.
@@ -14176,14 +14108,6 @@
  {
  	int error, fd = -1;
  	struct eventpoll *ep;
-@@ -1141,7 +1126,6 @@ asmlinkage long sys_epoll_create1(int flags)
- 			      flags & O_CLOEXEC);
- 	if (fd < 0)
- 		ep_free(ep);
--	atomic_inc(&ep->user->epoll_devs);
- 
- error_return:
- 	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
 @@ -1150,7 +1134,7 @@ error_return:
  	return fd;
  }
@@ -14228,19 +14152,6 @@
  {
  	int error;
  	sigset_t ksigmask, sigsaved;
-@@ -1366,8 +1350,10 @@ static int __init eventpoll_init(void)
- 	struct sysinfo si;
- 
- 	si_meminfo(&si);
--	max_user_instances = 128;
--	max_user_watches = (((si.totalram - si.totalhigh) / 32) << PAGE_SHIFT) /
-+	/*
-+	 * Allows top 4% of lomem to be allocated for epoll watches (per user).
-+	 */
-+	max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) /
- 		EP_ITEM_COST;
- 
- 	/* Initialize the structure used to perform safe poll wait head wake ups */
 diff --git a/fs/exec.c b/fs/exec.c
 index ec5df9a..eed0bb8 100644
 --- a/fs/exec.c
@@ -14628,7 +14539,7 @@
 -	}
 +	if (!err)
 +		err = ret;
- 	sb->s_dirt = 1;
+ 	mark_sb_dirty(sb);
 +
  error_return:
  	brelse(bitmap_bh);
@@ -16583,7 +16494,7 @@
 +#else
 +		es->s_flags |= cpu_to_le32(EXT2_FLAGS_SIGNED_HASH);
 +#endif
-+		sb->s_dirt = 1;
++		mark_sb_dirty(sb);
 +	}
  
  	if (sbi->s_blocks_per_group > blocksize * 8) {
@@ -16635,7 +16546,7 @@
 +	tid_t target;
  
  	trace_mark(ext4_sync_fs, "dev %s wait %d", sb->s_id, wait);
- 	sb->s_dirt = 0;
+ 	mark_sb_clean(sb);
 -	if (wait)
 -		ret = ext4_force_commit(sb);
 -	else
@@ -20347,14 +20258,6 @@
  
  #define __set_task_state(tsk, state_value)		\
  	do { (tsk)->state = (state_value); } while (0)
-@@ -631,7 +632,6 @@ struct user_struct {
- 	atomic_t inotify_devs;	/* How many inotify devs does this user have opened? */
- #endif
- #ifdef CONFIG_EPOLL
--	atomic_t epoll_devs;	/* The number of epoll descriptors currently open */
- 	atomic_t epoll_watches;	/* The number of file descriptors currently watched */
- #endif
- #ifdef CONFIG_POSIX_MQUEUE
 diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
 index dc50bcc..cbb25fc 100644
 --- a/include/linux/seq_file.h
@@ -20367,21 +20270,6 @@
  	u64 version;
  	struct mutex lock;
  	const struct seq_operations *op;
-diff --git a/include/linux/serial.h b/include/linux/serial.h
-index 1ea8d92..9136cc5 100644
---- a/include/linux/serial.h
-+++ b/include/linux/serial.h
-@@ -10,8 +10,9 @@
- #ifndef _LINUX_SERIAL_H
- #define _LINUX_SERIAL_H
- 
--#ifdef __KERNEL__
- #include <linux/types.h>
-+
-+#ifdef __KERNEL__
- #include <asm/page.h>
- 
- /*
 diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
 index 4e4f127..a551e97 100644
 --- a/include/linux/serial_core.h
@@ -21206,23 +21094,6 @@
  {
  	struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
  	unsigned i, tocopy;
-diff --git a/kernel/cgroup.c b/kernel/cgroup.c
-index 2606d0f..c882385 100644
---- a/kernel/cgroup.c
-+++ b/kernel/cgroup.c
-@@ -2942,7 +2942,11 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
- 	parent = task_cgroup(tsk, subsys->subsys_id);
- 
- 	/* Pin the hierarchy */
--	atomic_inc(&parent->root->sb->s_active);
-+	if (!atomic_inc_not_zero(&parent->root->sb->s_active)) {
-+		/* We race with the final deactivate_super() */
-+		mutex_unlock(&cgroup_mutex);
-+		return 0;
-+	}
- 
- 	/* Keep the cgroup alive */
- 	get_css_set(cg);
 diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
 index 0511716..667c841 100644
 --- a/kernel/exec_domain.c
@@ -24773,38 +24644,6 @@
  };
  
  static bool icmpv6_invert_tuple(struct nf_conntrack_tuple *tuple,
-diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
-index f6d69da..8b702d0 100644
---- a/net/mac80211/rc80211_minstrel.c
-+++ b/net/mac80211/rc80211_minstrel.c
-@@ -389,13 +389,15 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
- {
- 	struct minstrel_sta_info *mi = priv_sta;
- 	struct minstrel_priv *mp = priv;
--	struct minstrel_rate *mr_ctl;
-+	struct ieee80211_local *local = hw_to_local(mp->hw);
-+	struct ieee80211_rate *ctl_rate;
- 	unsigned int i, n = 0;
- 	unsigned int t_slot = 9; /* FIXME: get real slot time */
- 
- 	mi->lowest_rix = rate_lowest_index(sband, sta);
--	mr_ctl = &mi->r[rix_to_ndx(mi, mi->lowest_rix)];
--	mi->sp_ack_dur = mr_ctl->ack_time;
-+	ctl_rate = &sband->bitrates[mi->lowest_rix];
-+	mi->sp_ack_dur = ieee80211_frame_duration(local, 10, ctl_rate->bitrate,
-+				!!(ctl_rate->flags & IEEE80211_RATE_ERP_G), 1);
- 
- 	for (i = 0; i < sband->n_bitrates; i++) {
- 		struct minstrel_rate *mr = &mi->r[n];
-@@ -410,7 +412,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
- 
- 		mr->rix = i;
- 		mr->bitrate = sband->bitrates[i].bitrate / 5;
--		calc_rate_durations(mi, hw_to_local(mp->hw), mr,
-+		calc_rate_durations(mi, local, mr,
- 				&sband->bitrates[i]);
- 
- 		/* calculate maximum number of retransmissions before
 diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
 index 1460537..e24ae1b 100644
 --- a/net/mac80211/tx.c
@@ -25486,20 +25325,6 @@
  	id->vendor = TO_NATIVE(id->vendor);
  	id->product = TO_NATIVE(id->product);
  
-diff --git a/security/device_cgroup.c b/security/device_cgroup.c
-index 5ba7870..df9d491 100644
---- a/security/device_cgroup.c
-+++ b/security/device_cgroup.c
-@@ -513,6 +513,9 @@ int devcgroup_inode_mknod(int mode, dev_t dev)
- 	struct dev_cgroup *dev_cgroup;
- 	struct dev_whitelist_item *wh;
- 
-+	if (!S_ISBLK(mode) && !S_ISCHR(mode))
-+		return 0;
-+
- 	rcu_read_lock();
- 
- 	dev_cgroup = task_devcgroup(current);
 diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
 index acc9c89..3c0f421 100644
 --- a/security/keys/keyctl.c
