summaryrefslogtreecommitdiff
path: root/fs/sysv
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysv')
-rw-r--r--fs/sysv/dir.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index 16730795a621..0edd18e1d376 100644
--- a/fs/sysv/dir.c
+++ b/fs/sysv/dir.c
@@ -211,8 +211,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
return -EINVAL;
got_it:
- pos = page_offset(page) +
- (char*)de - (char*)page_address(page);
+ pos = page_offset(page) + offset_in_page(de);
lock_page(page);
err = sysv_prepare_chunk(page, pos, SYSV_DIRSIZE);
if (err)
@@ -236,8 +235,7 @@ out_unlock:
int sysv_delete_entry(struct sysv_dir_entry *de, struct page *page)
{
struct inode *inode = page->mapping->host;
- char *kaddr = (char*)page_address(page);
- loff_t pos = page_offset(page) + (char *)de - kaddr;
+ loff_t pos = page_offset(page) + offset_in_page(de);
int err;
lock_page(page);
@@ -335,8 +333,7 @@ void sysv_set_link(struct sysv_dir_entry *de, struct page *page,
struct inode *inode)
{
struct inode *dir = page->mapping->host;
- loff_t pos = page_offset(page) +
- (char *)de-(char*)page_address(page);
+ loff_t pos = page_offset(page) + offset_in_page(de);
int err;
lock_page(page);