switch dentry_open() to struct path, make it grab references itself

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2012-06-26 21:58:53 +04:00
parent bf349a4470
commit 765927b2d5
15 changed files with 106 additions and 151 deletions

View File

@@ -891,6 +891,7 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
struct cachefiles_cache *cache;
mm_segment_t old_fs;
struct file *file;
struct path path;
loff_t pos, eof;
size_t len;
void *data;
@@ -916,10 +917,9 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
/* write the page to the backing filesystem and let it store it in its
* own time */
dget(object->backer);
mntget(cache->mnt);
file = dentry_open(object->backer, cache->mnt, O_RDWR,
cache->cache_cred);
path.mnt = cache->mnt;
path.dentry = object->backer;
file = dentry_open(&path, O_RDWR, cache->cache_cred);
if (IS_ERR(file)) {
ret = PTR_ERR(file);
} else {