Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 1034

kernel-2.6.18-238.el5.src.rpm

From: Josef Bacik <jbacik@redhat.com>
Date: Tue, 10 Feb 2009 13:49:37 -0500
Subject: [fs] fix __page_symlink to be kabi friendly
Message-id: 1234291777-15344-25-git-send-email-jbacik@redhat.com
O-Subject: [PATCH 24/24] [RHEL 5.4] fs: fix __page_symlink to be kabi friendly
Bugzilla: 445433
RH-Acked-by: Steven Whitehouse <swhiteho@redhat.com>
RH-Acked-by: Jeff Layton <jlayton@redhat.com>

This patch is for bz 445433.  It just changes __page_symlink to be kabi
friendly, since a previous patch changed it arguments.  This changes it back to
take a gfp_t, and then if it doesn't have __GFP_FS set then we use
AOP_FLAG_NOFS.

Signed-off-by: Josef Bacik <jbacik@redhat.com>

diff --git a/fs/namei.c b/fs/namei.c
index f9d5904..6ec2513 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2689,7 +2689,8 @@ void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
 /*
  * The nofs argument instructs pagecache_write_begin to pass AOP_FLAG_NOFS
  */
-int __page_symlink(struct inode *inode, const char *symname, int len, int nofs)
+int __page_symlink(struct inode *inode, const char *symname, int len,
+		gfp_t gfp_mask)
 {
 	struct address_space *mapping = inode->i_mapping;
 	struct page *page;
@@ -2697,7 +2698,7 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs)
 	int err;
 	char *kaddr;
 	unsigned int flags = AOP_FLAG_UNINTERRUPTIBLE;
-	if (nofs)
+	if (!(gfp_mask & __GFP_FS))
 		flags |= AOP_FLAG_NOFS;
 
 retry:
@@ -2726,7 +2727,7 @@ fail:
 int page_symlink(struct inode *inode, const char *symname, int len)
 {
 	return __page_symlink(inode, symname, len,
-			!(mapping_gfp_mask(inode->i_mapping) & __GFP_FS));
+			mapping_gfp_mask(inode->i_mapping));
 }
 
 struct inode_operations page_symlink_inode_operations = {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6a2fa23..2c336cf 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1966,7 +1966,7 @@ extern int page_readlink(struct dentry *, char __user *, int);
 extern void *page_follow_link_light(struct dentry *, struct nameidata *);
 extern void page_put_link(struct dentry *, struct nameidata *, void *);
 extern int __page_symlink(struct inode *inode, const char *symname, int len,
-		int nofs);
+		gfp_t gfp_mask);
 extern int page_symlink(struct inode *inode, const char *symname, int len);
 extern struct inode_operations page_symlink_inode_operations;
 extern int generic_readlink(struct dentry *, char __user *, int);