In RT kernel rw_semaphore uses rt_mutex whose owner should be set to the
task. Add a condition to handle both cases.

fs/aufs/i_op.c: In function 'au_pin_hdir_set_owner':
fs/aufs/i_op.c:627:52: error: 'struct rw_semaphore' has no member named 'owner'
627 |         atomic_long_set(&p->hdir->hi_inode->i_rwsem.owner, (long)task);
|                                                    ^

Signed-off-by: He Zhe <zhe...@windriver.com>
---
 fs/aufs/i_op.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
index edaae92392f2..22ccf97c44cb 100644
--- a/fs/aufs/i_op.c
+++ b/fs/aufs/i_op.c
@@ -624,7 +624,11 @@ int au_pin_hdir_relock(struct au_pin *p)
 
 static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task)
 {
+#ifdef CONFIG_PREEMPT_RT
+       p->hdir->hi_inode->i_rwsem.rtmutex.owner = task;
+#else
        atomic_long_set(&p->hdir->hi_inode->i_rwsem.owner, (long)task);
+#endif
 }
 
 void au_pin_hdir_acquire_nest(struct au_pin *p)
-- 
2.17.1


Reply via email to