Adjust reiser4 for 3.19: ->f_dentry is gone, use file_inode() instead of ->f_dentry->d_inode.
PATCH v2 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.1
PATCH v2 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.1
PATCH v2 3/3 Adjust reiser4 for 3.19: rip out all quota-related code.
In reply to Ivan ShapovalovUpstream commit 75cbe701a4251fcd8b846d52ae42f88c9a8e5e93 "vfs: Remove i_dquot field from inode".
While we do not actually support quotas, we take the opportunity to (revertibly) remove all rudimentary quota-related code, as this allows to save us some (tiny) amount of space per each inode.
---
The two commits which re-add/forward port the removed code can be pulled from:
git://github.com/intelfx/linux reiser4-3.19-quotas-rudimentary
Viewable at:
https://github.com/intelfx/linux/tree/reiser4-3.19-quotas-rudimentary
fs/reiser4/as_ops.c | 1 - fs/reiser4/inode.h | 11 +++++++++++ fs/reiser4/plugin/file_plugin_common.c | 5 ----- fs/reiser4/plugin/inode_ops.c | 30 ------------------------------ fs/reiser4/plugin/item/cde.c | 8 ++------ fs/reiser4/plugin/item/extent_file_ops.c | 13 +++---------- fs/reiser4/plugin/item/extent_item_ops.c | 4 +--- fs/reiser4/plugin/item/sde.c | 8 ++------ fs/reiser4/plugin/item/tail.c | 29 ++++++++++------------------- fs/reiser4/vfs_ops.c | 1 - 10 files changed, 29 insertions(+), 81 deletions(-)
fs/reiser4/as_ops.c +0 -1
@@ -41,7 +41,6 @@#include <linux/module.h> #include <linux/writeback.h> #include <linux/backing-dev.h> -#include <linux/quotaops.h> #include <linux/security.h> #include <linux/migrate.h>
fs/reiser4/inode.h +11 -0
@@ -455,6 +455,17 @@ extern void inode_check_scale_nolock(struct inode *inode, __u64 old, __u64 new); }) +static inline void inode_add_blocks (struct inode *inode,__u64 blocks) +{ +inode_add_bytes (inode, blocks << inode->i_blkbits); +} + +static inline void inode_sub_blocks (struct inode *inode,__u64 blocks) +{ +inode_sub_bytes (inode, blocks << inode->i_blkbits); +} + +/* See comment before reiser4_readdir_common() for description. */ static inline struct list_head *get_readdir_list (const struct inode *inode) {
fs/reiser4/plugin/file_plugin_common.c +0 -5
@@ -9,8 +9,6 @@#include "object.h" #include "../safe_link.h" -#include <linux/quotaops.h> -static int insert_new_sd (struct inode *inode);static int update_sd (struct inode *inode);
@@ -945,9 +943,6 @@ common_object_delete_no_reserve(struct inode *inode/* object to remove */)if (!reiser4_inode_get_flag (inode,REISER4_NO_SD )) {reiser4_key sd_key; -dquot_free_inode (inode); -dquot_drop (inode); -build_sd_key (inode, &sd_key); result = reiser4_cut_tree(reiser4_tree_by_inode(inode),
fs/reiser4/plugin/inode_ops.c +0 -30
@@ -10,7 +10,6 @@#include "../inode.h" #include "../safe_link.h" -#include <linux/quotaops.h> #include <linux/namei.h> static int create_vfs_object(struct inode *parent, struct dentry *dentry,
@@ -462,15 +461,6 @@ int reiser4_setattr_common(struct dentry *dentry, struct iattr *attr)*/ result =setattr_reserve (reiser4_tree_by_inode (inode));if (!result) { -if (((attr->ia_valid &ATTR_UID ) && !uid_eq (attr->ia_uid, inode->i_uid)) - || ((attr->ia_valid &ATTR_GID ) && !gid_eq (attr->ia_gid, inode->i_gid))) { - result =dquot_transfer (inode, attr) ? -EDQUOT :0 ; -if (result) { -context_set_commit_async (ctx); -reiser4_exit_context (ctx); -return result; - } - }setattr_copy (inode, attr);mark_inode_dirty (inode); result =reiser4_update_sd (inode);
@@ -601,12 +591,6 @@ static int do_create_vfs_child(reiser4_object_create_data * data,/* parameters/* So that on error iput will be called. */ *retobj = object; -if (dquot_alloc_inode (object)) { -dquot_drop (object); - object->i_flags |=S_NOQUOTA ; -return RETERR (-EDQUOT ); - } -memset (&entry,0 ,sizeof entry); entry.obj = object;
@@ -616,8 +600,6 @@ static int do_create_vfs_child(reiser4_object_create_data * data,/* parametersif (result) {warning ("nikita-431" ,"Cannot install plugin %i on %llx" , data->id, (unsigned long long )get_inode_oid (object)); -dquot_free_inode (object); - object->i_flags |=S_NOQUOTA ;return result; }
@@ -625,8 +607,6 @@ static int do_create_vfs_child(reiser4_object_create_data * data,/* parameters obj_plug =inode_file_plugin (object);if (obj_plug->create_object ==NULL ) { -dquot_free_inode (object); - object->i_flags |=S_NOQUOTA ;return RETERR (-EPERM ); }
@@ -644,8 +624,6 @@ static int do_create_vfs_child(reiser4_object_create_data * data,/* parameterswarning ("nikita-432" ,"Cannot inherit from %llx to %llx" , (unsigned long long )get_inode_oid (parent), (unsigned long long )get_inode_oid (object)); -dquot_free_inode (object); - object->i_flags |=S_NOQUOTA ;return result; }
@@ -660,8 +638,6 @@ static int do_create_vfs_child(reiser4_object_create_data * data,/* parameters/* obtain directory plugin (if any) for new object. */ obj_dir =inode_dir_plugin (object);if (obj_dir !=NULL && obj_dir->init ==NULL ) { -dquot_free_inode (object); - object->i_flags |=S_NOQUOTA ;return RETERR (-EPERM ); }
@@ -669,8 +645,6 @@ static int do_create_vfs_child(reiser4_object_create_data * data,/* parameters reserve =estimate_create_vfs_object (parent, object);if (reiser4_grab_space (reserve,BA_CAN_COMMIT )) { -dquot_free_inode (object); - object->i_flags |=S_NOQUOTA ;return RETERR (-ENOSPC ); }
@@ -700,8 +674,6 @@ static int do_create_vfs_child(reiser4_object_create_data * data,/* parameterswarning ("nikita-2219" ,"Failed to create sd for %llu" , (unsigned long long )get_inode_oid (object)); -dquot_free_inode (object); - object->i_flags |=S_NOQUOTA ;return result; }
@@ -737,8 +709,6 @@ static int do_create_vfs_child(reiser4_object_create_data * data,/* parameters*/ reiser4_update_sd (object);if (result !=0 ) { -dquot_free_inode (object); - object->i_flags |=S_NOQUOTA ;/* if everything was ok (result == 0), parent stat-data is * already updated above (update_parent_dir()) */ reiser4_update_sd (parent);
fs/reiser4/plugin/item/cde.c +2 -6
@@ -70,7 +70,6 @@#include <linux/fs.h> /* for struct inode */ #include <linux/dcache.h> /* for struct dentry */ -#include <linux/quotaops.h> #if 0 #define CHECKME (coord) \
@@ -931,9 +930,7 @@ int add_entry_cde(struct inode *dir /* directory object */ , result =is_dot_key (&dir_entry->key); data.length =estimate_cde (result ? coord :NULL , &data); -/* NOTE-NIKITA quota plugin? */ -if (dquot_alloc_space_nodirty (dir,cde_bytes (result, &data))) -return RETERR (-EDQUOT ); +inode_add_bytes (dir,cde_bytes (result, &data));if (result) result =insert_by_coord (coord, &data, &dir_entry->key, lh,0 );
@@ -982,8 +979,7 @@ int rem_entry_cde(struct inode *dir /* directory of item */ , result =kill_node_content (coord, &shadow,NULL ,NULL ,NULL ,NULL ,NULL ,0 );if (result ==0 ) { -/* NOTE-NIKITA quota plugin? */ -dquot_free_space_nodirty (dir, length); +inode_sub_bytes (dir, length); }return result; }
fs/reiser4/plugin/item/extent_file_ops.c +3 -10
@@ -5,7 +5,6 @@#include "../../page_cache.h" #include "../object.h" -#include <linux/quotaops.h> #include <linux/swap.h> static inline reiser4_extent *ext_by_offset (const znode *node,int offset)
@@ -260,9 +259,7 @@ static int append_last_extent(uf_coord_t *uf_coord, const reiser4_key *key,assert ("" ,get_key_offset (key) == (loff_t )index_jnode (jnodes[0 ]) *PAGE_CACHE_SIZE ); - result =dquot_alloc_block_nodirty (mapping_jnode (jnodes[0 ])->host, - count); -BUG_ON (result !=0 ); +inode_add_blocks (mapping_jnode (jnodes[0 ])->host, count);switch (state_of_extent (ext)) {case UNALLOCATED_EXTENT :
@@ -408,9 +405,7 @@ static int insert_first_extent(uf_coord_t *uf_coord, const reiser4_key *key,if (count ==0 )return 0 ; - result =dquot_alloc_block_nodirty (mapping_jnode (jnodes[0 ])->host, - count); -BUG_ON (result !=0 ); +inode_add_blocks (mapping_jnode (jnodes[0 ])->host, count);/* * prepare for tree modification: compose body of item and item data
@@ -623,9 +618,7 @@ static int overwrite_one_block(uf_coord_t *uf_coord, const reiser4_key *key,break ;case HOLE_EXTENT : - result =dquot_alloc_block_nodirty (mapping_jnode (node)->host, -1 ); -BUG_ON (result !=0 ); +inode_add_blocks (mapping_jnode (node)->host,1 ); result =plug_hole (uf_coord, key, &how);if (result)return result;
fs/reiser4/plugin/item/extent_item_ops.c +1 -3
@@ -6,8 +6,6 @@#include "../../page_cache.h" #include "../../carry.h" -#include <linux/quotaops.h> -/* item_plugin->b.max_key_inside */ reiser4_key *max_key_inside_extent (const coord_t * coord,reiser4_key * key) {
@@ -468,7 +466,7 @@ kill_hook_extent(const coord_t * coord, pos_in_node_t from, pos_in_node_t count, length = to_off - offset; } -dquot_free_block_nodirty (inode, length); +inode_sub_blocks (inode, length);if (state_of_extent (ext) ==UNALLOCATED_EXTENT ) {/* some jnodes corresponding to this unallocated extent */
fs/reiser4/plugin/item/sde.c +2 -6
@@ -16,7 +16,6 @@#include <linux/fs.h> /* for struct inode */ #include <linux/dcache.h> /* for struct dentry */ -#include <linux/quotaops.h> /* ->extract_key() method of simple directory item plugin. */ int extract_key_de(const coord_t * coord /* coord of item */ ,
@@ -119,9 +118,7 @@ int add_entry_de(struct inode *dir /* directory of item */ , data.user =0 ; data.iplug =item_plugin_by_id (SIMPLE_DIR_ENTRY_ID ); -/* NOTE-NIKITA quota plugin */ -if (dquot_alloc_space_nodirty (dir, data.length)) -return -EDQUOT ; +inode_add_bytes (dir, data.length); result =insert_by_coord (coord, &data, &entry->key, lh,0 /*flags */ );if (result !=0 )
@@ -167,8 +164,7 @@ int rem_entry_de(struct inode *dir /* directory of item */ , result =kill_node_content (coord, &shadow,NULL ,NULL ,NULL ,NULL ,NULL ,0 );if (result ==0 ) { -/* NOTE-NIKITA quota plugin */ -dquot_free_space_nodirty (dir, length); +inode_sub_bytes (dir, length); }return result; }
fs/reiser4/plugin/item/tail.c +10 -19
@@ -6,7 +6,6 @@#include "../../carry.h" #include "../../vfs_ops.h" -#include <linux/quotaops.h> #include <asm/uaccess.h> #include <linux/swap.h> #include <linux/writeback.h>
@@ -494,14 +493,12 @@ static ssize_t insert_first_tail(struct inode *inode, flow_t *flow,set_key_offset (&flow->key,0 );/* * holes in files built of tails are stored just like if there -* were real data which are all zeros. Therefore we have to -* allocate quota here as well +* were real data which are all zeros. */ -if (dquot_alloc_space_nodirty (inode, flow->length)) -return RETERR (-EDQUOT ); +inode_add_bytes (inode, flow->length); result =reiser4_insert_flow (coord, lh, flow);if (flow->length) -dquot_free_space_nodirty (inode, flow->length); +inode_sub_bytes (inode, flow->length); uf_info =unix_file_inode_data (inode);
@@ -520,14 +517,12 @@ static ssize_t insert_first_tail(struct inode *inode, flow_t *flow,return result; } -/* check quota before appending data */ -if (dquot_alloc_space_nodirty (inode, flow->length)) -return RETERR (-EDQUOT ); +inode_add_bytes (inode, flow->length); to_write = flow->length; result =reiser4_insert_flow (coord, lh, flow);if (flow->length) -dquot_free_space_nodirty (inode, flow->length); +inode_sub_bytes (inode, flow->length);return (to_write - flow->length) ? (to_write - flow->length) : result; }
@@ -553,25 +548,21 @@ static ssize_t append_tail(struct inode *inode,set_key_offset (&flow->key,get_key_offset (&append_key));/* * holes in files built of tails are stored just like if there -* were real data which are all zeros. Therefore we have to -* allocate quota here as well +* were real data which are all zeros. */ -if (dquot_alloc_space_nodirty (inode, flow->length)) -return RETERR (-EDQUOT ); +inode_add_bytes (inode, flow->length); result =reiser4_insert_flow (coord, lh, flow);if (flow->length) -dquot_free_space_nodirty (inode, flow->length); +inode_sub_bytes (inode, flow->length);return result; } -/* check quota before appending data */ -if (dquot_alloc_space_nodirty (inode, flow->length)) -return RETERR (-EDQUOT ); +inode_add_bytes (inode, flow->length); to_write = flow->length; result =reiser4_insert_flow (coord, lh, flow);if (flow->length) -dquot_free_space_nodirty (inode, flow->length); +inode_sub_bytes (inode, flow->length);return (to_write - flow->length) ? (to_write - flow->length) : result; }
fs/reiser4/vfs_ops.c +0 -1
@@ -46,7 +46,6 @@#include <linux/module.h> #include <linux/writeback.h> #include <linux/blkdev.h> -#include <linux/quotaops.h> #include <linux/security.h> #include <linux/reboot.h> #include <linux/rcupdate.h>
Signature · 1 line
2.3.1