Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8803863a9051582081fb2bcca3a6dc8fddaed93c Commit: 8803863a9051582081fb2bcca3a6dc8fddaed93c Parent: 4a379e6657ae2dd910f9f06d46bd7c05fbe9ed5c Author: Nate <[EMAIL PROTECTED]> AuthorDate: Mon Jul 16 15:45:13 2007 +0000 Committer: Steve French <[EMAIL PROTECTED]> CommitDate: Mon Jul 16 15:45:13 2007 +0000
[CIFS] use simple_prepare_write to zero page data It's common for file systems to need to zero data on either side of a write, if a page is not Uptodate during prepare_write. It just so happens that simple_prepare_write() in libfs.c does exactly that, so we can avoid duplication and just call that function to zero page data. Signed-off-by: Nate Diller <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Steve French <[EMAIL PROTECTED]> --- fs/cifs/file.c | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index b67f1da..0620fea 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1966,14 +1966,7 @@ static int cifs_prepare_write(struct file *file, struct page *page, * We don't need to read data beyond the end of the file. * zero it, and set the page uptodate */ - void *kaddr = kmap_atomic(page, KM_USER0); - - if (from) - memset(kaddr, 0, from); - if (to < PAGE_CACHE_SIZE) - memset(kaddr + to, 0, PAGE_CACHE_SIZE - to); - flush_dcache_page(page); - kunmap_atomic(kaddr, KM_USER0); + simple_prepare_write(file, page, from, to); SetPageUptodate(page); } else if ((file->f_flags & O_ACCMODE) != O_WRONLY) { /* might as well read a page, it is fast enough */ - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html