Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201715
b: refs/heads/master
c: 9dc0655
h: refs/heads/master
i:
  201713: ff1088d
  201711: 4c33f31
v: v3
  • Loading branch information
Suresh Jayaraman authored and Steve French committed Aug 2, 2010
1 parent f3400e7 commit 2b674d0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85f2d6b44d7e83bdeab87df910127c6f296866cf
refs/heads/master: 9dc06558c223bbc08290917ac44c25963bc09e43
7 changes: 7 additions & 0 deletions trunk/fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1944,6 +1944,9 @@ static void cifs_copy_cache_pages(struct address_space *mapping,
SetPageUptodate(page);
unlock_page(page);
data += PAGE_CACHE_SIZE;

/* add page to FS-Cache */
cifs_readpage_to_fscache(mapping->host, page);
}
return;
}
Expand Down Expand Up @@ -2113,6 +2116,10 @@ static int cifs_readpage_worker(struct file *file, struct page *page,

flush_dcache_page(page);
SetPageUptodate(page);

/* send this page to the cache */
cifs_readpage_to_fscache(file->f_path.dentry->d_inode, page);

rc = 0;

io_error:
Expand Down
11 changes: 11 additions & 0 deletions trunk/fs/cifs/fscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ int cifs_fscache_release_page(struct page *page, gfp_t gfp)
return 1;
}

void __cifs_readpage_to_fscache(struct inode *inode, struct page *page)
{
int ret;

cFYI(1, "CIFS: readpage_to_fscache(fsc: %p, p: %p, i: %p",
CIFS_I(inode)->fscache, page, inode);
ret = fscache_write_page(CIFS_I(inode)->fscache, page, GFP_KERNEL);
if (ret != 0)
fscache_uncache_page(CIFS_I(inode)->fscache, page);
}

void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode)
{
struct cifsInodeInfo *cifsi = CIFS_I(inode);
Expand Down
11 changes: 11 additions & 0 deletions trunk/fs/cifs/fscache.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,22 @@ extern void cifs_fscache_reset_inode_cookie(struct inode *);
extern void __cifs_fscache_invalidate_page(struct page *, struct inode *);
extern int cifs_fscache_release_page(struct page *page, gfp_t gfp);

extern void __cifs_readpage_to_fscache(struct inode *, struct page *);

static inline void cifs_fscache_invalidate_page(struct page *page,
struct inode *inode)
{
if (PageFsCache(page))
__cifs_fscache_invalidate_page(page, inode);
}

static inline void cifs_readpage_to_fscache(struct inode *inode,
struct page *page)
{
if (PageFsCache(page))
__cifs_readpage_to_fscache(inode, page);
}

#else /* CONFIG_CIFS_FSCACHE */
static inline int cifs_fscache_register(void) { return 0; }
static inline void cifs_fscache_unregister(void) {}
Expand All @@ -81,6 +90,8 @@ static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp)

static inline int cifs_fscache_invalidate_page(struct page *page,
struct inode *) {}
static inline void cifs_readpage_to_fscache(struct inode *inode,
struct page *page) {}

#endif /* CONFIG_CIFS_FSCACHE */

Expand Down

0 comments on commit 2b674d0

Please sign in to comment.