@@ -81,7 +81,6 @@ typedef struct svc_fh {
8181 struct dentry * fh_dentry ; /* validated dentry */
8282 struct svc_export * fh_export ; /* export pointer */
8383
84- bool fh_locked ; /* inode locked by us */
8584 bool fh_want_write ; /* remount protection taken */
8685 bool fh_no_wcc ; /* no wcc data needed */
8786 bool fh_no_atomic_attr ;
@@ -93,7 +92,7 @@ typedef struct svc_fh {
9392 bool fh_post_saved ; /* post-op attrs saved */
9493 bool fh_pre_saved ; /* pre-op attrs saved */
9594
96- /* Pre-op attributes saved during fh_lock */
95+ /* Pre-op attributes saved when inode is locked */
9796 __u64 fh_pre_size ; /* size before operation */
9897 struct timespec64 fh_pre_mtime ; /* mtime before oper */
9998 struct timespec64 fh_pre_ctime ; /* ctime before oper */
@@ -103,7 +102,7 @@ typedef struct svc_fh {
103102 */
104103 u64 fh_pre_change ;
105104
106- /* Post-op attributes saved in fh_unlock */
105+ /* Post-op attributes saved in fh_fill_post_attrs() */
107106 struct kstat fh_post_attr ; /* full attrs after operation */
108107 u64 fh_post_change ; /* nfsv4 change; see above */
109108} svc_fh ;
@@ -223,8 +222,8 @@ void fh_put(struct svc_fh *);
223222static __inline__ struct svc_fh *
224223fh_copy (struct svc_fh * dst , struct svc_fh * src )
225224{
226- WARN_ON (src -> fh_dentry || src -> fh_locked );
227-
225+ WARN_ON (src -> fh_dentry );
226+
228227 * dst = * src ;
229228 return dst ;
230229}
@@ -323,51 +322,4 @@ static inline u64 nfsd4_change_attribute(struct kstat *stat,
323322extern void fh_fill_pre_attrs (struct svc_fh * fhp );
324323extern void fh_fill_post_attrs (struct svc_fh * fhp );
325324extern void fh_fill_both_attrs (struct svc_fh * fhp );
326-
327- /*
328- * Lock a file handle/inode
329- * NOTE: both fh_lock and fh_unlock are done "by hand" in
330- * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once
331- * so, any changes here should be reflected there.
332- */
333-
334- static inline void
335- fh_lock_nested (struct svc_fh * fhp , unsigned int subclass )
336- {
337- struct dentry * dentry = fhp -> fh_dentry ;
338- struct inode * inode ;
339-
340- BUG_ON (!dentry );
341-
342- if (fhp -> fh_locked ) {
343- printk (KERN_WARNING "fh_lock: %pd2 already locked!\n" ,
344- dentry );
345- return ;
346- }
347-
348- inode = d_inode (dentry );
349- inode_lock_nested (inode , subclass );
350- fh_fill_pre_attrs (fhp );
351- fhp -> fh_locked = true;
352- }
353-
354- static inline void
355- fh_lock (struct svc_fh * fhp )
356- {
357- fh_lock_nested (fhp , I_MUTEX_NORMAL );
358- }
359-
360- /*
361- * Unlock a file handle/inode
362- */
363- static inline void
364- fh_unlock (struct svc_fh * fhp )
365- {
366- if (fhp -> fh_locked ) {
367- fh_fill_post_attrs (fhp );
368- inode_unlock (d_inode (fhp -> fh_dentry ));
369- fhp -> fh_locked = false;
370- }
371- }
372-
373325#endif /* _LINUX_NFSD_NFSFH_H */
0 commit comments