- cifs-do-not-overwrite-aops-elements.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     CIFS: Do not overwrite aops elements

has been removed from the -mm tree.  Its filename is

     cifs-do-not-overwrite-aops-elements.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.

------------------------------------------------------
Subject: CIFS: Do not overwrite aops elements
From: Dave Kleikamp <shaggy@xxxxxxxxxxxxxx>


cifs should not be overwriting an element of the aops structure, since the
structure is shared by all cifs inodes.  Instead define a separate aops
structure to suit each purpose.

I also took the liberty of replacing a hard-coded 4096 with PAGE_CACHE_SIZE

Signed-off-by: Dave Kleikamp <shaggy@xxxxxxxxxxxxxx>
Cc: Steven French <sfrench@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/cifs/cifsfs.h  |    1 +
 fs/cifs/file.c    |   16 ++++++++++++++++
 fs/cifs/inode.c   |   14 ++++++++------
 fs/cifs/readdir.c |   16 ++++++++++------
 4 files changed, 35 insertions(+), 12 deletions(-)

diff -puN fs/cifs/cifsfs.h~cifs-do-not-overwrite-aops-elements fs/cifs/cifsfs.h
--- devel/fs/cifs/cifsfs.h~cifs-do-not-overwrite-aops-elements	2006-05-19 15:59:34.000000000 -0700
+++ devel-akpm/fs/cifs/cifsfs.h	2006-05-19 15:59:34.000000000 -0700
@@ -33,6 +33,7 @@
 #endif
 
 extern struct address_space_operations cifs_addr_ops;
+extern struct address_space_operations cifs_addr_ops_smallbuf;
 
 /* Functions related to super block operations */
 extern struct super_operations cifs_super_ops;
diff -puN fs/cifs/file.c~cifs-do-not-overwrite-aops-elements fs/cifs/file.c
--- devel/fs/cifs/file.c~cifs-do-not-overwrite-aops-elements	2006-05-19 15:59:34.000000000 -0700
+++ devel-akpm/fs/cifs/file.c	2006-05-19 15:59:34.000000000 -0700
@@ -1957,3 +1957,19 @@ struct address_space_operations cifs_add
 	/* .sync_page = cifs_sync_page, */
 	/* .direct_IO = */
 };
+
+/*
+ * cifs_readpages requires the server to support a buffer large enough to
+ * contain the header plus one complete page of data.  Otherwise, we need
+ * to leave cifs_readpages out of the address space operations.
+ */
+struct address_space_operations cifs_addr_ops_smallbuf = {
+	.readpage = cifs_readpage,
+	.writepage = cifs_writepage,
+	.writepages = cifs_writepages,
+	.prepare_write = cifs_prepare_write,
+	.commit_write = cifs_commit_write,
+	.set_page_dirty = __set_page_dirty_nobuffers,
+	/* .sync_page = cifs_sync_page, */
+	/* .direct_IO = */
+};
diff -puN fs/cifs/inode.c~cifs-do-not-overwrite-aops-elements fs/cifs/inode.c
--- devel/fs/cifs/inode.c~cifs-do-not-overwrite-aops-elements	2006-05-19 15:59:34.000000000 -0700
+++ devel-akpm/fs/cifs/inode.c	2006-05-19 15:59:34.000000000 -0700
@@ -180,11 +180,12 @@ int cifs_get_inode_info_unix(struct inod
 			else /* not direct, send byte range locks */ 
 				inode->i_fop = &cifs_file_ops;
 
-			inode->i_data.a_ops = &cifs_addr_ops;
 			/* check if server can support readpages */
 			if(pTcon->ses->server->maxBuf < 
-			    4096 + MAX_CIFS_HDR_SIZE)
-				inode->i_data.a_ops->readpages = NULL;
+			    PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE)
+				inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
+			else
+				inode->i_data.a_ops = &cifs_addr_ops;
 		} else if (S_ISDIR(inode->i_mode)) {
 			cFYI(1, ("Directory inode"));
 			inode->i_op = &cifs_dir_inode_ops;
@@ -519,10 +520,11 @@ int cifs_get_inode_info(struct inode **p
 			else /* not direct, send byte range locks */
 				inode->i_fop = &cifs_file_ops;
 
-			inode->i_data.a_ops = &cifs_addr_ops;
 			if(pTcon->ses->server->maxBuf < 
-			     4096 + MAX_CIFS_HDR_SIZE)
-				inode->i_data.a_ops->readpages = NULL;
+			     PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE)
+				inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
+			else
+				inode->i_data.a_ops = &cifs_addr_ops;
 		} else if (S_ISDIR(inode->i_mode)) {
 			cFYI(1, ("Directory inode"));
 			inode->i_op = &cifs_dir_inode_ops;
diff -puN fs/cifs/readdir.c~cifs-do-not-overwrite-aops-elements fs/cifs/readdir.c
--- devel/fs/cifs/readdir.c~cifs-do-not-overwrite-aops-elements	2006-05-19 15:59:34.000000000 -0700
+++ devel-akpm/fs/cifs/readdir.c	2006-05-19 15:59:34.000000000 -0700
@@ -21,6 +21,7 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 #include <linux/fs.h>
+#include <linux/pagemap.h>
 #include <linux/stat.h>
 #include <linux/smp_lock.h>
 #include "cifspdu.h"
@@ -215,11 +216,13 @@ static void fill_in_inode(struct inode *
 		else
 			tmp_inode->i_fop = &cifs_file_ops;
 
-		tmp_inode->i_data.a_ops = &cifs_addr_ops;
 		if((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
 		   (cifs_sb->tcon->ses->server->maxBuf <
-			4096 + MAX_CIFS_HDR_SIZE))
-			tmp_inode->i_data.a_ops->readpages = NULL;
+			PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE))
+			tmp_inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
+		else
+			tmp_inode->i_data.a_ops = &cifs_addr_ops;
+
 		if(isNewInode)
 			return; /* No sense invalidating pages for new inode
 				   since have not started caching readahead file
@@ -338,11 +341,12 @@ static void unix_fill_in_inode(struct in
 		else
 			tmp_inode->i_fop = &cifs_file_ops;
 
-		tmp_inode->i_data.a_ops = &cifs_addr_ops;
 		if((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
 		   (cifs_sb->tcon->ses->server->maxBuf < 
-			4096 + MAX_CIFS_HDR_SIZE))
-			tmp_inode->i_data.a_ops->readpages = NULL;
+			PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE))
+			tmp_inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
+		else
+			tmp_inode->i_data.a_ops = &cifs_addr_ops;
 
 		if(isNewInode)
 			return; /* No sense invalidating pages for new inode since we
_

Patches currently in -mm which might be from shaggy@xxxxxxxxxxxxxx are

origin.patch
git-cifs.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux