@@ -574,8 +574,6 @@ static int orangefs_file_mmap(struct file *file, struct vm_area_struct *vma)
return 0;
}
-#define mapping_nrpages(idata) ((idata)->nrpages)
-
/*
* Called to notify the module that there are no more references to
* this file (i.e. no processes have it open).
@@ -595,7 +593,7 @@ static int orangefs_file_release(struct inode *inode, struct file *file)
*/
if (file_inode(file) &&
file_inode(file)->i_mapping &&
- mapping_nrpages(&file_inode(file)->i_data)) {
+ file_inode(file)->i_mapping->nrpages) {
if (orangefs_features & ORANGEFS_FEATURE_READAHEAD) {
gossip_debug(GOSSIP_INODE_DEBUG,
"calling flush_racache on %pU\n",
@@ -330,6 +330,8 @@ static int orangefs_symlink(struct inode *dir,
"Assigned symlink inode new number of %pU\n",
get_khandle_from_ino(inode));
+ inode->i_size = strlen(symname);
+
d_instantiate(dentry, inode);
unlock_new_inode(inode);
orangefs_set_timeout(dentry);
@@ -398,6 +400,8 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
"Assigned dir inode new number of %pU\n",
get_khandle_from_ino(inode));
+ inode->i_size = PAGE_SIZE;
+
d_instantiate(dentry, inode);
unlock_new_inode(inode);
orangefs_set_timeout(dentry);