Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157130
b: refs/heads/master
c: 9886e83
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Aug 27, 2009
1 parent 448b719 commit d6cf325
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e23502cc57cef33455ac7cb9111e3c6d991a894
refs/heads/master: 9886e836a6a5dbd273dc55b17e713f0a188d137f
18 changes: 15 additions & 3 deletions trunk/fs/afs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,16 @@ static int afs_readpage(struct file *file, struct page *page)

inode = page->mapping->host;

ASSERT(file != NULL);
key = file->private_data;
ASSERT(key != NULL);
if (file) {
key = file->private_data;
ASSERT(key != NULL);
} else {
key = afs_request_key(AFS_FS_S(inode->i_sb)->volume->cell);
if (IS_ERR(key)) {
ret = PTR_ERR(key);
goto error_nokey;
}
}

_enter("{%x},{%lu},{%lu}", key_serial(key), inode->i_ino, page->index);

Expand Down Expand Up @@ -207,12 +214,17 @@ static int afs_readpage(struct file *file, struct page *page)
unlock_page(page);
}

if (!file)
key_put(key);
_leave(" = 0");
return 0;

error:
SetPageError(page);
unlock_page(page);
if (!file)
key_put(key);
error_nokey:
_leave(" = %d", ret);
return ret;
}
Expand Down

0 comments on commit d6cf325

Please sign in to comment.