Adjust reiser4 for 3.19: ->f_dentry is gone, use file_inode() instead of ->f_dentry->d_inode.
PATCH 1/3 Adjust reiser4 for 3.19: ->f_dentry is gone, use file_inode() instead of ->f_dentry->d_inode.
Upstream commit fb32c76d16aa40f3057f53273ac483a8e2468004 "VFS: Convert file->f_dentry->d_inode to file_inode()".
--- fs/read_write.c | 4 ++-- fs/reiser4/fsdata.c | 10 +++++----- fs/reiser4/plugin/dir_plugin_common.c | 2 +- fs/reiser4/plugin/file/cryptcompress.c | 8 ++++---- fs/reiser4/plugin/file/file.c | 26 +++++++++++++------------- fs/reiser4/plugin/file/file_conversion.c | 12 ++++++------ fs/reiser4/plugin/file/tail_conversion.c | 2 +- fs/reiser4/plugin/file_ops_readdir.c | 10 +++++----- fs/reiser4/plugin/item/ctail.c | 4 ++-- fs/reiser4/plugin/item/extent_file_ops.c | 2 +- 10 files changed, 40 insertions(+), 40 deletions(-)
fs/read_write.c +2 -2
@@ -254,9 +254,9 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin) {loff_t retval; -mutex_lock (&file->f_dentry->d_inode->i_mutex); +mutex_lock (&file_inode (file)->i_mutex); retval =default_llseek_unlocked (file, offset, origin); -mutex_unlock (&file->f_dentry->d_inode->i_mutex); +mutex_unlock (&file_inode (file)->i_mutex);return retval; }EXPORT_SYMBOL (default_llseek);
fs/reiser4/fsdata.c +5 -5
@@ -585,7 +585,7 @@ void reiser4_detach_fsdata(struct file *file)if (!file_is_stateless (file))return ; - inode = file->f_dentry->d_inode; + inode =file_inode (file);spin_lock_inode (inode);clean_fsdata (file);spin_unlock_inode (inode);
@@ -741,7 +741,7 @@ reiser4_file_fsdata *reiser4_get_file_fsdata(struct file *file)if (fsdata ==NULL )return ERR_PTR (RETERR (-ENOMEM )); - inode = file->f_dentry->d_inode; + inode =file_inode (file);spin_lock_inode (inode);if (file->private_data ==NULL ) { file->private_data = fsdata;
@@ -767,7 +767,7 @@ static void free_file_fsdata_nolock(struct file *file) {reiser4_file_fsdata *fsdata; -assert ("" ,spin_inode_is_locked (file->f_dentry->d_inode)); +assert ("" ,spin_inode_is_locked (file_inode (file))); fsdata = file->private_data;if (fsdata !=NULL ) {list_del_init (&fsdata->dir.linkage);
@@ -785,9 +785,9 @@ static void free_file_fsdata_nolock(struct file *file)*/ void reiser4_free_file_fsdata (struct file *file) { -spin_lock_inode (file->f_dentry->d_inode); +spin_lock_inode (file_inode (file));free_file_fsdata_nolock (file); -spin_unlock_inode (file->f_dentry->d_inode); +spin_unlock_inode (file_inode (file)); }/*
fs/reiser4/plugin/dir_plugin_common.c +1 -1
@@ -97,7 +97,7 @@ int build_readdir_key_common(struct file *dir /* directory being read */ ,assert ("nikita-1361" , dir !=NULL );assert ("nikita-1362" , result !=NULL );assert ("nikita-1363" , dir->f_dentry !=NULL ); - inode = dir->f_dentry->d_inode; + inode =file_inode (dir);assert ("nikita-1373" , inode !=NULL ); fdata =reiser4_get_file_fsdata (dir);
fs/reiser4/plugin/file/cryptcompress.c +4 -4
@@ -1263,7 +1263,7 @@ int readpage_cryptcompress(struct file *file, struct page *page) }assert ("edward-113" ,ergo (file !=NULL , - page->mapping == file->f_dentry->d_inode->i_mapping)); + page->mapping ==file_inode (file)->i_mapping));if (PageUptodate (page)) {warning ("edward-1338" ,"page is already uptodate\n" );
@@ -2869,7 +2869,7 @@ ssize_t write_cryptcompress(struct file *file, const char __user *buf,assert ("edward-1449" , cont->state ==DISPATCH_INVAL_STATE ); - inode = file->f_dentry->d_inode; + inode =file_inode (file);assert ("edward-196" ,cryptcompress_inode_ok (inode)); info =cryptcompress_inode_data (inode);
@@ -2949,7 +2949,7 @@ ssize_t read_cryptcompress(struct file * file, char __user *buf, size_t size,struct cryptcompress_info *info;reiser4_block_nr needed; - inode = file->f_dentry->d_inode; + inode =file_inode (file);assert ("edward-1194" , !reiser4_inode_get_flag (inode,REISER4_NO_SD )); ctx =reiser4_init_context (inode->i_sb);
@@ -3692,7 +3692,7 @@ int mmap_cryptcompress(struct file *file, struct vm_area_struct *vma)struct inode *inode;reiser4_context *ctx; - inode = file->f_dentry->d_inode; + inode =file_inode (file); ctx =reiser4_init_context (inode->i_sb);if (IS_ERR (ctx))return PTR_ERR (ctx);
fs/reiser4/plugin/file/file.c +13 -13
@@ -663,12 +663,12 @@ int load_file_hint(struct file *file, hint_t *hint)if (IS_ERR (fsdata))return PTR_ERR (fsdata); -spin_lock_inode (file->f_dentry->d_inode); +spin_lock_inode (file_inode (file));if (reiser4_seal_is_set (&fsdata->reg.hint.seal)) {memcpy (hint, &fsdata->reg.hint,sizeof (*hint));init_lh (&hint->lh); hint->ext_coord.lh = &hint->lh; -spin_unlock_inode (file->f_dentry->d_inode); +spin_unlock_inode (file_inode (file));/* * force re-validation of the coord on the first * iteration of the read/write loop.
@@ -680,7 +680,7 @@ int load_file_hint(struct file *file, hint_t *hint)return 0 ; }memset (&fsdata->reg.hint,0 ,sizeof (hint_t)); -spin_unlock_inode (file->f_dentry->d_inode); +spin_unlock_inode (file_inode (file)); }hint_init_zero (hint);return 0 ;
@@ -707,9 +707,9 @@ void save_file_hint(struct file *file, const hint_t *hint)assert ("nikita-19891" ,coords_equal (&hint->seal.coord1, &hint->ext_coord.coord));assert ("vs-30" , hint->lh.owner ==NULL ); -spin_lock_inode (file->f_dentry->d_inode); +spin_lock_inode (file_inode (file)); fsdata->reg.hint = *hint; -spin_unlock_inode (file->f_dentry->d_inode); +spin_unlock_inode (file_inode (file));return ; }
@@ -1656,7 +1656,7 @@ static ssize_t do_read_compound_file(hint_t *hint, struct file *file,coord_t *coord;znode *loaded; - inode = file->f_dentry->d_inode; + inode =file_inode (file);/* build flow */ assert("vs-1250",
@@ -1726,7 +1726,7 @@ ssize_t read_unix_file(struct file *file, char __user *buf,if (unlikely (read_amount ==0 ))return 0 ; - inode = file->f_dentry->d_inode; + inode =file_inode (file);assert ("vs-972" , !reiser4_inode_get_flag (inode,REISER4_NO_SD )); ctx =reiser4_init_context (inode->i_sb);
@@ -1795,7 +1795,7 @@ static ssize_t read_compound_file(struct file *file, char __user *buf,size_t was_read =0 ;loff_t i_size; - inode = file->f_dentry->d_inode; + inode =file_inode (file);assert ("vs-972" , !reiser4_inode_get_flag (inode,REISER4_NO_SD )); i_size =i_size_read (inode);
@@ -1887,7 +1887,7 @@ int mmap_unix_file(struct file *file, struct vm_area_struct *vma)struct unix_file_info *uf_info;reiser4_block_nr needed; - inode = file->f_dentry->d_inode; + inode =file_inode (file); ctx =reiser4_init_context (inode->i_sb);if (IS_ERR (ctx))return PTR_ERR (ctx);
@@ -2096,7 +2096,7 @@ ssize_t write_unix_file(struct file *file,loff_t new_size; ctx =get_current_context (); - inode = file->f_dentry->d_inode; + inode =file_inode (file);assert ("vs-947" , !reiser4_inode_get_flag (inode,REISER4_NO_SD ));assert ("vs-9471" , (!reiser4_inode_get_flag (inode,REISER4_PART_MIXED )));
@@ -2730,7 +2730,7 @@ int write_begin_unix_file(struct file *file, struct page *page,struct inode * inode;struct unix_file_info *info; - inode = file->f_dentry->d_inode; + inode =file_inode (file); info =unix_file_inode_data (inode); ret = reiser4_grab_space_force(estimate_one_insert_into_item
@@ -2739,7 +2739,7 @@ int write_begin_unix_file(struct file *file, struct page *page,if (ret)return ret;get_exclusive_access (info); - ret =find_file_state (file->f_dentry->d_inode, info); + ret =find_file_state (file_inode (file), info);if (unlikely (ret !=0 )) {drop_exclusive_access (info);return ret;
@@ -2768,7 +2768,7 @@ int write_end_unix_file(struct file *file, struct page *page,struct inode *inode;struct unix_file_info *info; - inode = file->f_dentry->d_inode; + inode =file_inode (file); info =unix_file_inode_data (inode);unlock_page (page);
fs/reiser4/plugin/file/file_conversion.c +6 -6
@@ -524,7 +524,7 @@ ssize_t reiser4_write_dispatch(struct file *file, const char __user *buf,ssize_t written_old =0 ;/* bytes written with initial plugin */ ssize_t written_new =0 ;/* bytes written with new plugin */ struct dispatch_context cont; -struct inode * inode = file->f_dentry->d_inode; +struct inode * inode =file_inode (file); ctx =reiser4_init_context (inode->i_sb);if (IS_ERR (ctx))
@@ -603,20 +603,20 @@ int reiser4_open_dispatch(struct inode *inode, struct file *file)ssize_t reiser4_read_dispatch (struct file * file,char __user * buf,size_t size,loff_t * off) { -struct inode * inode = file->f_dentry->d_inode; +struct inode * inode =file_inode (file);return PROT_PASSIVE (ssize_t, read, (file, buf, size, off)); }long reiser4_ioctl_dispatch (struct file *filp,unsigned int cmd,unsigned long arg) { -struct inode * inode = filp->f_dentry->d_inode; +struct inode * inode =file_inode (filp);return PROT_PASSIVE (int, ioctl, (filp, cmd, arg)); }int reiser4_mmap_dispatch (struct file *file,struct vm_area_struct *vma) { -struct inode *inode = file->f_dentry->d_inode; +struct inode *inode =file_inode (file);return PROT_PASSIVE (int, mmap, (file, vma)); }
@@ -649,7 +649,7 @@ int reiser4_write_begin_dispatch(struct file *file,struct page *page;pgoff_t index;reiser4_context *ctx; -struct inode * inode = file->f_dentry->d_inode; +struct inode * inode =file_inode (file); index = pos >>PAGE_CACHE_SHIFT ; page = grab_cache_page_write_begin(mapping, index,
@@ -658,7 +658,7 @@ int reiser4_write_begin_dispatch(struct file *file,if (!page)return -ENOMEM ; - ctx =reiser4_init_context (file->f_dentry->d_inode->i_sb); + ctx =reiser4_init_context (file_inode (file)->i_sb);if (IS_ERR (ctx)) { ret =PTR_ERR (ctx); goto err2;
fs/reiser4/plugin/file/tail_conversion.c +1 -1
@@ -670,7 +670,7 @@ int extent2tail(struct file * file, struct unix_file_info *uf_info)assert ("edward-1537" , file !=NULL && file->f_dentry !=NULL );assert ("edward-1538" , - file->f_dentry->d_inode == inode); +file_inode (file) == inode); result = reiser4_write_tail_noreserve(file, inode, (char __user *)kmap(page),
fs/reiser4/plugin/file_ops_readdir.c +5 -5
@@ -136,7 +136,7 @@ static int dir_go_to(struct file *dir, struct readdir_pos *pos, tap_t *tap)assert ("nikita-2554" , pos !=NULL ); - inode = dir->f_dentry->d_inode; + inode =file_inode (dir); result =inode_dir_plugin (inode)->build_readdir_key (dir, &key);if (result !=0 )return result;
@@ -232,7 +232,7 @@ static int dir_rewind(struct file *dir, loff_t *fpos, struct readdir_pos *pos, t* to */ destination = pos->entry_no + shift; - inode = dir->f_dentry->d_inode; + inode =file_inode (dir);if (dirpos <0 )return RETERR (-EINVAL );else if (destination ==0ll || dirpos ==0 ) {
@@ -442,7 +442,7 @@ static int dir_readdir_init(struct file *f, loff_t* fpos, tap_t *tap,int result;assert ("nikita-1359" , f !=NULL ); - inode = f->f_dentry->d_inode; + inode =file_inode (f);assert ("nikita-1360" , inode !=NULL );if (!S_ISDIR (inode->i_mode))
@@ -481,7 +481,7 @@ loff_t reiser4_llseek_dir_common(struct file *file, loff_t off, int origin)loff_t result;struct inode *inode; - inode = file->f_dentry->d_inode; + inode =file_inode (file); ctx =reiser4_init_context (inode->i_sb);if (IS_ERR (ctx))
@@ -570,7 +570,7 @@ int reiser4_iterate_common(struct file *f /* directory file being read */,struct readdir_pos *pos;assert ("nikita-1359" , f !=NULL ); - inode = f->f_dentry->d_inode; + inode =file_inode (f);assert ("nikita-1360" , inode !=NULL );if (!S_ISDIR (inode->i_mode))
fs/reiser4/plugin/item/ctail.c +2 -2
@@ -814,7 +814,7 @@ static int ctail_readpages_filler(void * data, struct page * page) {int ret =0 ;struct cluster_handle * clust = data; -struct inode * inode = clust->file->f_dentry->d_inode; +struct inode * inode =file_inode (clust->file);assert ("edward-1525" , page->mapping == inode->i_mapping);
@@ -852,7 +852,7 @@ int readpages_ctail(struct file *file, struct address_space *mapping,struct cluster_handle clust;struct inode *inode = mapping->host; -assert ("edward-1521" , inode == file->f_dentry->d_inode); +assert ("edward-1521" , inode ==file_inode (file));cluster_init_read (&clust,NULL ); clust.file = file;
fs/reiser4/plugin/item/extent_file_ops.c +1 -1
@@ -1224,7 +1224,7 @@ int reiser4_read_extent(struct file *file, flow_t *flow, hint_t *hint)assert ("vs-1120" ,znode_is_loaded (coord->node));assert ("vs-1256" ,coord_matches_key_extent (coord, &flow->key)); - mapping = file->f_dentry->d_inode->i_mapping; + mapping =file_inode (file)->i_mapping; ext_coord = &uf_coord->extension.extent; file_off =get_key_offset (&flow->key);
Signature · 1 line
2.3.0
PATCH 2/3 Adjust reiser4 for 3.19: ->f_dentry is gone, convert remaining uses to an equivalent.
Upstream commit 78d28e651f97866d608d9b41f8ad291e65d47dd5 "kill f_dentry macro".
"f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid it entirely."
Avoiding has been done in the previous commit. This commit blindly replaces the remaining uses with an equivalent f_path.dentry. Probably, these will need to be revisited someday...
--- fs/reiser4/fsdata.c | 2 +- fs/reiser4/plugin/dir_plugin_common.c | 2 +- fs/reiser4/plugin/file/file.c | 2 +- fs/reiser4/plugin/file/tail_conversion.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
fs/reiser4/fsdata.c +1 -1
@@ -489,7 +489,7 @@ void reiser4_kill_cursors(struct inode *inode)*/ static int file_is_stateless (struct file *file) { -return reiser4_get_dentry_fsdata (file->f_dentry)->stateless; +return reiser4_get_dentry_fsdata (file->f_path.dentry)->stateless; }/**
fs/reiser4/plugin/dir_plugin_common.c +1 -1
@@ -96,7 +96,7 @@ int build_readdir_key_common(struct file *dir /* directory being read */ ,assert ("nikita-1361" , dir !=NULL );assert ("nikita-1362" , result !=NULL ); -assert ("nikita-1363" , dir->f_dentry !=NULL ); +assert ("nikita-1363" , dir->f_path.dentry !=NULL ); inode =file_inode (dir);assert ("nikita-1373" , inode !=NULL );
fs/reiser4/plugin/file/file.c +1 -1
@@ -2317,7 +2317,7 @@ int release_unix_file(struct inode *inode, struct file *file) uf_info =unix_file_inode_data (inode);get_exclusive_access_careful (uf_info, inode); -if (file->f_dentry->d_lockref.count ==1 && +if (file->f_path.dentry->d_lockref.count ==1 && uf_info->container ==UF_CONTAINER_EXTENTS && !should_have_notail (uf_info, inode->i_size) && !rofs_inode (inode)) {
fs/reiser4/plugin/file/tail_conversion.c +1 -1
@@ -668,7 +668,7 @@ int extent2tail(struct file * file, struct unix_file_info *uf_info)loff_t pos = start_byte;assert ("edward-1537" , - file !=NULL && file->f_dentry !=NULL ); + file !=NULL && file->f_path.dentry !=NULL );assert ("edward-1538" ,file_inode (file) == inode);
Signature · 1 line
2.3.0
PATCH 3/3 Adjust reiser4 for 3.19: convert to private i_dquot field.
In reply to Ivan ShapovalovUpstream commit 75cbe701a4251fcd8b846d52ae42f88c9a8e5e93 "vfs: Remove i_dquot field from inode".
Example taken from upstream commit 53873638bd7cbcbf43cea72f0eb0d2ee9260f059 "reiserfs: Convert to private i_dquot field".
reiser4 does not support quotas, but there's rudimentary code doing some quota operations, and in order for it not to segfault we need to act like we do support quotas.
---
Hopefully I've done the right thing. Another option would be to simply remove all the quota-related code.
fs/reiser4/inode.h | 4 ++++ fs/reiser4/super_ops.c | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
fs/reiser4/inode.h +4 -0
@@ -154,6 +154,10 @@ struct reiser4_inode {* fs/reiser4/search.c:handle_vroot() */ reiser4_block_nr vroot;struct mutex loading; + +#ifdef CONFIG_QUOTA +struct dquot *i_dquot[MAXQUOTAS ]; +#endif };void loading_init_once (reiser4_inode *);
fs/reiser4/super_ops.c +14 -1
@@ -113,6 +113,9 @@ static struct inode *reiser4_alloc_inode(struct super_block *super)/* this deals with info's loading semaphore */ loading_alloc (info); info->vroot =UBER_TREE_ADDR ; +#ifdef CONFIG_QUOTA +memset (&info->i_dquot,0 ,sizeof (info->i_dquot)); +#endif return &obj->vfs_inode; }else return NULL ;
@@ -477,6 +480,13 @@ static int reiser4_show_options(struct seq_file *m, struct dentry *dentry)return 0 ; } +#ifdef CONFIG_QUOTA +static struct dquot **reiser4_get_dquots (struct inode *inode) +{ +return reiser4_inode_data (inode)->i_dquot; +} +#endif +struct super_operations reiser4_super_operations = { .alloc_inode = reiser4_alloc_inode, .destroy_inode = reiser4_destroy_inode,
@@ -487,7 +497,10 @@ struct super_operations reiser4_super_operations = { .statfs = reiser4_statfs, .remount_fs = reiser4_remount, .writeback_inodes = reiser4_writeback_inodes, - .show_options = reiser4_show_options + .show_options = reiser4_show_options, +#ifdef CONFIG_QUOTA + .get_dquots = reiser4_get_dquots, +#endif };/**
Signature · 1 line
2.3.0