25 #include <linux/module.h>
32 static struct spufs_calls *spufs_calls;
34 #ifdef CONFIG_SPU_FS_MODULE
36 static inline struct spufs_calls *spufs_calls_get(
void)
38 struct spufs_calls *calls =
NULL;
42 if (calls && !try_module_get(calls->owner))
49 static inline void spufs_calls_put(
struct spufs_calls *calls)
51 BUG_ON(calls != spufs_calls);
54 module_put(spufs_calls->owner);
59 static inline struct spufs_calls *spufs_calls_get(
void)
64 static inline void spufs_calls_put(
struct spufs_calls *calls) { }
72 struct spufs_calls *calls;
74 calls = spufs_calls_get();
78 if (
flags & SPU_CREATE_AFFINITY_SPU) {
79 struct fd neighbor = fdget(neighbor_fd);
88 spufs_calls_put(calls);
96 struct spufs_calls *calls;
98 calls = spufs_calls_get();
105 ret = calls->spu_run(arg.
file, unpc, ustatus);
109 spufs_calls_put(calls);
115 struct spufs_calls *calls;
118 calls = spufs_calls_get();
122 ret = calls->coredump_extra_notes_size();
124 spufs_calls_put(calls);
131 struct spufs_calls *calls;
134 calls = spufs_calls_get();
138 ret = calls->coredump_extra_notes_write(file, foffset);
140 spufs_calls_put(calls);
147 struct spufs_calls *calls;
149 calls = spufs_calls_get();
153 calls->notify_spus_active();
154 spufs_calls_put(calls);
171 BUG_ON(spufs_calls->owner != calls->owner);