ANDROID: sdcardfs: use wrappers to access i_mutex
authorAmit Pundir <amit.pundir@linaro.org>
Wed, 1 Jun 2016 16:23:20 +0000 (21:53 +0530)
committerDaniel Rosenberg <drosen@google.com>
Tue, 30 Jan 2018 03:40:02 +0000 (19:40 -0800)
commit86f145d3c09eb19f0017bfb24aba50f8c7ec383f
tree7a82a7b17c6e1349be5da1b45f10640d34216d01
parent83f714f965d0ddc191bf72217b65ccefcdc499be
ANDROID: sdcardfs: use wrappers to access i_mutex

Use inode_{lock,unlock,lock_nested} wrappers as suggested by upstream
commit 5955102c9984 (wrappers for ->i_mutex access) for access to
->i_mutex, otherwise we run into following build error:

  CC [M]  fs/sdcardfs/dentry.o
In file included from fs/sdcardfs/dentry.c:21:0:
fs/sdcardfs/sdcardfs.h: In function ‘lock_parent’:
fs/sdcardfs/sdcardfs.h:422:33: error: ‘struct inode’ has no member named ‘i_mutex’
  mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT);
                                 ^
fs/sdcardfs/sdcardfs.h: In function ‘unlock_dir’:
fs/sdcardfs/sdcardfs.h:428:28: error: ‘struct inode’ has no member named ‘i_mutex’
  mutex_unlock(&d_inode(dir)->i_mutex);
                            ^
In file included from ./include/linux/fs.h:19:0,
                 from fs/sdcardfs/sdcardfs.h:31,
                 from fs/sdcardfs/dentry.c:21:
fs/sdcardfs/sdcardfs.h: In function ‘prepare_dir’:
fs/sdcardfs/sdcardfs.h:457:27: error: ‘struct inode’ has no member named ‘i_mutex’
  mutex_lock(&d_inode(dent)->i_mutex);
                           ^
./include/linux/mutex.h:146:44: note: in definition of macro ‘mutex_lock’
 #define mutex_lock(lock) mutex_lock_nested(lock, 0)
                                            ^
In file included from fs/sdcardfs/dentry.c:21:0:
fs/sdcardfs/sdcardfs.h:459:29: error: ‘struct inode’ has no member named‘i_mutex’
  mutex_unlock(&d_inode(dent)->i_mutex);
                             ^
fs/sdcardfs/sdcardfs.h:466:38: error: ‘struct inode’ has no member named ‘i_mutex’
  mutex_unlock(&d_inode(parent.dentry)->i_mutex);
                                      ^

Change-Id: I4c8298045ac511aba5542d9ca967331f550376a5
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
fs/sdcardfs/inode.c
fs/sdcardfs/lookup.c
fs/sdcardfs/sdcardfs.h