@@ -87,7 +87,7 @@ static int caching_kthread(void *data)
8787 */
8888 btrfs_item_key_to_cpu (leaf , & key , 0 );
8989 btrfs_release_path (path );
90- root -> cache_progress = last ;
90+ root -> ino_cache_progress = last ;
9191 up_read (& fs_info -> commit_root_sem );
9292 schedule_timeout (1 );
9393 goto again ;
@@ -106,7 +106,7 @@ static int caching_kthread(void *data)
106106 if (last != (u64 )- 1 && last + 1 != key .objectid ) {
107107 __btrfs_add_free_space (ctl , last + 1 ,
108108 key .objectid - last - 1 );
109- wake_up (& root -> cache_wait );
109+ wake_up (& root -> ino_cache_wait );
110110 }
111111
112112 last = key .objectid ;
@@ -119,14 +119,14 @@ static int caching_kthread(void *data)
119119 root -> highest_objectid - last - 1 );
120120 }
121121
122- spin_lock (& root -> cache_lock );
123- root -> cached = BTRFS_CACHE_FINISHED ;
124- spin_unlock (& root -> cache_lock );
122+ spin_lock (& root -> ino_cache_lock );
123+ root -> ino_cache_state = BTRFS_CACHE_FINISHED ;
124+ spin_unlock (& root -> ino_cache_lock );
125125
126- root -> cache_progress = (u64 )- 1 ;
126+ root -> ino_cache_progress = (u64 )- 1 ;
127127 btrfs_unpin_free_ino (root );
128128out :
129- wake_up (& root -> cache_wait );
129+ wake_up (& root -> ino_cache_wait );
130130 up_read (& fs_info -> commit_root_sem );
131131
132132 btrfs_free_path (path );
@@ -144,20 +144,20 @@ static void start_caching(struct btrfs_root *root)
144144 if (!btrfs_test_opt (root , INODE_MAP_CACHE ))
145145 return ;
146146
147- spin_lock (& root -> cache_lock );
148- if (root -> cached != BTRFS_CACHE_NO ) {
149- spin_unlock (& root -> cache_lock );
147+ spin_lock (& root -> ino_cache_lock );
148+ if (root -> ino_cache_state != BTRFS_CACHE_NO ) {
149+ spin_unlock (& root -> ino_cache_lock );
150150 return ;
151151 }
152152
153- root -> cached = BTRFS_CACHE_STARTED ;
154- spin_unlock (& root -> cache_lock );
153+ root -> ino_cache_state = BTRFS_CACHE_STARTED ;
154+ spin_unlock (& root -> ino_cache_lock );
155155
156156 ret = load_free_ino_cache (root -> fs_info , root );
157157 if (ret == 1 ) {
158- spin_lock (& root -> cache_lock );
159- root -> cached = BTRFS_CACHE_FINISHED ;
160- spin_unlock (& root -> cache_lock );
158+ spin_lock (& root -> ino_cache_lock );
159+ root -> ino_cache_state = BTRFS_CACHE_FINISHED ;
160+ spin_unlock (& root -> ino_cache_lock );
161161 return ;
162162 }
163163
@@ -196,11 +196,11 @@ int btrfs_find_free_ino(struct btrfs_root *root, u64 *objectid)
196196
197197 start_caching (root );
198198
199- wait_event (root -> cache_wait ,
200- root -> cached == BTRFS_CACHE_FINISHED ||
199+ wait_event (root -> ino_cache_wait ,
200+ root -> ino_cache_state == BTRFS_CACHE_FINISHED ||
201201 root -> free_ino_ctl -> free_space > 0 );
202202
203- if (root -> cached == BTRFS_CACHE_FINISHED &&
203+ if (root -> ino_cache_state == BTRFS_CACHE_FINISHED &&
204204 root -> free_ino_ctl -> free_space == 0 )
205205 return - ENOSPC ;
206206 else
@@ -214,17 +214,17 @@ void btrfs_return_ino(struct btrfs_root *root, u64 objectid)
214214 if (!btrfs_test_opt (root , INODE_MAP_CACHE ))
215215 return ;
216216again :
217- if (root -> cached == BTRFS_CACHE_FINISHED ) {
217+ if (root -> ino_cache_state == BTRFS_CACHE_FINISHED ) {
218218 __btrfs_add_free_space (pinned , objectid , 1 );
219219 } else {
220220 down_write (& root -> fs_info -> commit_root_sem );
221- spin_lock (& root -> cache_lock );
222- if (root -> cached == BTRFS_CACHE_FINISHED ) {
223- spin_unlock (& root -> cache_lock );
221+ spin_lock (& root -> ino_cache_lock );
222+ if (root -> ino_cache_state == BTRFS_CACHE_FINISHED ) {
223+ spin_unlock (& root -> ino_cache_lock );
224224 up_write (& root -> fs_info -> commit_root_sem );
225225 goto again ;
226226 }
227- spin_unlock (& root -> cache_lock );
227+ spin_unlock (& root -> ino_cache_lock );
228228
229229 start_caching (root );
230230
@@ -235,10 +235,10 @@ void btrfs_return_ino(struct btrfs_root *root, u64 objectid)
235235}
236236
237237/*
238- * When a transaction is committed, we'll move those inode numbers which
239- * are smaller than root->cache_progress from pinned tree to free_ino tree,
240- * and others will just be dropped, because the commit root we were
241- * searching has changed.
238+ * When a transaction is committed, we'll move those inode numbers which are
239+ * smaller than root->ino_cache_progress from pinned tree to free_ino tree, and
240+ * others will just be dropped, because the commit root we were searching has
241+ * changed.
242242 *
243243 * Must be called with root->fs_info->commit_root_sem held
244244 */
@@ -261,10 +261,10 @@ void btrfs_unpin_free_ino(struct btrfs_root *root)
261261 info = rb_entry (n , struct btrfs_free_space , offset_index );
262262 BUG_ON (info -> bitmap ); /* Logic error */
263263
264- if (info -> offset > root -> cache_progress )
264+ if (info -> offset > root -> ino_cache_progress )
265265 goto free ;
266- else if (info -> offset + info -> bytes > root -> cache_progress )
267- count = root -> cache_progress - info -> offset + 1 ;
266+ else if (info -> offset + info -> bytes > root -> ino_cache_progress )
267+ count = root -> ino_cache_progress - info -> offset + 1 ;
268268 else
269269 count = info -> bytes ;
270270
@@ -462,13 +462,13 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
462462 }
463463 }
464464
465- spin_lock (& root -> cache_lock );
466- if (root -> cached != BTRFS_CACHE_FINISHED ) {
465+ spin_lock (& root -> ino_cache_lock );
466+ if (root -> ino_cache_state != BTRFS_CACHE_FINISHED ) {
467467 ret = -1 ;
468- spin_unlock (& root -> cache_lock );
468+ spin_unlock (& root -> ino_cache_lock );
469469 goto out_put ;
470470 }
471- spin_unlock (& root -> cache_lock );
471+ spin_unlock (& root -> ino_cache_lock );
472472
473473 spin_lock (& ctl -> tree_lock );
474474 prealloc = sizeof (struct btrfs_free_space ) * ctl -> free_extents ;
0 commit comments