diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:34:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:34:18 -0500 |
commit | 9bc9ccd7db1c9f043f75380b5a5b94912046a60e (patch) | |
tree | dd0a1b3396ae9414f668b0110cc39d11268ad3ed /drivers/gpu/drm/drm_fops.c | |
parent | f0230294271f511b41797305b685365a9e569a09 (diff) | |
parent | bdd3536618443809d18868563eeafa63b9d29603 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro:
"All kinds of stuff this time around; some more notable parts:
- RCU'd vfsmounts handling
- new primitives for coredump handling
- files_lock is gone
- Bruce's delegations handling series
- exportfs fixes
plus misc stuff all over the place"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (101 commits)
ecryptfs: ->f_op is never NULL
locks: break delegations on any attribute modification
locks: break delegations on link
locks: break delegations on rename
locks: helper functions for delegation breaking
locks: break delegations on unlink
namei: minor vfs_unlink cleanup
locks: implement delegations
locks: introduce new FL_DELEG lock flag
vfs: take i_mutex on renamed file
vfs: rename I_MUTEX_QUOTA now that it's not used for quotas
vfs: don't use PARENT/CHILD lock classes for non-directories
vfs: pull ext4's double-i_mutex-locking into common code
exportfs: fix quadratic behavior in filehandle lookup
exportfs: better variable name
exportfs: move most of reconnect_path to helper function
exportfs: eliminate unused "noprogress" counter
exportfs: stop retrying once we race with rename/remove
exportfs: clear DISCONNECTED on all parents sooner
exportfs: more detailed comment for path_reconnect
...
Diffstat (limited to 'drivers/gpu/drm/drm_fops.c')
-rw-r--r-- | drivers/gpu/drm/drm_fops.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 3f84277d7036..22d14ecbd3ec 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -148,7 +148,7 @@ int drm_stub_open(struct inode *inode, struct file *filp) | |||
148 | struct drm_minor *minor; | 148 | struct drm_minor *minor; |
149 | int minor_id = iminor(inode); | 149 | int minor_id = iminor(inode); |
150 | int err = -ENODEV; | 150 | int err = -ENODEV; |
151 | const struct file_operations *old_fops; | 151 | const struct file_operations *new_fops; |
152 | 152 | ||
153 | DRM_DEBUG("\n"); | 153 | DRM_DEBUG("\n"); |
154 | 154 | ||
@@ -163,18 +163,13 @@ int drm_stub_open(struct inode *inode, struct file *filp) | |||
163 | if (drm_device_is_unplugged(dev)) | 163 | if (drm_device_is_unplugged(dev)) |
164 | goto out; | 164 | goto out; |
165 | 165 | ||
166 | old_fops = filp->f_op; | 166 | new_fops = fops_get(dev->driver->fops); |
167 | filp->f_op = fops_get(dev->driver->fops); | 167 | if (!new_fops) |
168 | if (filp->f_op == NULL) { | ||
169 | filp->f_op = old_fops; | ||
170 | goto out; | 168 | goto out; |
171 | } | ||
172 | if (filp->f_op->open && (err = filp->f_op->open(inode, filp))) { | ||
173 | fops_put(filp->f_op); | ||
174 | filp->f_op = fops_get(old_fops); | ||
175 | } | ||
176 | fops_put(old_fops); | ||
177 | 169 | ||
170 | replace_fops(filp, new_fops); | ||
171 | if (filp->f_op->open) | ||
172 | err = filp->f_op->open(inode, filp); | ||
178 | out: | 173 | out: |
179 | mutex_unlock(&drm_global_mutex); | 174 | mutex_unlock(&drm_global_mutex); |
180 | return err; | 175 | return err; |