quota.c (f0eef25339f92f7cd4aeea23d9ae97987a5a1e82) quota.c (5955102c9984fa081b2d570cfac75c97eecf8f3b)
1/*
2 * quota.c - NTFS kernel quota ($Quota) handling. Part of the Linux-NTFS
3 * project.
4 *
5 * Copyright (c) 2004 Anton Altaparmakov
6 *
7 * This program/include file is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as published

--- 34 unchanged lines hidden (view full) ---

43
44 ntfs_debug("Entering.");
45 if (NVolQuotaOutOfDate(vol))
46 goto done;
47 if (!vol->quota_ino || !vol->quota_q_ino) {
48 ntfs_error(vol->sb, "Quota inodes are not open.");
49 return false;
50 }
1/*
2 * quota.c - NTFS kernel quota ($Quota) handling. Part of the Linux-NTFS
3 * project.
4 *
5 * Copyright (c) 2004 Anton Altaparmakov
6 *
7 * This program/include file is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as published

--- 34 unchanged lines hidden (view full) ---

43
44 ntfs_debug("Entering.");
45 if (NVolQuotaOutOfDate(vol))
46 goto done;
47 if (!vol->quota_ino || !vol->quota_q_ino) {
48 ntfs_error(vol->sb, "Quota inodes are not open.");
49 return false;
50 }
51 mutex_lock(&vol->quota_q_ino->i_mutex);
51 inode_lock(vol->quota_q_ino);
52 ictx = ntfs_index_ctx_get(NTFS_I(vol->quota_q_ino));
53 if (!ictx) {
54 ntfs_error(vol->sb, "Failed to get index context.");
55 goto err_out;
56 }
57 err = ntfs_index_lookup(&qid, sizeof(qid), ictx);
58 if (err) {
59 if (err == -ENOENT)

--- 33 unchanged lines hidden (view full) ---

93 * rescan the volume on boot and update all quota entries.
94 */
95 qce->flags |= QUOTA_FLAG_OUT_OF_DATE;
96 /* Ensure the modified flags are written to disk. */
97 ntfs_index_entry_flush_dcache_page(ictx);
98 ntfs_index_entry_mark_dirty(ictx);
99set_done:
100 ntfs_index_ctx_put(ictx);
52 ictx = ntfs_index_ctx_get(NTFS_I(vol->quota_q_ino));
53 if (!ictx) {
54 ntfs_error(vol->sb, "Failed to get index context.");
55 goto err_out;
56 }
57 err = ntfs_index_lookup(&qid, sizeof(qid), ictx);
58 if (err) {
59 if (err == -ENOENT)

--- 33 unchanged lines hidden (view full) ---

93 * rescan the volume on boot and update all quota entries.
94 */
95 qce->flags |= QUOTA_FLAG_OUT_OF_DATE;
96 /* Ensure the modified flags are written to disk. */
97 ntfs_index_entry_flush_dcache_page(ictx);
98 ntfs_index_entry_mark_dirty(ictx);
99set_done:
100 ntfs_index_ctx_put(ictx);
101 mutex_unlock(&vol->quota_q_ino->i_mutex);
101 inode_unlock(vol->quota_q_ino);
102 /*
103 * We set the flag so we do not try to mark the quotas out of date
104 * again on remount.
105 */
106 NVolSetQuotaOutOfDate(vol);
107done:
108 ntfs_debug("Done.");
109 return true;
110err_out:
111 if (ictx)
112 ntfs_index_ctx_put(ictx);
102 /*
103 * We set the flag so we do not try to mark the quotas out of date
104 * again on remount.
105 */
106 NVolSetQuotaOutOfDate(vol);
107done:
108 ntfs_debug("Done.");
109 return true;
110err_out:
111 if (ictx)
112 ntfs_index_ctx_put(ictx);
113 mutex_unlock(&vol->quota_q_ino->i_mutex);
113 inode_unlock(vol->quota_q_ino);
114 return false;
115}
116
117#endif /* NTFS_RW */
114 return false;
115}
116
117#endif /* NTFS_RW */