@@ -49,90 +49,6 @@ static int ntfs_ioctl_fitrim(struct ntfs_sb_info *sbi, unsigned long arg)
4949 return 0 ;
5050}
5151
52- /*
53- * ntfs_fileattr_get - inode_operations::fileattr_get
54- */
55- int ntfs_fileattr_get (struct dentry * dentry , struct fileattr * fa )
56- {
57- struct inode * inode = d_inode (dentry );
58- struct ntfs_inode * ni = ntfs_i (inode );
59- u32 flags = 0 ;
60-
61- if (inode -> i_flags & S_IMMUTABLE )
62- flags |= FS_IMMUTABLE_FL ;
63-
64- if (inode -> i_flags & S_APPEND )
65- flags |= FS_APPEND_FL ;
66-
67- if (is_compressed (ni ))
68- flags |= FS_COMPR_FL ;
69-
70- if (is_encrypted (ni ))
71- flags |= FS_ENCRYPT_FL ;
72-
73- fileattr_fill_flags (fa , flags );
74-
75- return 0 ;
76- }
77-
78- /*
79- * ntfs_fileattr_set - inode_operations::fileattr_set
80- */
81- int ntfs_fileattr_set (struct mnt_idmap * idmap , struct dentry * dentry ,
82- struct fileattr * fa )
83- {
84- struct inode * inode = d_inode (dentry );
85- struct ntfs_inode * ni = ntfs_i (inode );
86- u32 flags = fa -> flags ;
87- unsigned int new_fl = 0 ;
88-
89- if (fileattr_has_fsx (fa ))
90- return - EOPNOTSUPP ;
91-
92- if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_COMPR_FL ))
93- return - EOPNOTSUPP ;
94-
95- if (flags & FS_IMMUTABLE_FL )
96- new_fl |= S_IMMUTABLE ;
97-
98- if (flags & FS_APPEND_FL )
99- new_fl |= S_APPEND ;
100-
101- /* Allowed to change compression for empty files and for directories only. */
102- if (!is_dedup (ni ) && !is_encrypted (ni ) &&
103- (S_ISREG (inode -> i_mode ) || S_ISDIR (inode -> i_mode ))) {
104- int err = 0 ;
105- struct address_space * mapping = inode -> i_mapping ;
106-
107- /* write out all data and wait. */
108- filemap_invalidate_lock (mapping );
109- err = filemap_write_and_wait (mapping );
110-
111- if (err >= 0 ) {
112- /* Change compress state. */
113- bool compr = flags & FS_COMPR_FL ;
114- err = ni_set_compress (inode , compr );
115-
116- /* For files change a_ops too. */
117- if (!err )
118- mapping -> a_ops = compr ? & ntfs_aops_cmpr :
119- & ntfs_aops ;
120- }
121-
122- filemap_invalidate_unlock (mapping );
123-
124- if (err )
125- return err ;
126- }
127-
128- inode_set_flags (inode , new_fl , S_IMMUTABLE | S_APPEND );
129-
130- inode_set_ctime_current (inode );
131- mark_inode_dirty (inode );
132-
133- return 0 ;
134- }
135-
13652/*
13753 * ntfs_ioctl - file_operations::unlocked_ioctl
13854 */
@@ -430,7 +346,6 @@ static int ntfs_extend(struct inode *inode, loff_t pos, size_t count,
430346 }
431347
432348 if (extend_init && !is_compressed (ni )) {
433- WARN_ON (ni -> i_valid >= pos );
434349 err = ntfs_extend_initialized_size (file , ni , ni -> i_valid , pos );
435350 if (err )
436351 goto out ;
@@ -1409,8 +1324,6 @@ const struct inode_operations ntfs_file_inode_operations = {
14091324 .get_acl = ntfs_get_acl ,
14101325 .set_acl = ntfs_set_acl ,
14111326 .fiemap = ntfs_fiemap ,
1412- .fileattr_get = ntfs_fileattr_get ,
1413- .fileattr_set = ntfs_fileattr_set ,
14141327};
14151328
14161329const struct file_operations ntfs_file_operations = {
0 commit comments