aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-10-20 11:42:44 -0400
committerJan Kara <jack@suse.cz>2011-01-06 11:03:54 -0500
commit49521de119d326d04fb3736ab827e12e1de966d0 (patch)
treea57de8b903d2f6b43b8ec689b617ba2dc333e98e /fs/udf
parentf2a6cc1f146465e13f31d9163d542d1facf4e203 (diff)
udf: Remove BKL from udf_update_inode
udf_update_inode() does not need BKL since on-disk inode modifications are protected by the buffer lock and reading of values of in-memory inode is safe without any lock. In some cases we can write inconsistent inode state to disk but in that case inode will be marked dirty and overwritten later. Also make unnecessarily global udf_sync_inode() static. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/inode.c13
-rw-r--r--fs/udf/udfdecl.h1
2 files changed, 3 insertions, 11 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index fc48f37aa2dd..9656907f4b81 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -51,6 +51,7 @@ MODULE_LICENSE("GPL");
51static mode_t udf_convert_permissions(struct fileEntry *); 51static mode_t udf_convert_permissions(struct fileEntry *);
52static int udf_update_inode(struct inode *, int); 52static int udf_update_inode(struct inode *, int);
53static void udf_fill_inode(struct inode *, struct buffer_head *); 53static void udf_fill_inode(struct inode *, struct buffer_head *);
54static int udf_sync_inode(struct inode *inode);
54static int udf_alloc_i_data(struct inode *inode, size_t size); 55static int udf_alloc_i_data(struct inode *inode, size_t size);
55static struct buffer_head *inode_getblk(struct inode *, sector_t, int *, 56static struct buffer_head *inode_getblk(struct inode *, sector_t, int *,
56 sector_t *, int *); 57 sector_t *, int *);
@@ -79,9 +80,7 @@ void udf_evict_inode(struct inode *inode)
79 want_delete = 1; 80 want_delete = 1;
80 inode->i_size = 0; 81 inode->i_size = 0;
81 udf_truncate(inode); 82 udf_truncate(inode);
82 lock_kernel();
83 udf_update_inode(inode, IS_SYNC(inode)); 83 udf_update_inode(inode, IS_SYNC(inode));
84 unlock_kernel();
85 } 84 }
86 invalidate_inode_buffers(inode); 85 invalidate_inode_buffers(inode);
87 end_writeback(inode); 86 end_writeback(inode);
@@ -1373,16 +1372,10 @@ static mode_t udf_convert_permissions(struct fileEntry *fe)
1373 1372
1374int udf_write_inode(struct inode *inode, struct writeback_control *wbc) 1373int udf_write_inode(struct inode *inode, struct writeback_control *wbc)
1375{ 1374{
1376 int ret; 1375 return udf_update_inode(inode, wbc->sync_mode == WB_SYNC_ALL);
1377
1378 lock_kernel();
1379 ret = udf_update_inode(inode, wbc->sync_mode == WB_SYNC_ALL);
1380 unlock_kernel();
1381
1382 return ret;
1383} 1376}
1384 1377
1385int udf_sync_inode(struct inode *inode) 1378static int udf_sync_inode(struct inode *inode)
1386{ 1379{
1387 return udf_update_inode(inode, 1); 1380 return udf_update_inode(inode, 1);
1388} 1381}
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index 74d58c08ebac..f25e57e8a777 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -135,7 +135,6 @@ extern int udf_write_fi(struct inode *inode, struct fileIdentDesc *,
135extern long udf_ioctl(struct file *, unsigned int, unsigned long); 135extern long udf_ioctl(struct file *, unsigned int, unsigned long);
136/* inode.c */ 136/* inode.c */
137extern struct inode *udf_iget(struct super_block *, struct kernel_lb_addr *); 137extern struct inode *udf_iget(struct super_block *, struct kernel_lb_addr *);
138extern int udf_sync_inode(struct inode *);
139extern void udf_expand_file_adinicb(struct inode *, int, int *); 138extern void udf_expand_file_adinicb(struct inode *, int, int *);
140extern struct buffer_head *udf_expand_dir_adinicb(struct inode *, int *, int *); 139extern struct buffer_head *udf_expand_dir_adinicb(struct inode *, int *, int *);
141extern struct buffer_head *udf_bread(struct inode *, int, int, int *); 140extern struct buffer_head *udf_bread(struct inode *, int, int, int *);